Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

more-vaults

БесплатноБез исполняемых скриптовНе проверен

Add more vault smart contract types to an existing protocol

tradingstrategy-aiот tradingstrategy-ai★ 834 звезды на GitHub19 установок в других каталогах

Об этом скилле

Add more vaults to protocol

This skill guides you through adding more smart contract types to the existing vaults.

Required inputs

Before starting, gather the following information from the user:

  1. Vault protocol name: The exiting vault protocol in the codebase
  2. Vault class name: What is the Python class name we use for this vault smart contract type
  3. Vault smart contract address - The address of an example vault contract on a blockchain
  4. Chain - Which blockchain (Ethereum, Arbitrum, Base, etc.)
  5. Block explorer URL - To fetch the ABI (e.g., Etherscan, Arbiscan, Basescan)
  6. Single vault protocol: Some protocols, especially ones issuing out their own stablecoin, are know to have only a single vault for the stablecoin staking. Example protocols are like like Spark, Ethena, Cap. In this case use HARDCODED_PROTOCOLS classification later, as there is no point to create complex vault smart contract detection patterns if the protocol does not need it.

Step-by-step implementation

Step 1: Download and store the ABI

  1. Fetch the vault smart contract ABI from the blockchain explorer
  2. Important: If the contract is a proxy, you need the implementation ABI, not the proxy ABI
    • Check if the contract has a implementation() function or similar
    • Use the explorer's "Read as Proxy" feature to get the implementation address
    • Download the implementation contract's ABI
  3. Create the ABI directory and file:
    eth_defi/abi/{protocol_slug}/
    eth_defi/abi/{protocol_slug}/{ContractName}.json
    
  4. Use eth_defi/abi/lagoon/ as a reference for structure

Step 2: Create the vault class

Update the existing vault protocol Python module to contain a class definitions.

The vault class should be in a new module next to the existing module:

"""Module docstring describing the protocol."""

import datetime
import logging

from eth_typing import BlockIdentifier

from eth_defi.erc_4626.vault import ERC4626Vault

logger = logging.getLogger(__name__)


class {VaultClassName}(ERC4626Vault):
    """Protocol vault support.

    Add few lines descriptiong of the protocol here, from the protocol documentation.

    - Add links to protocol documentation
    - Add links to example contracts on block explorers
    - Add links to github
    """

    def has_custom_fees(self) -> bool:
        """Whether this vault has deposit/withdrawal fees."""
        return False  # Adjust based on protocol

    def get_management_fee(self, block_identifier: BlockIdentifier) -> float:
        """Get the current management fee as a percent.

        :return:
            0.1 = 10%
        """
        # Implement based on protocol's fee structure
        # Generated: Human can add details later
        return None

    def get_performance_fee(self, block_identifier: BlockIdentifier) -> float | None:
        """Get the current performance fee as a percent.

        :return:
            0.1 = 10%
        """
        # Implement based on protocol's fee structure
        # Generated: Human can add details later
        return None

    def get_estimated_lock_up(self) -> datetime.timedelta | None:
        """Get estimated lock-up period if any."""
        return None

    def get_link(self, referral: str | None = None) -> str:
        """Get the vault's web UI link."""
        return f"https://protocol-url.com/vault/{self.vault_address}"

For get_link() check the protocol website to find a direct link URL pattern to its vault. Usual formats:

  • By address
  • By chain id and address - for example Ethereum chain id is 1
  • By chain name and address - use get_chain_name(chain_id).lower() or simiar
  • Can be special for protocols just with one vault, it can be a single link with no pattern
  • If you fail to figure this out, just link to the protocol homepage

Step 3: Add protocol identification probes

Edit eth_defi/erc_4626/classification.py:

  1. In create_probe_calls(), add a probe call that uniquely identifies this protocol:
    • Analyse the ABI and the vault implementation smart contract source code to find a function unique to this protocol
    • Look for functions like getProtocolSpecificData(), custom role constants, etc. and compare them to what is already implemented in create_probe_calls()
    • Make sure this call does not conflict with already configured protocols
    • You can also use blockchain explorer's Contract > Read contract or Contract Read contract as proxy to figure out good ABI calls to detect this particular type of smart contracts
    • If the protocol is a single vault protocol, use HARDCODED_PROTOCOLS in classification.py instead

If you cannot find a such accessor function in the ABI or vault smart contract source, interrupt the skill and ask for user intervention.

# {Protocol Name}
# {Block explorer link}
{protocol_slug}_call = EncodedCall.from_keccak_signature(
    address=address,
    signature=Web3.keccak(text="uniqueFunctio
Полный SKILL.md на GitHub

Установить more-vaults в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл more-vaults?

Add more vault smart contract types to an existing protocol

Как установить скилл more-vaults?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл more-vaults запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить more-vaults с