fetch_upshift_vault_metadata

Documentation for eth_defi.erc_4626.vault_protocol.upshift.offchain_metadata.fetch_upshift_vault_metadata function.

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

Fetch cached public metadata for one Upshift vault.

Reads GET /v1/tokenized_vaults/{address} from Upshift’s public API and caches its raw response by EVM chain and vault address. A failed refresh returns a valid stale cache when one exists, so a temporary API outage does not remove already-discovered vault descriptions or strategist identities.

The API exposes named strategists and EOA operators, but no explicit curator field. Callers must not interpret either as a verified curator record without separate registry evidence.

Parameters
  • web3 (web3.main.Web3) – Web3 connection used only to obtain the EVM chain ID.

  • vault_address (Union[eth_typing.evm.HexAddress, str]) – Upshift vault deployment address.

  • cache_path (pathlib.Path) – Directory for cached raw JSON responses.

  • api_base_url (str) – Upshift API root. Override this with a test server URL in tests.

  • now – Optional current naive UTC timestamp for cache-expiry tests.

  • max_cache_duration (datetime.timedelta) – Maximum age of a cache response before refreshing it.

  • timeout (float) – HTTP timeout in seconds.

  • now_ (Optional[datetime.datetime]) –

Returns

Parsed vault metadata, or None when Upshift has no accessible matching record.

Return type

Optional[eth_defi.erc_4626.vault_protocol.upshift.offchain_metadata.UpshiftVaultMetadata]