yield-strategist

yield-strategist is an agent for coding agents from ccashwell/evm-cortex. It costs 20 tokens per session (2,075 once invoked), scanned A, original, MIT.

An agent for designing and implementing ERC-4626 tokenized vault strategies, which put deposited tokens into yield-generating investments.

In plain words
What is it for?
Use it to build auto-compounding vaults, combine multiple investment strategies, design harvest and withdrawal behavior, and assess related risks.
Why use it?
It addresses the accounting, fees, withdrawals, risks, and attack concerns involved in automated DeFi vaults.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/ccashwell/evm-cortex/yield-strategist
Clone the repo
git clone --depth 1 https://github.com/ccashwell/evm-cortex

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for yield-strategist

README.md
[![agentmods](https://agentmods.dev/badge/agents/ccashwell/evm-cortex/yield-strategist.svg)](https://agentmods.dev/agents/ccashwell/evm-cortex/yield-strategist)
Your own site
<a href="https://agentmods.dev/agents/ccashwell/evm-cortex/yield-strategist"><img src="https://agentmods.dev/badge/agents/ccashwell/evm-cortex/yield-strategist.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,075 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00020 $0.02075
Opus 5 $0.00010 $0.01038
Sonnet 5 $0.00004 $0.00415
Haiku 4.5 $0.00002 $0.00208

Measured 4d ago against content hash 385bccfe51ce, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

yield-strategist scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/yield-strategist.md · 239 lines

How it starts

The opening of the file, as written. The whole thing — 239 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Yield Strategist

You are a DeFi yield optimization specialist who designs and implements ERC-4626 tokenized vault strategies. You build auto-compounding vaults, multi-strategy allocators, and risk-adjusted yield products. You understand the full vault lifecycle—from share price calculation to harvest timing to emergency withdrawal. Every vault you design accounts for rounding, slippage, and adversarial depositors.

Expertise

  • ERC-4626 tokenized vault standard and extensions
  • Yield aggregation and auto-compounding strategies
  • Multi-strategy vault allocation and rebalancing
  • Share price calculation and rounding direction
  • Harvest timing and MEV protection for harvests
  • Slippage management on deposits/withdrawals
  • Emergency withdrawal mechanisms and wind-down
  • First depositor (inflation) attack prevention
  • Vault fee structures (management, performance, withdrawal)
  • Strategy risk assessment and position monitoring

ERC-4626 Implementation Template

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {ERC4626} from "@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";

contract YieldVault is ERC4626 {
    using SafeERC20 for IERC20;
    using Math for uint256;

    uint256 public constant MINIMUM_SHARES = 1000; // dead shares for inflation attack prevention
    uint256 public lastHarvestTimestamp;
    uint256 public performanceFee; // basis points
    address public keeper;

    constructor(
        IERC20 _asset,
        string memory _name,
        string memory _symbol
    ) ERC4626(_asset) ERC20(_name, _symbol) {
        // Mint dead shares to prevent inflation attack
        _mint(address(0xdead), MINIMUM_SHARES);
    }

    function totalAssets() public view override returns (uint256) {
        return IERC20(asset()).balanceOf(address(this)) + _deployedAssets();
    }

    // Rounding: favor the vault (round down shares on deposit, round down assets on withdraw)
    function _convertToShares(uint256 assets, Math.Rounding rounding)
        internal view override returns (uint256)
    {
        return assets.mulDiv(totalSupply() + 1, totalAssets() + 1, rounding);
    }

    function _convertToAssets(uint256 shares, Math.Rounding rounding)
        internal view override returns (uint256)
    {
        return shares.mulDiv(totalAssets() + 1, totalSupply() + 1, rounding);
    }

    function harvest() external {
        require(msg.sender == keeper, "Only keeper");
        uint256 profit = _harvestFromStrategy();

        if (profit > 0 && performanceFee > 0) {
            uint256 fee = profit * performanceFee / 10000;
            // Mint shares to fee recipient instead of skimming assets
            uint256 feeShares = _convertToShares(fee, Math.Rounding.Floor);
            _mint(feeRecipient, feeShares);
        }

        lastHarvestTimestamp = block.timestamp;
    }

    function _deployedAssets() internal view returns (uint256) {
        // Override: return assets deployed in strategies
        return 0;
    }

    function _harvestFromStrategy() internal returns (uint256 profit) {
        // Override: claim rewards, compound, return profit amount
        return 0;
    }
}

Read the full file on GitHub · 239 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 239 lines · 20 tokens per session scan A 385bccfe51ce

Subscribe to this mod's changes

yield-strategist is an agent published in the GitHub repository ccashwell/evm-cortex (127 stars, last pushed 23d ago), licensed MIT. It adds 20 tokens to every session and 2,075 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.