Categorise vault strategy
Assign evidence-based strategy tags to a known vault. Keep the maintained address-to-tag mapping next to its vault protocol adapter.
Workflow
Identify the vault and its adapter.
- Resolve the chain and lowercase contract address from the supplied link, address, or name. Do not classify a same-address deployment on a different chain without confirming it is the same product.
- For an ERC-4626 adapter, locate
eth_defi/erc_4626/vault_protocol/{slug}/vault.pyand read its description,short_description, nearby address overlays, and protocol metadata. Use the vault's official documentation or announcement to corroborate material claims. - Treat ApeX, Hyperliquid, GRVT, Hibachi, and Lighter as native perpetual DEX
integrations, not
VaultBaseadapters. Their vaults are materialised byeth_defi/{slug}/vault_data_export.pywith either an address, a platform vault ID, or a synthetic address.
Select tags from
eth_defi.vault.strategy_tag.StrategyTag.- Assign every supported tag that the documented strategy warrants; tags are additive and are not mutually exclusive.
- Prefer the most specific tag and include a relevant parent tag where it
conveys useful search or reporting context. For example, an RWA lending
vault normally receives both
rwaandrwa_lending. - Do not infer a tag merely from a token symbol, protocol name, or generic
yield marketing. When the strategy is not documented well enough, leave
the address out of the mapping:
get_strategy_tags()then returnsNone, meaning the information is missing. Useunknownonly when a researched classification explicitly establishes that the strategy is unknown.
Create or update the protocol tag mapping.
For a
VaultBaseadapter, useeth_defi/erc_4626/vault_protocol/{slug}/tags.pywith plain lowercase string keys. Do not wrap table literals in verboseHexAddress(...)constructors:"""Maintained strategy classifications for {Protocol} vaults.""" from eth_defi.vault.strategy_tag import StrategyTag STRATEGY_TAGS: dict[str, set[StrategyTag]] = { #: Vault: Example RWA lending vault. #: Added: 2026-08-17. #: Decision material: The issuer describes this product as lending #: against real-world assets. #: Sources: #: - https://issuer.example/vaults/example "0x...": {StrategyTag.rwa, StrategyTag.rwa_lending}, }Keep every EVM address key lowercase and scope every entry to an individual vault.
lookup_strategy_tags()normalises the adapter'sHexAddressinput before looking up the string key. Put a Sphinx line-comment block immediately above every address-specific entry. It must include the vault name, the UTC date the tagging entry was added, and the decision material used to assign the tags. Include every page URL consulted during the decision directly in the comment; cite repository files by their path. Do not add an entry where the source material does not support the selected tags. Do not use a bundled or historical research snapshot as the sole evidence for a current address classification; verify the current metadata row or a current official protocol source before adding the entry.Aave, Euler, and Morpho adapters automatically add the generic
StrategyTag.lendingtag to every vault. TheirSTRATEGY_TAGSmappings are additive and should contain only additional address-specific classifications.For a native perpetual DEX, use
eth_defi/{slug}/tags.pywith string keys, because ApeX, GRVT vault IDs and Hibachi/Lighter synthetic addresses are not EVM addresses. Its resolver normally combines the maintained address-specific tags withStrategyTag.perpetual_futures. If the source description explicitly identifies a product as a non-perpetual RWA or fund product, omit that default for the address by adding its lowercase identifier to the protocol'sNON_PERPETUAL_VAULTSset and documenting the exception in the entry comments; do not infer perpetual-futures exposure from the platform name alone.Wire the classification into the correct data path.
For a
VaultBaseadapter, ensure the corresponding vault class reads the mapping:from eth_defi.erc_4626.vault_protocol.{slug}.tags import STRATEGY_TAGS from eth_defi.vault.strategy_tag import StrategyTag, lookup_strategy_tags def get_strategy_tags(self) -> set[StrategyTag] | None: """Return maintained strategy tags for this vault.""" return lookup_strategy_tags(STRATEGY_TAGS, self.vault_address)Return a copy so callers cannot mutate the maintained mapping. Preserve
Nonefor an address with no mapping entry.For a native perpetual DEX, import the resolver in its
vault_data_export.pymodule and save its return value in the syntheticVaultRowas_strategy_tags. Do not add a fictional vault class or useHexAddressfor a non-EVM identifier.Add or update focused no-RPC coverage. For a
VaultBaseadapter, check the known address returns the exact tag set and an unmapped address returnsNone. For a native perpetual DEX, check both the defaultperpetual_futurestag and an address-specific tag added by its mapping. Format modified Python files and run the focused test.Schedule the production database migration.
Do not update
~/.tradingstrategy/vaults/vault-metadata-db.pickleon a local development machine as part of this workflow. The pickle is a materialised cache; the resolver and focused tests are the source-controlled change.After opening the pull request, post the production migration instructions below as a pull-request comment. The operator must run them only after the code is merged and deployed.
Stop the persistent scanner before the migration so it cannot overwrite the metadata pickle. Run the dry run, inspect its output, then apply the migration and restart the scanner:
source ~/vault-scanner/vault-rpc.env && (cd ~/vault-scanner/web3-ethereum-defi && docker compose stop vault-scanner-looped) source ~/vault-scanner/vault-rpc.env && (cd ~/vault-scanner/web3-ethereum-defi && docker compose run --rm --entrypoint /bin/bash vault-scanner-oneshot -lc 'DRY_RUN=true python scripts/erc-4626/migrate-vault-strategy-tags.py') source ~/vault-scanner/vault-rpc.env && (cd ~/vault-scanner/web3-ethereum-defi && docker compose run --rm --entrypoint /bin/bash vault-scanner-oneshot -lc 'DRY_RUN=false python scripts/erc-4626/migrate-vault-strategy-tags.py') source ~/vault-scanner/vault-rpc.env && (cd ~/vault-scanner/web3-ethereum-defi && docker compose up -d vault-scanner-looped)
Chat output
When reporting a completed categorisation, output one entry per vault with:
- Vault name
- Vault address
- Tags added
- Link to the production migration comment when a pull request was opened.