fetch_nest_vaults

Documentation for eth_defi.erc_4626.vault_protocol.nest.offchain_metadata.fetch_nest_vaults function.

fetch_nest_vaults(cache_path=PosixPath('/home/runner/.tradingstrategy/cache/nest'), api_base_url='https://api.nest.credit/v1', cms_api_base_url='https://cms.nest.credit/api', now_=None, max_cache_duration=datetime.timedelta(days=2), *, allow_stale=True)

Fetch and cache the first-party catalogue of Nest vault entrypoints.

One request obtains contract routes and live statistics; one CMS request obtains the associated product descriptions. The output intentionally keys contracts by chain and address because Nest can deploy equal addresses on more than one EVM network. A successful refresh also updates the in-process adapter cache, so a migration’s freshly verified catalogue is used when rebuilding rows.

Parameters
  • cache_path (pathlib.Path) – Local directory for the process-safe JSON cache.

  • api_base_url (str) – Nest public API base URL, overrideable for tests.

  • cms_api_base_url (str) – Nest CMS public API base URL, overrideable for tests.

  • now – Override the current naive UTC time for deterministic cache tests.

  • max_cache_duration (datetime.timedelta) – Age after which first-party metadata is refreshed.

  • allow_stale (bool) – Use the cache and fall back to it after an API outage. Disable this for migrations that must refetch the current first-party route catalogue.

  • now_ (Optional[datetime.datetime]) –

Returns

Chain-and-address keyed metadata for every NestVault route.

Return type

dict[str, eth_defi.erc_4626.vault_protocol.nest.offchain_metadata.NestVaultMetadata]