fetch_t3tris_vault_metadata

Documentation for eth_defi.erc_4626.vault_protocol.t3tris.offchain_metadata.fetch_t3tris_vault_metadata function.

fetch_t3tris_vault_metadata(web3, vault_address, *, cache_path=PosixPath('/home/runner/.tradingstrategy/cache/t3tris'), api_base_url='https://api.t3tris.finance/api/v1', now_=None, max_cache_duration=datetime.timedelta(days=2))

Fetch vault metadata from T3tris’ offchain web app API.

  • Uses one JSON cache file per chain and vault

  • Multiprocess safe via file lock

  • Returns None when the vault is not available in the T3tris app API

Parameters
  • web3 (web3.main.Web3) – Web3 instance used to get chain_id and checksum the vault address.

  • vault_address (eth_typing.evm.HexAddress) – Vault contract address.

  • cache_path (pathlib.Path) – Directory for cache files.

  • api_base_url (str) – T3tris API base URL.

  • now – Override current time for testing.

  • max_cache_duration (datetime.timedelta) – How long before refreshing cache.

  • now_ (Optional[datetime.datetime]) –

Return type

Optional[eth_defi.erc_4626.vault_protocol.t3tris.offchain_metadata.T3trisVaultMetadata]