SwellLibrary

Git Source

A helper library for Swell-related conversions.

Functions

getEthAmountInForLstAmountOut

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

function getEthAmountInForLstAmountOut(ISwEth swEth, uint256 lstAmount) internal view returns (uint256);

Parameters

NameTypeDescription

swEth

ISwEth

address.

lstAmount

uint256

Desired output amount. [WAD]

getLstAmountOutForEthAmountIn

function getLstAmountOutForEthAmountIn(ISwEth swEth, uint256 ethAmount) internal view returns (uint256);

Parameters

NameTypeDescription

swEth

ISwEth

address.

ethAmount

uint256

Amount of ETH to deposit. [WAD]

depositForLst

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

function depositForLst(ISwEth swEth, uint256 ethAmount) internal returns (uint256);

Parameters

NameTypeDescription

swEth

ISwEth

address.

ethAmount

uint256

Amount of ETH to deposit. [WAD]