erc_4626.estimate
Documentation for eth_defi.erc_4626.estimate Python module.
ERC-4626 estimations.
Deposit: estimate number of shares we are going to receive
Redeem: estimate how much underlying denomination we are going to receive when burning shares
Functions
|
Estimate how much shares we get for a deposit. |
|
Estimate how much denomination token (USDC) we get if we cash out the shares. |
|
Estimate ownership value by the share price. |
- estimate_4626_deposit(vault, denomination_token_amount, block_identifier='latest')
Estimate how much shares we get for a deposit.
The vault should deduct its fees from this amount.
The estimation is done using previewRedeem()
- Returns
Amount of USDC we get when existing the vault with the shares.
- Parameters
vault (eth_defi.erc_4626.vault.ERC4626Vault) –
denomination_token_amount (decimal.Decimal) –
block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, hexbytes.main.HexBytes, int]) –
- Return type
Estimate ownership value by the share price.
- Parameters
vault (eth_defi.erc_4626.vault.ERC4626Vault) –
share_amount (decimal.Decimal) –
block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, hexbytes.main.HexBytes, int]) –
- estimate_4626_redeem(vault, owner, share_amount, receiver=None, block_identifier='latest', fallback_using_share_price=True)
Estimate how much denomination token (USDC) we get if we cash out the shares.
The vault should deduct its fees from this amount.
The estimation is done using previewRedeem()
See also
eth_defi.erc_4626.flow.redeem_4626()for the transaction crafting and notes.
- Parameters
fallback_using_share_price –
If previewRedeem() fails (some vaults may not implement it properly), fall back to estimating the value using the share price.
This will also happen if the vault has lockups (Plutus) and shares cannot be redeemed at the moment.
vault (eth_defi.erc_4626.vault.ERC4626Vault) –
owner (Optional[eth_typing.evm.HexAddress]) –
share_amount (decimal.Decimal) –
receiver (Optional[eth_typing.evm.HexAddress]) –
block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, hexbytes.main.HexBytes, int]) –
- Returns
Amount of USDC we get when existing the vault with the shares.
- Return type