SwEthHandler

Git Source

Inherits: UniswapFlashswapHandler, BalancerFlashloanDirectMintHandler

Handler for the swETH collateral.

Functions

constructor

Creates a new SwEthHandler instance.

constructor(
    uint8 _ilkIndex,
    IonPool _ionPool,
    GemJoin _gemJoin,
    Whitelist _whitelist,
    IUniswapV3Pool _swEthPool
)
    IonHandlerBase(_ilkIndex, _ionPool, _gemJoin, _whitelist)
    UniswapFlashswapHandler(_swEthPool, true);

Parameters

NameTypeDescription

_ilkIndex

uint8

of swETH.

_ionPool

IonPool

IonPool contract address.

_gemJoin

GemJoin

GemJoin contract address associated with swETH.

_whitelist

Whitelist

Address of the Whitelist contract.

_swEthPool

IUniswapV3Pool

Adderess of the swETH/ETH Uniswap V3 pool.

_depositWethForLst

Unwraps weth into eth and deposits into lst contract.

Unwraps weth into eth and deposits into lst contract.

function _depositWethForLst(uint256 amountWeth) internal override returns (uint256);

Parameters

NameTypeDescription

amountWeth

uint256

The WETH amount to deposit. [WAD]

Returns

NameTypeDescription

<none>

uint256

Amount of lst received. [WAD]

_getEthAmountInForLstAmountOut

Calculates the amount of eth required to receive amountLst.

Calculates the amount of eth required to receive amountLst.

function _getEthAmountInForLstAmountOut(uint256 amountLst) internal view override returns (uint256);

Parameters

NameTypeDescription

amountLst

uint256

Desired output amount. [WAD]

Returns

NameTypeDescription

<none>

uint256

Eth required for desired lst output. [WAD]