erc_4626.vault_protocol.euler.offchain_metadata
Documentation for eth_defi.erc_4626.vault_protocol.euler.offchain_metadata Python module.
Euler vault labelling.
Euler has put vault names offchain in Github, because of course Solidity programmers would do something like this
name()accessor in Euler vault returns just a running counterVault metadata is sourced from
{chainId}/products.jsonin the euler-xyz/euler-labels repository
Metadata structure (as of 2026-04)
The old per-vault vaults.json was removed on 2026-04-14. Vault metadata is now
organised at the product level in products.json. A product is a branded
market grouping (e.g. Euler Prime, InfiniFi) that owns one or more vault addresses.
Each product entry contains:
name— product brand name (e.g."Euler Prime")description— long-form description of the productentity— list of entity slugs (resolves againstentities.json)vaults— list of active vault addresses in this productdeprecatedVaults— formerly active vault addressesvaultOverrides— sparse per-vault overrides; only set where a vault needs a differentnameordescriptionfrom its parent product
When building the per-vault reverse index we:
Use
vaultOverrides[addr].name/.descriptionwhen present.Fall back to the parent product’s
name/description.Expose the first entity slug as
entityfor backward compatibility with the oldvaults.jsonAPI; the full list is available asentities.
Reference:
Functions
|
Fetch vault metadata from the offchain |
|
Fetch and cache Euler offchain vault metadata for a given chain. |
Classes
Metadata about an Euler vault derived from the offchain |
- class EulerVaultMetadata
Bases:
TypedDictMetadata about an Euler vault derived from the offchain
products.jsonsource.This TypedDict is the per-vault view built by
fetch_euler_vaults_file_for_chain()from the product-levelproducts.jsonfile.Backward-compatible fields (present in the old
vaults.jsontoo):name— vault display name; falls back to the parent product name when no per-vault override exists.description— vault description; falls back to the product description.entity— first entity slug (e.g."euler-dao"); kept as a plain string for backward compatibility with code that used the oldvaults.jsonformat.
New fields (not present in the old format):
entities— full list of entity slugs for the product (e.g.["euler-dao", "gauntlet"]).product— product slug key (e.g."euler-prime").product_name— product display name (e.g."Euler Prime").deprecated—Trueif this vault address appears indeprecatedVaults.deprecation_reason— human-readable reason fromvaultOverrides, orNone.
Reference:
- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- fetch_euler_vault_metadata(web3, vault_address)
Fetch vault metadata from the offchain
products.jsonsource.Uses a two-level cache: an in-process dict and a disk cache populated by
fetch_euler_vaults_file_for_chain().- Parameters
web3 (web3.main.Web3) – Connected Web3 instance (used to determine chain ID and checksum the address).
vault_address (eth_typing.evm.HexAddress) – Vault contract address.
- Returns
EulerVaultMetadatafor the vault, orNoneif no metadata is available (unrecognised vault or chain has noproducts.json).- Return type
Optional[eth_defi.erc_4626.vault_protocol.euler.offchain_metadata.EulerVaultMetadata]
- fetch_euler_vaults_file_for_chain(chain_id, cache_path=PosixPath('/home/runner/.tradingstrategy/cache/euler'), github_base_url='https://raw.githubusercontent.com/euler-xyz/euler-labels/refs/heads/master', now_=None, max_cache_duration=datetime.timedelta(days=2))
Fetch and cache Euler offchain vault metadata for a given chain.
Fetches
{chainId}/products.jsonfrom theeuler-xyz/euler-labelsGitHub repository, builds a flat per-vault reverse index via_build_vault_index(), and writes the result to a local JSON cache file.The cache is per-chain and expires after max_cache_duration (default 2 days). The function is multiprocess-safe via
wait_other_writers().- Parameters
chain_id (int) – EVM chain ID (e.g.
1for Ethereum mainnet).cache_path – Directory for the local JSON cache files.
github_base_url – Base URL for the
euler-xyz/euler-labelsraw GitHub files.now – Override for “current time” used in cache-expiry checks (useful in tests).
max_cache_duration – How long to keep a cached file before re-fetching from GitHub.
- Returns
Dict mapping checksummed vault address →
EulerVaultMetadata. Returns an empty dict when the chain has no products file.- Return type
dict[str, eth_defi.erc_4626.vault_protocol.euler.offchain_metadata.EulerVaultMetadata]