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 skills add j4flmao/agent-skills --skill defi-protocolsgit clone --depth 1 https://github.com/j4flmao/agent-skillsWrote 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.
[](https://agentmods.dev/skills/j4flmao/agent-skills/defi-protocols)<a href="https://agentmods.dev/skills/j4flmao/agent-skills/defi-protocols"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/defi-protocols/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/defi-protocols"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/defi-protocols.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00118 | $0.00842 |
| Opus 5.5 | $0.00047 | $0.00337 |
| Sonnet 5.5 | $0.00024 | $0.00168 |
| Haiku 4.5 | $0.00012 | $0.00084 |
Grade A, and why
defi-protocols 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 8d 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 — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.
DeFi Protocols
Purpose
Explain the core on-chain primitives of DeFi: the constant-product AMM invariant and swap pricing (with fees), and over-collateralized lending with health-factor-driven liquidation. Provides correct reference formulas and minimal Solidity patterns for building or reviewing these protocols.
Agent Protocol
Trigger
User phrases: "AMM math", "x*y=k", "Uniswap swap formula", "lending pool", "health factor", "liquidation design".
Input Context
- Protocol type (DEX/AMM vs lending) and token decimals.
- Fee tier and oracle/price source.
Output Artifact
Formula/architecture explanation with minimal illustrative Solidity. No production deployment.
Response Format
Primitive: {AMM | lending}
Formula: {invariant / health factor}
Risk: {IL | liquidation | oracle}
AMM Math (Constant Product)
The fundamental formula for DEXes like Uniswap V2 is $x \times y = k$. With a 0.30% swap fee, the output for a given input is derived by keeping the product of reserves at least constant after the fee-adjusted input is added (the 997/1000 factors below encode the 0.30% fee).
contract SimpleAMM {
uint public reserve0;
uint public reserve1;
function swap(uint amountIn, bool isToken0) external returns (uint amountOut) {
require(amountIn > 0, "Invalid amount");
(uint reserveIn, uint reserveOut) = isToken0 ? (reserve0, reserve1) : (reserve1, reserve0);
// amountOut = (amountIn * 997 * reserveOut) / (reserveIn * 1000 + amountIn * 997)
uint amountInWithFee = amountIn * 997;
amountOut = (amountInWithFee * reserveOut) / (reserveIn * 1000 + amountInWithFee);
// Update reserves...
}
}
Lending Pool Architecture
Over-collateralized lending requires robust liquidation mechanisms. The Health Factor is (collateral_value * liquidation_threshold) / total_debt_value; when it drops below 1, the position is eligible for liquidation and a liquidator repays debt in exchange for discounted collateral (the liquidation bonus).
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.
- 8d ago Changed · +29 lines · +100 tokens per session 79e8756f4b5c
- 2mo ago First seen · 43 lines · 18 tokens per session scan A fe1d1566185a
defi-protocols is a skill published in the GitHub repository j4flmao/agent-skills (38 stars, last pushed 2d ago), licensed MIT. It adds 118 tokens to every session and 842 once invoked, about $0.0005 per session on Opus 5.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-09-03.
Other skills, from other repositories
analyzing-ethereum-smart-contract-vulnerabilities
Perform static and symbolic analysis of Solidity smart contracts using Slither and Mythril to detect reentrancy, integer overflow, access control, and other vulnerability classes before deployment to Ethereum mainnet.
analyzing-ethereum-smart-contract-vulnerabilities
Perform static and symbolic analysis of Solidity smart contracts using Slither and Mythril to detect reentrancy, integer overflow, access control, and other vulnerability classes before deployment to Ethereum mainnet.
starknet-defi
Execute DeFi operations on Starknet including token swaps via avnu aggregator, DCA recurring buys, STRK staking, and lending/borrowing. Supports gasless transactions.
yield-optimization
Multi-chain yield optimization via yield.xyz (StakeKit). Discover 2,988+ yield opportunities across 75+ blockchains, build deposit/withdrawal transactions with shell scripts, and sign them with a MoonPay wallet. Use when the user wants to earn yield, find the best lending or staking rate, enter/exit a position, or…
starknet-defi
Execute DeFi operations on Starknet including token swaps via avnu aggregator, DCA recurring buys, STRK staking, and lending/borrowing. Supports gasless transactions.
blockchain-expert
Expert-level blockchain, Web3, smart contracts, DeFi, and cryptocurrency development. Use when the user mentions Web3, smart contracts, DeFi, Ethereum, or Solidity, or when the task involves Blockchain Fundamentals, Web3 & DeFi, Smart Contract Security, or Gas Optimization.