LidoLibrary

Git Source

A helper library for Lido-related conversions.

Functions

getEthAmountInForLstAmountOut

Returns the amount of ETH needed to mint the given amount of wstETH.

function getEthAmountInForLstAmountOut(IWstEth wstEth, uint256 lstAmount) internal view returns (uint256);

Parameters

Name
Type
Description

wstEth

IWstEth

address.

lstAmount

uint256

Desired output amount. [WAD]

getLstAmountOutForEthAmountIn

Returns the amount of wstETH that can be minted with the given amount of ETH.

function getLstAmountOutForEthAmountIn(IWstEth wstEth, uint256 ethAmount) internal view returns (uint256);

Parameters

Name
Type
Description

wstEth

IWstEth

address.

ethAmount

uint256

Amount of ETH to deposit. [WAD]

depositForLst

Deposits ETH into the wstETH contract and returns the amount of wstETH received.

function depositForLst(IWstEth wstEth, uint256 ethAmount) internal returns (uint256);

Parameters

Name
Type
Description

wstEth

IWstEth

address.

ethAmount

uint256

Amount of ETH to deposit. [WAD]

Errors

WstEthDepositFailed

error WstEthDepositFailed();