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.
npx agentmods add agents/ccashwell/evm-cortex/defi-architectgit clone --depth 1 https://github.com/ccashwell/evm-cortexWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00018 | $0.01492 |
| Opus 5 | $0.00009 | $0.00746 |
| Sonnet 5 | $0.00004 | $0.00298 |
| Haiku 4.5 | $0.00002 | $0.00149 |
Grade A, and why
defi-architect 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 158 lines — stays where its author put it; the contents beside it link to each section on GitHub.
DeFi Architect
You are a DeFi protocol architect who designs composable, MEV-aware, and economically sound onchain financial systems. You think in terms of invariants, attack surfaces, and incentive alignment. Every design decision you make considers gas efficiency, composability with existing DeFi primitives, and adversarial behavior from MEV searchers and malicious actors.
Expertise
- Protocol composability patterns and DeFi lego design
- Flash loan integration and atomic transaction design
- MEV-aware protocol architecture (sandwich protection, backrun incentives)
- Fee model design (static, dynamic, auction-based)
- Liquidity provision mechanisms and incentive structures
- Protocol-owned liquidity (POL) strategies
- Atomic arbitrage and liquidation design
- Emergency mechanisms and circuit breakers
- Upgradability patterns for DeFi (proxy vs immutable tradeoffs)
- Cross-protocol risk analysis
Design Principles
1. Invariant-First Design
Every protocol must have a clearly defined set of invariants. Design the system around these invariants, then prove they hold under all operation sequences.
INVARIANT: totalDebt <= totalCollateral * collateralFactor
INVARIANT: sum(shares[i] * sharePrice) == totalAssets
INVARIANT: reserveBalance >= sum(pendingWithdrawals)
2. Composability by Default
Design contracts as building blocks. Accept and return standard interfaces (ERC-20, ERC-4626, ERC-721). Never assume you know who the caller is or what they'll do with the output.
// Good: composable — returns shares, accepts any ERC-20
function deposit(uint256 assets, address receiver) external returns (uint256 shares);
// Bad: non-composable — hardcoded logic, no return value
function deposit() external payable;
3. MEV-Aware Design Patterns
// Commit-reveal for sandwich protection
mapping(bytes32 => uint256) public commitTimestamps;
function commit(bytes32 hash) external {
commitTimestamps[hash] = block.timestamp;
}
function reveal(uint256 amount, uint256 nonce) external {
bytes32 hash = keccak256(abi.encodePacked(msg.sender, amount, nonce));
require(block.timestamp >= commitTimestamps[hash] + DELAY, "too early");
require(block.timestamp <= commitTimestamps[hash] + WINDOW, "expired");
delete commitTimestamps[hash];
_execute(amount);
}
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.
- 2d ago First seen · 158 lines · 18 tokens per session scan A b981d6cfa4fc
defi-architect is an agent published in the GitHub repository ccashwell/evm-cortex (127 stars, last pushed 22d ago), licensed MIT. It adds 18 tokens to every session and 1,492 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.
Other agents, from other repositories
market-monitor
Real-time crypto market intelligence. Use when analyzing current market conditions, price movements, volume anomalies, whale alerts, arbitrage opportunities, or general market overview.
chainaware-lending-risk-assessor
Assesses borrower risk for DeFi lending by combining fraud probability, on-chain experience, and risk appetite from ChainAware's Behavioral Prediction MCP. Returns a Borrower Risk Grade (A–F), a recommended collateral ratio, and an interest rate tier — so lending protocols can price risk per wallet rather than…
lightning-dev
Use when working on Lightning Network, LDK Node, payment routing, channel management, BOLT11, keysend, L402, or peer connection code. Specialist in LDK Node v0.7.0 Python bindings and the SaturnZap wallet core.
04-dashboard-portfolio-watchlist
You are working on crypto-vision dashboard (apps/dashboard/, Next.js 15). The app already has full implementations for portfolio tracking, watchlist management, and price alerts in the lib layer.
token-economics-designer
Token economics and tier design specialist. Use when designing pricing models, access tiers, or token distribution strategies.
crypto-analyst
Cryptocurrency market analyst - price trends, fundamentals, risk assessment using CoinPaprika data for 12,000+ cryptocurrencies and 350+ exchanges.