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 agiprolabs/claude-trading-skills --skill lp-mathgit clone --depth 1 https://github.com/agiprolabs/claude-trading-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/agiprolabs/claude-trading-skills/lp-math)<a href="https://agentmods.dev/skills/agiprolabs/claude-trading-skills/lp-math"><img src="https://agentmods.dev/badge/skills/agiprolabs/claude-trading-skills/lp-math/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/agiprolabs/claude-trading-skills/lp-math"><img src="https://agentmods.dev/badge/skills/agiprolabs/claude-trading-skills/lp-math.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium analysis-evasion · line 1 Suspicious Unicode normalization or mixed-script contentFix: Review the flagged content for security risks. Ensure no credentials, secrets, or sensitive data are exposed.
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.00023 | $0.02871 |
| Opus 5 | $0.00012 | $0.01435 |
| Sonnet 5 | $0.00005 | $0.00574 |
| Haiku 4.5 | $0.00002 | $0.00287 |
Grade A, and why
lp-math 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 11d 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 — 364 lines — stays where its author put it; the contents beside it link to each section on GitHub.
LP Math — AMM Liquidity Provision Mathematics
Automated Market Makers (AMMs) replace traditional orderbooks with liquidity pools. Instead of matching buyers and sellers, a mathematical formula determines prices based on reserve ratios. Liquidity providers (LPs) deposit both assets into a pool and earn fees from every trade.
Understanding the math behind AMMs is essential for:
- Evaluating whether providing liquidity is profitable after impermanent loss
- Estimating price impact before executing large trades
- Comparing capital efficiency across pool types (constant product vs concentrated)
- Calculating expected fee revenue for a given pool position
Related skills: See impermanent-loss for IL calculations, yield-analysis for LP yield modeling, liquidity-analysis for pool depth assessment.
1. Constant Product AMM (xy = k)
The foundational AMM model used by Raydium V4 and most Solana DEXes.
Core Invariant
x * y = k
Where:
x= reserve amount of token X (e.g., SOL)y= reserve amount of token Y (e.g., USDC)k= constant product (increases over time from fees)
Spot Price
P = x / y (price of Y in terms of X)
P = y / x (price of X in terms of Y)
For a pool with 100 SOL and 10,000 USDC: price of SOL = 10,000 / 100 = 100 USDC.
Trade Execution
When a trader swaps Δx of token X into the pool:
# Output amount (before fees)
delta_y = y * delta_x / (x + delta_x)
# With fee (e.g., 0.3%)
delta_y_after_fee = delta_y * (1 - fee_rate)
# New reserves
x_new = x + delta_x
y_new = y - delta_y_after_fee
The key insight: larger trades get worse prices because each unit moves the ratio further.
Inverse Calculation
To get a specific output amount Δy, the required input is:
delta_x = x * delta_y / (y - delta_y)
Price After Trade
price_new = y_new / x_new
Worked Example
Pool: 100 SOL / 10,000 USDC (k = 1,000,000), fee = 0.3%
Buy 5 SOL worth of USDC:
- Gross output:
10,000 * 5 / (100 + 5) = 476.19 USDC - Fee:
476.19 * 0.003 = 1.43 USDC - Net output:
474.76 USDC - Effective price:
474.76 / 5 = 94.95 USDC/SOL(vs spot 100) - Price impact:
(100 - 94.95) / 100 = 5.05% - New reserves: 105 SOL / 9,525.24 USDC
- New k:
105 * 9,525.24 = 1,000,150.2(k increased from fees)
What ships with it
4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 11d ago First seen · 364 lines · 23 tokens per session scan A dabe3bc9ef02
lp-math is a skill published in the GitHub repository agiprolabs/claude-trading-skills (354 stars, last pushed 8d ago), licensed MIT. It adds 23 tokens to every session and 2,871 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 skills, from other repositories
mpp-agent
Pay HTTP 402 APIs via Machine Payments Protocol (MPP).
bridge
Cross-chain token transfers using Wormhole and CCTP.
hyperliquid
Hyperliquid L1 perps DEX (69% market share).
marginfi
MarginFi — Solana lending and borrowing.
crypto-market-rank
Crypto market rankings and leaderboards. Query trending tokens, top searched tokens, Binance Alpha tokens, tokenized stocks, social hype sentiment ranks, smart money inflow token rankings, top meme token rankings from Pulse launchpad, and top trader PnL leaderboards. Use this skill when users ask about token rankings…
trading-signal
Subscribe and retrieve on-chain Smart Money signals. Monitor trading activities of smart money addresses, including buy/sell signals, trigger price, current price, max gain, and exit rate. Use this skill when users are looking for investment opportunities — smart money signals can serve as valuable references for…