Swap stETH → WETH
Exchange stETH for WETH instantly at a small discount, without waiting for the Lido withdrawal queue.
What you need
- stETH in your wallet
- Approval for the vault contract to spend your stETH
Steps
- Get a quote - call
getSwapQuote(stEthAmount)to see the expected WETH output, discount, and fee. - Approve the vault to spend your stETH (
stETH.approve(vaultAddress, stEthAmount)). - Call
swapStETHToWETH(stEthAmount, receiver, minEthAmountOut):stEthAmount- amount of stETH to swap.receiver- address to receive the WETH.minEthAmountOut- pass theuserOutvalue fromgetSwapQuotefor slippage protection.
- Receive WETH in the
receiveraddress.

Slippage protection
Always pass a minEthAmountOut. If the vault owner updates the APY or wait-time parameters between your quote and your transaction, SlippageExceeded will revert your transaction instead of giving you less WETH than expected.
Availability
Check maxWethAvailable() to see the maximum stETH the vault can currently accept given its WETH liquidity. Swaps that would exceed this will revert with InsufficientLiquidity.
Swaps are blocked when Lido's bunker mode is active (BunkerModeActive error).