EthAdapter
Last updated
Last updated
The EthAdapter is responsible for accepting deposits and withdrawals in ETH, instead of accepting the staked ETH directly. It uses Curve as a trading venue under the hood.
src:
Curve's pool for the ETH <> stETH token pair.
ETH token index in the Curve pool. It is constant 0
.
StETH token index in the Curve pool. It is constant 1
.
ETH token address representation. It is constant 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
StETH token address representation. It is constant 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84
Convert ethAmount
ETH to stETH using Curve pool and returns the resulting amount of stETH.
Parameters
ethAmount
uint256
Amount of ETH to convert
Returns
_0
uint256
Amount of stETH receiveid in exchange
Convert stethAmount
stETH to ETH using Curve pool and returns the resulting amount of ETH.
Parameters
stETHAmount
uint256
Amount of ETH to convert
Returns
_0
uint256
Amount of ETH receiveid in exchange
Deposit msg.value
of ETH, convert to stETH and deposit into vault
Parameters
vault
contract IVault
Pods' strategy vault that will receive the stETH
receiver
address
Address that will be the owner of the Vault's shares
minOutput
uint256
slippage control. Minimum acceptable amount of stETH
Returns
_0
uint256
uint256 Amount of shares returned by vault ERC4626 contract
Redeem shares
shares, receive stETH, trade stETH for ETH and send to receiver
Parameters
vault
contract IVault
Pods' strategy vault that will receive the shares and payback stETH
shares
uint256
Amount of Vault's shares to redeem
receiver
address
Address that will receive back the ETH withdrawn from the vault
minOutput
uint256
slippage control. Minimum acceptable amount of ETH
Returns
_0
uint256
uint256 Amount of assets received from Vault ERC4626
redeemWithPermit shares
shares, receive stETH, trade stETH for ETH and send to receiver
Do not need to approve the shares in advance. The vault tokenized shares supports Permit
Parameters
vault
contract IVault
Pods' strategy vault that will receive the shares and payback stETH
shares
uint256
Amount of Vault's shares to redeem
receiver
address
Address that will receive back the ETH withdrawn from vault
minOutput
uint256
slippage control. Minimum acceptable amount of ETH
deadline
uint256
deadline that this transaction will be valid
v
uint8
recovery id
r
bytes32
ECDSA signature output
s
bytes32
ECDSA signature output
Returns
assets
uint256
Amount of assets received from Vault ERC4626
Withdraw assets
assets, receive stETH, trade stETH for ETH and send to receiver
Do not need to approve the shares in advance. The vault tokenized shares supports Permit
Parameters
vault
contract IVault
Pods' strategy vault that will receive the shares and payback stETH
assets
uint256
Amount of assets (stETH) to redeem
receiver
address
Address that will receive back the ETH withdrawn from the Vault
minOutput
uint256
slippage control. Minimum acceptable amount of ETH
Returns
shares
uint256
Amount of shares burned in order to receive assets
withdrawWithPermit assets
assets, receive stETH, trade stETH for ETH and send to receiver
Do not need to approve the shares in advance. Vault's tokenized shares supports Permit
Parameters
vault
contract IVault
Pods' strategy vault that will receive the shares and payback stETH
assets
uint256
Amount of assets (stETH) to redeem
receiver
address
Address that will receive back the ETH withdrawn from the Vault
minOutput
uint256
slippage control. Minimum acceptable amount of ETH
deadline
uint256
deadline that this transaction will be valid
v
uint8
recovery id
r
bytes32
ECDSA signature output
s
bytes32
ECDSA signature output
Returns
shares
uint256
Amount of shares burned in order to receive assets