Skip to main content

Swap wstETH → WETH

Exchange wstETH for WETH instantly. The vault unwraps wstETH to stETH, then executes the same discount-based swap.

What you need

  • wstETH in your wallet
  • Approval for the vault contract to spend your wstETH (only if the vault doesn't already hold enough)

Steps

  1. Get a quote - unwrap your wstETH to its stETH equivalent (wstETH.getStETHByWstETH(amount)), then call getSwapQuote(stEthEquivalent) to see the expected WETH output.
  2. Approve the vault to spend your wstETH (wstETH.approve(vaultAddress, wstETHAmount)).
  3. Call swapWstEthToWeth(wstETHAmount, receiver, minEthAmountOut):
    • wstETHAmount - amount of wstETH to unwrap and swap. Pass type(uint256).max to use the entire vault's wstETH balance (no user pull).
    • receiver - address to receive the WETH.
    • minEthAmountOut - slippage protection; pass the userOut from your quote.
  4. Receive WETH in the receiver address.

Swap tab - wstETH mode, stETH equivalent shown, confirm swap

How the vault handles wstETH

The vault checks its own wstETH balance first. If that is less than wstETHAmount, it pulls the shortfall from the caller. This means you only need an approval for the shortfall, not necessarily the full amount.

After acquiring the wstETH, the vault calls wstETH.unwrap(wstETHAmount) which burns wstETH and mints the equivalent stETH to the vault, then proceeds with the standard stETH swap.