agentleFS
tradingstrategy-aitradingstrategy-ai/web3-ethereum-defi/.claude/skills/categorise-vault-strategy/SKILL.md

categorise-vault-strategy

Skill834 starsChanged 3 days agoMITView on GitHub

Categorise a DeFi vault's investment strategy from its address, link, name, and published strategy context. Use when adding or reviewing StrategyTag classifications for VaultBase adapters or native perpetual DEX vault exports, including their maintained tags.py mappings.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 6 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Treat ApeX, Hyperliquid, GRVT, Hibachi, and Lighter as native perpetual DEX integrations, not VaultBase adapters.

    line 23
  2. Very specific:

    Add discretionary_trading when product-specific evidence shows that a person or investment team chooses, approves or rebalances investments.

    line 32
  3. Very specific:

    Prefer the most specific tag and include a relevant parent tag where it conveys useful search or reporting context.

    line 48
  4. Very specific:

    Do not infer a tag merely from a token symbol, protocol name, or generic yield marketing.

    line 51
  5. Distinctive:

    Create or update the protocol tag mapping.

    line 58
  6. Very specific:

    Keep every EVM address key lowercase and scope every entry to an individual vault.

    line 86
  7. Very specific:

    Add or update focused no-RPC coverage.

    line 135
  8. Distinctive:

    Add a numbered migration for the persisted strategy tags.

    line 141
  9. Very specific:

    Read the migration documentation.

    line 143
  10. Distinctive:

    Keep metadata writes out of authoring.

    line 154
  11. Distinctive:

    When a PR is requested, add a Run after merge comment following the migration guide.

    line 156
  12. Distinctive:

    Before the review handoff, run clean-up-for-pr on the completed change.

    line 164
  13. Distinctive:

    When reporting a completed categorisation, output one entry per vault with:

    line 169

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. 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.py and 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 VaultBase adapters. Their vaults are materialised by eth_defi/{slug}/vault_data_export.py with either an address, a platform vault ID, or a synthetic address.
  2. 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.
    • Add discretionary_trading when product-specific evidence shows that a person or investment team chooses, approves or rebalances investments. This includes curator-selected lending markets, yield farms, underlying vaults and credit deals, even when the return comes from interest or fees rather than trading prices. Retain the supported income-mechanism tags.
    • Identify who makes investment decisions separately from who executes them. Human selection with automated execution or allocation can warrant both discretionary_trading and algorithmic_trading, when each is supported. A curator name, admin role, multisig, permissioned deposits or the word “managed” alone does not establish discretion. Fully rules-driven allocation without evidence of human investment choices does not receive the discretionary tag. Routine settlement or reward claiming alone does not establish algorithmic trading either.
    • Record the evidence of human decisions for the exact product in its tag comment. Do not propagate one discretionary product's tags to every vault of the same curator, including fixed-universe and automated products.
    • 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 rwa and rwa_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 returns None, meaning the information is missing. Use unknown only when a researched classification explicitly establishes that the strategy is unknown.
  3. Create or update the protocol tag mapping.

    For a VaultBase adapter, use eth_defi/erc_4626/vault_protocol/{slug}/tags.py with plain lowercase string keys. Do not wrap table literals in verbose HexAddress(...) 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},
    }

    Where the protocol has CHAIN_STRATEGY_TAGS (including Lagoon and Morpho), use its (chain_id, lowercase_address) keys for deployment-specific evidence. Pass the chain ID through both the adapter and persisted-tag resolver; do not let an unrelated same-address deployment inherit the classification.

    Keep every EVM address key lowercase and scope every entry to an individual vault. lookup_strategy_tags() normalises the adapter's HexAddress input 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.lending tag to every vault. Their STRATEGY_TAGS mappings are additive and should contain only additional address-specific classifications.

    For a native perpetual DEX, use eth_defi/{slug}/tags.py with 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 with StrategyTag.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's NON_PERPETUAL_VAULTS set and documenting the exception in the entry comments; do not infer perpetual-futures exposure from the platform name alone.

  4. Wire the classification into the correct data path.

    For a VaultBase adapter, 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 None for an address with no mapping entry.

    For a native perpetual DEX, import the resolver in its vault_data_export.py module and save its return value in the synthetic VaultRow as _strategy_tags. Do not add a fictional vault class or use HexAddress for a non-EVM identifier.

  5. Add or update focused no-RPC coverage. For a VaultBase adapter, check the known address returns the exact tag set and an unmapped address returns None. For a native perpetual DEX, check both the default perpetual_futures tag and an address-specific tag added by its mapping. Format modified Python files and run the focused test.
  6. Add a numbered migration for the persisted strategy tags.

    • Read the migration documentation. Standalone repair scripts are legacy format and must not be used for this task. The retired migrate-vault-strategy-tags.py command is not a production entry point.
    • Allocate a new migration/scripts/NNN-name.py for this tag change, even if initial migration 008 has already run. Successful numbered scripts are immutable and skipped; never reuse 008 as an ongoing refresh command.
    • Reuse collect_strategy_tag_updates() from eth_defi/vault_protocols/repairs/strategy_tags.py against context.metadata(), stage only _strategy_tags, report counts and call context.commit_metadata(). Do not acquire locks in the helper.
    • Keep metadata writes out of authoring; use isolated snapshots for preview and tests when authorised. Do not apply to production while categorising.
    • When a PR is requested, add a Run after merge comment following the migration guide. Stop the daemon and competing writers before both preview and apply, use the direct Compose command for the full pending batch (the host launcher is optional), then restart the same inspected image for cleaning, exports and uploads.

Chat output

Before the review handoff, run clean-up-for-pr on the completed change. When categorisation is part of a larger onboarding task, let that task run cleanup once after its remaining implementation is complete.

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.