enzyme.offchain_metadata

Documentation for eth_defi.enzyme.offchain_metadata Python module.

Offchain profile metadata handling for Enzyme vault listings.

Enzyme Blue publishes manager-entered vault profiles in its application backend. The app’s unauthenticated GraphQL vaultProfile query currently exposes the vault’s tagline, descriptions and manager contact channels. This is an undocumented application integration. Keep it isolated here and treat both its response schema and address-only resolver contract as changeable: the query has no deployment argument, so Enzyme currently resolves Blue VaultProxy addresses globally.

The separate Enzyme Onyx architecture has no equivalent public profile reader. Onyx metadata is editable in its management application, but its scanner rows therefore retain an explicit unavailable marker until Enzyme publishes a supported reader.

The production scanner never makes thousands of app requests as a side effect of scanning a chain. scripts/enzyme/migrate-offchain-metadata.py fetches the reviewed Blue metadata and saves it in a durable, multiprocess-safe cache. Blue adapters read this cache only; when Enzyme has no manager-entered copy, both description fields remain absent rather than using inferred fallback text.

Module Attributes

ENZYME_APP_GRAPHQL_URL

Undocumented Enzyme application GraphQL endpoint used by the public vault detail page.

ENZYME_APP_VAULT_PROFILE_FIELDS

Public fields returned by the app's vaultProfile resolver.

ENZYME_METADATA_CACHE_VERSION

Current durable cache schema written by the Enzyme metadata migration.

ENZYME_APP_MAX_PROFILE_ALIASES

Maximum public vaultProfile aliases accepted by Enzyme's app backend.

ENZYME_TWITTER_PROFILE_DOMAINS

Profile hosts normalised to X/Twitter handles.

ENZYME_TELEGRAM_PROFILE_DOMAINS

Profile hosts normalised to Telegram handles.

ENZYME_NON_MANAGER_WEBSITE_DOMAINS

Community platforms that are valid contact URLs but not manager identities.

ENZYME_GENERIC_MANAGER_EMAIL_LOCAL_PARTS

Generic email local parts that identify an inbox rather than a manager.

ONYX_PUBLIC_DESCRIPTION_UNAVAILABLE

The exact public catalogue note used when an Onyx manager description is unavailable through a documented public source.

ENZYME_NETWORK_SLUGS

Enzyme application network slugs for reviewed Blue and Onyx deployments.

Functions

create_enzyme_app_session([retries, ...])

Create a pooled retrying session for bounded Enzyme metadata collection.

create_enzyme_vault_link(chain_id, ...)

Create an address-specific Enzyme application URL.

fetch_enzyme_app_vault_metadata_batch(...)

Fetch public profile metadata for a bounded serial batch of Blue vaults.

load_enzyme_blue_vault_metadata(chain_id, ...)

Look up cached Enzyme Blue listing metadata.

load_enzyme_vault_metadata_cache([...])

Load durable app-profile metadata without making an HTTP request.

parse_enzyme_app_vault_metadata(payload)

Parse manager profile data from Enzyme's app GraphQL response.

write_enzyme_vault_metadata_cache(metadata)

Atomically replace the durable Enzyme metadata cache.

Classes

EnzymeVaultMetadata

App-sourced presentation data for one Enzyme Blue vault.

ENZYME_APP_GRAPHQL_URL = 'https://app.enzyme.finance/api/graphql'

Undocumented Enzyme application GraphQL endpoint used by the public vault detail page. The query below is unauthenticated today, but manager updates require an authenticated owner through the app’s updateVaultProfile mutation.

ENZYME_APP_VAULT_PROFILE_FIELDS = ('tagline', 'description', 'managerDescription', 'contactInfo', 'email', 'telegram', 'websiteUrl', 'twitter')

Public fields returned by the app’s vaultProfile resolver.

ENZYME_METADATA_CACHE_VERSION = 2

Current durable cache schema written by the Enzyme metadata migration.

Version two adds manager-contact fields sourced from the app GraphQL reader.

DEFAULT_ENZYME_METADATA_CACHE_PATH = PosixPath('/home/runner/.tradingstrategy/cache/enzyme/vault-metadata.json')

Versioned durable cache populated by the Enzyme metadata migration.

ENZYME_APP_MAX_PROFILE_ALIASES = 5

Maximum public vaultProfile aliases accepted by Enzyme’s app backend.

ENZYME_TWITTER_PROFILE_DOMAINS = frozenset({'twitter.com', 'x.com'})

Profile hosts normalised to X/Twitter handles.

ENZYME_TELEGRAM_PROFILE_DOMAINS = frozenset({'t.me', 'telegram.dog', 'telegram.me'})

Profile hosts normalised to Telegram handles.

ENZYME_NON_MANAGER_WEBSITE_DOMAINS = frozenset({'discord.com', 'discord.gg', 'discordapp.com', 'facebook.com', 'forms.gle', 'github.com', 'instagram.com', 'linkedin.com', 'medium.com', 'members.arcrypto.io', 't.me', 'telegram.me', 'twitter.com', 'x.com', 'youtube.com'})

Community platforms that are valid contact URLs but not manager identities.

ENZYME_GENERIC_MANAGER_EMAIL_LOCAL_PARTS = frozenset({'admin', 'contact', 'fund', 'hello', 'info', 'investors', 'manager', 'support', 'team'})

Generic email local parts that identify an inbox rather than a manager. Keep these out of the public manager field so a website domain can be used as the fallback identifier when it is available.

ONYX_PUBLIC_DESCRIPTION_UNAVAILABLE = 'Description is not publicly available'

The exact public catalogue note used when an Onyx manager description is unavailable through a documented public source.

ENZYME_NETWORK_SLUGS: dict[int, str] = {1: 'ethereum', 137: 'polygon', 8453: 'base', 42161: 'arbitrum'}

Enzyme application network slugs for reviewed Blue and Onyx deployments. Keep these integration-owned values separate from generic display names, which may change independently and are not URL identifiers.

class EnzymeVaultMetadata

Bases: object

App-sourced presentation data for one Enzyme Blue vault.

description: Optional[str]

Longer product description suitable for a detail view.

short_description: Optional[str]

One-line product summary suitable for a table.

manager_description: Optional[str]

Manager-provided biography, separate from the vault product copy.

contact_info: Optional[str]

Free-form manager contact guidance.

contact_email: Optional[str]

Public manager contact email address.

telegram: Optional[str]

Public Telegram handle without an assumed URL format.

twitter: Optional[str]

Public X/Twitter handle without an assumed URL format.

website_url: Optional[str]

Public manager or vault website URL.

manager_name: Optional[str]

Best source-proven manager identifier for the vault catalogue.

__init__(description=None, short_description=None, manager_description=None, contact_info=None, contact_email=None, telegram=None, twitter=None, website_url=None, manager_name=None)
Parameters
Return type

None

parse_enzyme_app_vault_metadata(payload)

Parse manager profile data from Enzyme’s app GraphQL response.

tagline is the compact catalogue description and description is the vault narrative. The app keeps the manager bio and contact channels in separate fields, which must never be merged into the strategy text.

Parameters

payload (object) – Decoded JSON returned by the app’s vaultProfile query.

Returns

Parsed optional listing metadata.

Raises

ValueError – If the response is not a JSON object.

Return type

eth_defi.enzyme.offchain_metadata.EnzymeVaultMetadata

fetch_enzyme_app_vault_metadata_batch(session, *, shares_addresses, timeout)

Fetch public profile metadata for a bounded serial batch of Blue vaults.

Parameters
  • session (requests.sessions.Session) – Shared retrying HTTP session.

  • shares_addresses (list[eth_typing.evm.HexAddress | str]) – Canonical Blue VaultProxy addresses to fetch.

  • timeout (float) – HTTP request timeout in seconds.

Returns

Metadata keyed by each supplied lower-case VaultProxy address.

Raises
  • ValueError – If the app response has a GraphQL error or invalid schema.

  • requests.RequestException – If the request fails.

Return type

dict[eth_typing.evm.HexAddress, eth_defi.enzyme.offchain_metadata.EnzymeVaultMetadata]

create_enzyme_app_session(retries=5, backoff_factor=0.5)

Create a pooled retrying session for bounded Enzyme metadata collection.

The migration submits serial app-profile batches. Retry only transient network and throttling statuses; other HTTP 4xx and schema errors must surface to the operator instead of being disguised as missing metadata.

Parameters
  • retries (int) – Maximum retry count for a transient request failure.

  • backoff_factor (float) – Exponential retry delay factor.

Returns

Thread-shareable configured HTTP session.

Return type

requests.sessions.Session

load_enzyme_vault_metadata_cache(cache_path=PosixPath('/home/runner/.tradingstrategy/cache/enzyme/vault-metadata.json'), *, minimum_version=1)

Load durable app-profile metadata without making an HTTP request.

A malformed cache is ignored with a warning. Blue adapters then expose no offchain copy until a successful metadata migration replaces the cache.

Parameters
  • cache_path (pathlib.Path) – Versioned JSON cache written by the migration.

  • minimum_version (int) – Oldest compatible cache schema to accept. The scanner accepts version one to preserve existing descriptions during an upgrade; the migration requires the current version to collect contacts.

Returns

Address-indexed Enzyme Blue app-profile metadata.

Return type

dict[tuple[int, eth_typing.evm.HexAddress], eth_defi.enzyme.offchain_metadata.EnzymeVaultMetadata]

write_enzyme_vault_metadata_cache(metadata, cache_path=PosixPath('/home/runner/.tradingstrategy/cache/enzyme/vault-metadata.json'))

Atomically replace the durable Enzyme metadata cache.

Cache entries with no text are retained. They document a successful app read whose vault has not supplied descriptions, so the Blue adapter can expose no text rather than infer a strategy.

Parameters
Returns

None after the cache is safely replaced.

Return type

None

Create an address-specific Enzyme application URL.

Blue VaultProxy and Onyx Shares vehicles use the same application route. The canonical address selects the vault and the lower-case network query selects its deployment, so callers never need to fall back to the generic discovery catalogue.

Parameters
Returns

Direct Enzyme vault-detail URL.

Return type

str

load_enzyme_blue_vault_metadata(chain_id, vault_proxy_address)

Look up cached Enzyme Blue listing metadata.

This adapter-facing function deliberately never calls the app backend. The metadata migration warms the durable cache in a bounded batch, keeping ordinary scanner cycles deterministic and independent of app availability. The cache contains successful empty responses, allowing callers to distinguish absent manager copy from a transient app failure.

Parameters
Returns

Cached app-profile metadata, or None when no successful cache entry exists.

Return type

Optional[eth_defi.enzyme.offchain_metadata.EnzymeVaultMetadata]