Skip to main content

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

  1. Get a quote - call getSwapQuote(stEthAmount) to see the expected WETH output, discount, and fee.
  2. Approve the vault to spend your stETH (stETH.approve(vaultAddress, stEthAmount)).
  3. Call swapStETHToWETH(stEthAmount, receiver, minEthAmountOut):
    • stEthAmount - amount of stETH to swap.
    • receiver - address to receive the WETH.
    • minEthAmountOut - pass the userOut value from getSwapQuote for slippage protection.
  4. Receive WETH in the receiver address.

Swap tab - stETH mode, enter amount, see quote, confirm swap

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).