Lido Integration (Liquid Staking)
Lido — de facto standard for liquid staking on Ethereum. stETH integrated in hundreds of DeFi protocols, has $20B+ liquidity. If your DeFi protocol works with ETH — likely need stETH integration.
stETH vs wstETH: Which to Choose
stETH — rebasing token. User balance grows every 24 hours on oracle report. balanceOf() returns different values at different times.
Problem: most DeFi contracts not ready for rebasing. AMM contracts, lending protocols, yield aggregators — they store amount records and don't expect balance changes.
wstETH — wrapped stETH, value-accruing. balanceOf() doesn't change, but wstETH/stETH exchange rate grows. Fully compatible with standard ERC-20 interfaces.
Rule: use wstETH everywhere except final UI for users (there stETH more convenient to show).
Deposit ETH → stETH
// Direct ETH transfer to stETH contract
(bool success,) = address(stETH).call{value: amount}("");
// Or via interface
IStETH stETHContract = IStETH(STETH_ADDRESS);
stETHContract.submit{value: amount}(referralAddress);
Wrap/Unwrap stETH ↔ wstETH
IWstETH wstETH = IWstETH(WSTETH_ADDRESS);
// stETH → wstETH
IERC20(stETH).approve(address(wstETH), stETHAmount);
uint256 wstETHAmount = wstETH.wrap(stETHAmount);
// wstETH → stETH
uint256 stETHAmount = wstETH.unwrap(wstETHAmount);
// Conversion without transaction (view)
uint256 stETHPerWstETH = wstETH.getStETHByWstETH(1e18);
uint256 wstETHPerStETH = wstETH.getWstETHByStETH(1e18);
Price Feeds
Chainlink provides stETH/ETH and wstETH/ETH aggregators.
For wstETH/USD calculation: wstETH/ETH × ETH/USD.
Withdrawal via WithdrawalQueue
Lido integration — one of most documented in DeFi. Docs.lido.fi — excellent reference documentation.







