erc_4626.core
Documentation for eth_defi.erc_4626.core Python module.
ERC-4626 core functions.
Access ERC-4626 ABI
Feature flags vaults can have
Functions
|
Get IERC4626 deployed at some address. |
|
Get IERC4626 interface. |
|
Deduct vault protocol name based on Vault smart contract features. |
|
Check if the vault features indicate a lending protocol. |
Classes
A ERC-4626 detection. |
|
Additional extensionsERc-4626 vault may have. |
- class ERC4262VaultDetection
Bases:
objectA ERC-4626 detection.
- __init__(chain, address, first_seen_at_block, first_seen_at, features, updated_at, deposit_count, redeem_count)
- Parameters
chain (int) –
address (eth_typing.evm.HexAddress) –
first_seen_at_block (int) –
first_seen_at (datetime.datetime) –
features (set[eth_defi.erc_4626.core.ERC4626Feature]) –
updated_at (datetime.datetime) –
deposit_count (int) –
redeem_count (int) –
- Return type
None
- get_spec()
Chain id/address tuple identifying this vault.
- Return type
- class ERC4626Feature
Bases:
enum.EnumAdditional extensionsERc-4626 vault may have.
Helps to classify for which protocol the vault belongs and then extract useful data out of it, like proprietary fee calls.
Flag ERC-4626 matches in the scan with features detected from the smart contract probes
Use name/known calls to flag the protocol for which the vault belongs
- get_deployed_erc_4626_contract(web3, address, abi_fname='lagoon/IERC4626.json')
Get IERC4626 deployed at some address.
- Parameters
web3 (web3.main.Web3) –
address (eth_typing.evm.HexAddress) –
- Return type
web3.contract.contract.Contract
- get_erc_4626_contract(web3)
Get IERC4626 interface.
- Parameters
web3 (web3.main.Web3) –
- Return type
Type[web3.contract.contract.Contract]
- get_vault_protocol_name(features)
Deduct vault protocol name based on Vault smart contract features.
At least one feature must match.
See
eth_defi.erc_4626.classification.identify_vault_features().- Parameters
features (set[eth_defi.erc_4626.core.ERC4626Feature]) – List of detected features for a vault
- Return type
- is_lending_protocol(features)
Check if the vault features indicate a lending protocol.
Lending protocols have borrowers and lenders with utilisation-based liquidity. These vaults support fetch_available_liquidity() and fetch_utilisation_percent() APIs.
- Parameters
features (set[eth_defi.erc_4626.core.ERC4626Feature]) – Set of detected vault features.
- Returns
True if the vault is a lending protocol vault.
- Return type