Get exchange rate

Get exchange rate on Lido

Ethereum
Ethereum
Base
Base

Reads onchain state

Ready to run on Base

Reads how much stETH one whole wstETH is worth right now. wstETH's stEthPerToken returns the current unwrap rate at 18 decimals, which rises as staking rewards accrue to the underlying stETH. Reach for it to value a wstETH balance in stETH or ETH terms, to size an unwrap that yields a target stETH amount, or to measure yield between runs by comparing against a stored rate.

Plug lets you combine onchain actions like this one into a single transaction, without writing a smart contract. Use in App opens a new plug with this action already in it.

ETH to wstETH Swap With Slippage Guard

lido
math
plug
5actions
  1. 1·Get exchange rate

    Reading the Lido contract, this step fetches how much stETH one whole wstETH is currently worth, feeding a live rate into the math that follows.

  2. 2·Multiply then divide

    Using that rate, it computes 0.01 times 1 divided by the exchange rate, rounding down, to size the wstETH expected from the ETH input.

  3. 3·Multiply then divide

    Taking that expected amount, it multiplies by 995 and divides by 1000 rounding down, trimming it to 99.5 percent as a slippage floor.

  4. 4·Swap tokens

    With that floor as the minimum, it swaps 0.01 ETH for at least that much wstETH through the solver over indexed liquidity.

  5. 5·Bubble

    Finally, the swap result is surfaced as the output of this plug.

Get exchange rate of
Calculate times divided by rounded
Calculate times divided by rounded
Swap for at least
Bubble

More plugs on Base

Stake on Base · 9 plugs

More on Lido · 6

On other protocols · 6