Ion Protocol
HomeDiscordTwitter
  • Overview
    • ๐Ÿ’งWelcome to Ion Protocol
    • ๐Ÿ“šUnderstanding the Staking and Restaking Ecosystem
    • ๐Ÿ”—Official Links
    • โ”FAQ
  • Ion Protocol
    • โš™๏ธHow Ion Works
    • ๐Ÿ‘ฅReferrals
    • ๐Ÿ’ฆIon Points
  • Lending
    • ๐Ÿ’ฐHow To Lend On Ion
    • ๐ŸŒETH-on-ETH Yield
    • ๐ŸงชLending Mechanisms
      • Composable Markets
      • ZKML-Supported Risk Underwriting
  • Borrowing
    • ๐Ÿ’ธHow To Borrow On Ion
    • ๐Ÿ“ˆMultiplying Rewards
    • ๐Ÿ› ๏ธBorrowing Mechanisms
      • Flash Leverage
      • Interest Rates
      • ZK Proof-of-Reserve
  • Liquidations
    • ๐Ÿ“‰Liquidation Mechanism
    • ๐Ÿง‘โ€๐Ÿ’ปKeepers
  • Supported Collateral
    • LSTs
    • LRTs
    • Exotic ETH-Backed Assets
  • Devs
    • ๐Ÿ’ปSmart Contract Architecture
      • Home
      • Admin
        • ProxyAdmin
        • TransparentUpgradeableProxy
        • ITransparentUpgradeableProxy
      • Flash
        • LRT
          • RsEthHandler
          • EzEthHandler
          • RswEthHandler
          • WeEthHandler
        • LST
          • SwEthHandler
          • EthXHandler
          • WstEthHandler
        • BalancerFlashloanDirectMintHandler constants
        • BalancerFlashloanDirectMintHandler
        • PtHandler
        • IonHandlerBase
        • UniswapFlashloanBalancerSwapHandler
        • UniswapFlashswapDirectMintHandler
        • UniswapFlashswapDirectMintHandlerWithDust
        • UniswapFlashswapHandler
      • Join
        • GemJoin
      • Libraries
        • LRT
          • KelpDaoLibrary
          • EtherFiLibrary
          • RestakedSwellLibrary
          • RenzoLibrary
        • LST
          • StaderLibrary
          • LidoLibrary
          • SwellLibrary
        • math
          • WadRayMath constants
          • WadRayMath
        • uniswap
          • UniswapOracleLibrary
          • TickMath
      • Oracles
        • Reserve
          • LRT
            • EzEthWstEthReserveOracle
            • RsEthWstEthReserveOracle
            • RswEthWstEthReserveOracle
            • WeEthWstEthReserveOracle
          • LST
            • SwEthReserveOracle
            • EthXReserveOracle
            • WstEthReserveOracle
          • Pendle
            • EzEthPtReserveOracle
            • RsEthPtReserveOracle
            • RswEthPtReserveOracle
            • WeEthPtReserveOracle
          • ReserveOracle
          • ReserveFeed
          • ReserveOracle constants
        • Spot
          • LRT
            • EzEthWstEthSpotOracle
            • RsEthWstEthSpotOracle
            • RswEthWstEthSpotOracle
            • WeEthWstEthSpotOracle
          • LST
            • EthXSpotOracle constants
            • EthXSpotOracle
            • IRedstonePriceFeed
            • SwEthSpotOracle
            • WstEthSpotOracle
          • SpotOracle
          • PtSpotOracle
      • Periphery
        • IonInvariants
        • IonLens
        • IlkSlot0
        • IonRegistry
      • Token
        • IERC20Errors
        • RewardToken
      • Vault
        • VaultFactory
        • Vault
      • Whitelist
      • YieldOracle constants
      • YieldOracle
      • YieldOracleNull
      • YieldOraclePendle
      • Errors
      • Constants
      • Seaport Leverage and Deleverage
    • ๐Ÿ“„Deployed Contracts
  • Security
    • ๐Ÿ”Security Reviews
  • Legal
    • Terms of Use
    • Privacy Policy
  • Import
    • ProxyAdmin
Powered by GitBook
On this page
  • State Variables
  • Functions
  1. Devs
  2. Smart Contract Architecture
  3. Flash
  4. LST

WstEthHandler

PreviousEthXHandlerNextBalancerFlashloanDirectMintHandler constants

Inherits: UniswapFlashswapHandler, BalancerFlashloanDirectMintHandler

Handler for the wstETH collateral.

State Variables

STETH

IERC20 constant STETH = IERC20(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);

Functions

constructor

Creates a new WstEthHandler instance.

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

Parameters

Name
Type
Description

_ilkIndex

uint8

of wstETH.

_ionPool

IonPool

IonPool contract address.

_gemJoin

GemJoin

GemJoin contract address associated with wstETH.

_whitelist

Whitelist

Address of the Whitelist contract.

_wstEthUniswapPool

IUniswapV3Pool

Address of the wstETH/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

Name
Type
Description

amountWeth

uint256

The WETH amount to deposit. [WAD]

Returns

Name
Type
Description

<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

Name
Type
Description

amountLst

uint256

Desired output amount. [WAD]

Returns

Name
Type
Description

<none>

uint256

Eth required for desired lst output. [WAD]

zapDepositAndBorrow

function zapDepositAndBorrow(
    uint256 stEthAmount,
    uint256 amountToBorrow,
    bytes32[] calldata proof
)
    external
    onlyWhitelistedBorrowers(proof);

zapFlashLeverageCollateral

function zapFlashLeverageCollateral(
    uint256 initialDeposit,
    uint256 resultingAdditionalStEthCollateral,
    uint256 maxResultingAdditionalDebt,
    bytes32[] calldata proof
)
    external
    onlyWhitelistedBorrowers(proof);

zapFlashLeverageWeth

function zapFlashLeverageWeth(
    uint256 initialDeposit,
    uint256 resultingAdditionalStEthCollateral,
    uint256 maxResultingAdditionalDebt,
    bytes32[] calldata proof
)
    external
    onlyWhitelistedBorrowers(proof);

zapFlashswapLeverage

function zapFlashswapLeverage(
    uint256 initialDeposit,
    uint256 resultingAdditionalStEthCollateral,
    uint256 maxResultingAdditionalDebt,
    uint160 sqrtPriceLimitX96,
    uint256 deadline,
    bytes32[] calldata proof
)
    external
    checkDeadline(deadline)
    onlyWhitelistedBorrowers(proof);

๐Ÿ’ป
Git Source