erc_4626.vault_protocol.arcadia.offchain_metadata
Documentation for eth_defi.erc_4626.vault_protocol.arcadia.offchain_metadata Python module.
Arcadia-maintained lending pool metadata.
The public pools API lists lending pools and their ERC-4626 tranches. The scanner indexes the tranche address, not the parent lending pool address. Addresses can be shared across chains. Only descriptive fields are retained; live rates are not website copy.
Module Attributes
Official API endpoint, queried with |
|
Descriptive metadata refresh interval. |
|
Backoff after an unavailable or malformed response. |
Functions
|
Look up an Arcadia tranche without requesting each vault separately. |
|
Fetch the complete Arcadia tranche index once per chain and day. |
|
Trim optional API text without coercing malformed objects to strings. |
|
Index all tranches in one complete pool response. |
Classes
Describe one ERC-4626 tranche using its parent pool record. |
- POOLS_API_URL = 'https://api.arcadia.finance/v1/api/pools'
Official API endpoint, queried with
chain_id.
- DEFAULT_CACHE_PATH = PosixPath('/home/runner/.tradingstrategy/cache/arcadia')
Persistent cache of complete per-chain API responses.
- DEFAULT_CACHE_DURATION = datetime.timedelta(days=1)
Descriptive metadata refresh interval.
- UNAVAILABLE_RETRY_DELAY = datetime.timedelta(seconds=300)
Backoff after an unavailable or malformed response.
- class ArcadiaVaultMetadata
Bases:
objectDescribe one ERC-4626 tranche using its parent pool record.
Fields are normalised from the official API, with optional text left unknown when absent. Financial metrics are deliberately excluded.
- tranche_address: eth_typing.evm.HexAddress
Lowercase tranche address, matching the scanner’s vault identity.
- pool_address: eth_typing.evm.HexAddress
Lowercase parent lending pool address.
- __init__(chain_id, tranche_address, pool_address, pool_name, tranche_name, description)
- Parameters
chain_id (int) –
tranche_address (eth_typing.evm.HexAddress) –
pool_address (eth_typing.evm.HexAddress) –
- Return type
None
- normalise_text(value)
Trim optional API text without coercing malformed objects to strings.
Missing and whitespace-only fields remain unknown.
- parse_arcadia_pools(chain_id, payload)
Index all tranches in one complete pool response.
An empty array is a valid chain without pools. Invalid identity fields or malformed record shapes reject the response rather than caching bad data.
- Parameters
- Returns
Lowercase tranche-address index for this chain.
- Raises
ValueError – If the response does not contain valid pool records.
- Return type
dict[eth_typing.evm.HexAddress, eth_defi.erc_4626.vault_protocol.arcadia.offchain_metadata.ArcadiaVaultMetadata]
- fetch_arcadia_vaults(chain_id, *, cache_path=PosixPath('/home/runner/.tradingstrategy/cache/arcadia'), api_url='https://api.arcadia.finance/v1/api/pools', now_=None)
Fetch the complete Arcadia tranche index once per chain and day.
Requests use a 30-second timeout. A failed refresh preserves a valid older index and delays further requests for five minutes. Without an index, adapters can still generate copy from their onchain metadata.
- Parameters
chain_id (int) – EVM chain ID, passed as the API’s
chain_idparameter.cache_path (pathlib.Path) – Directory for atomic JSON response caches.
api_url (str) – Official pools endpoint, overridable for testing.
now – Optional naive UTC clock for deterministic expiry tests.
now_ (Optional[datetime.datetime]) –
- Returns
Tranche index, or
Nonewhen no valid response is available.- Return type
Optional[dict[eth_typing.evm.HexAddress, eth_defi.erc_4626.vault_protocol.arcadia.offchain_metadata.ArcadiaVaultMetadata]]
- fetch_arcadia_vault_metadata(chain_id, vault_address)
Look up an Arcadia tranche without requesting each vault separately.
A miss in a successful index remains cached for the normal daily refresh.
- Parameters
chain_id (int) – Chain on which the tranche is deployed.
vault_address (eth_typing.evm.HexAddress) – ERC-4626 tranche address, in any case.
- Returns
Provider metadata when listed, otherwise
None.- Return type
Optional[eth_defi.erc_4626.vault_protocol.arcadia.offchain_metadata.ArcadiaVaultMetadata]