slippage-modeling

slippage-modeling is a skill for Claude Code from agiprolabs/claude-trading-skills. It costs 24 tokens per session (2,021 once invoked), scanned A, original, MIT.

A way to estimate how much a decentralized-exchange trade will change its execution price based on available liquidity. It models the relationship between trade size and slippage, where slippage is the difference between the expected and received price.

In plain words
What is it for?
Use it to estimate price impact and fees, build slippage curves from automated-market-maker liquidity, compare trade sizes, and choose an order size or cost threshold.
Why use it?
A trade that is too large for a liquidity pool can move the price sharply and reduce returns. This helps set a size that stays within an acceptable execution cost.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the trading-skills plugin — 68 skills shipped together

not rated 356repo +12 9d ago A scan Socket: passSnyk: warnSkillSpector: warn 24 tokens original MIT

Good fit Use it to estimate price impact and fees, build slippage curves from automated-market-maker liquidity, compare trade sizes, and choose an order size or cost threshold.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/agiprolabs/claude-trading-skills/slippage-modeling
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.

Any agent
npx skills add agiprolabs/claude-trading-skills --skill slippage-modeling
Clone the repo
git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills

Made for: Claude Code.

Or install trading-skills, the plugin that ships this one along with the rest of its 68 skills.

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 slippage-modeling

README.md
[![agentmods](https://agentmods.dev/badge/skills/agiprolabs/claude-trading-skills/slippage-modeling/github.svg)](https://agentmods.dev/skills/agiprolabs/claude-trading-skills/slippage-modeling)
Your own site
<a href="https://agentmods.dev/skills/agiprolabs/claude-trading-skills/slippage-modeling"><img src="https://agentmods.dev/badge/skills/agiprolabs/claude-trading-skills/slippage-modeling/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.

agentmods 80×15 button for slippage-modeling

Your own site · 80×15
<a href="https://agentmods.dev/skills/agiprolabs/claude-trading-skills/slippage-modeling"><img src="https://agentmods.dev/badge/skills/agiprolabs/claude-trading-skills/slippage-modeling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,021 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 21 Mar 2026
  • Snyk warn 21 Mar 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
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 content
    Fix: Review the flagged content for security risks. Ensure no credentials, secrets, or sensitive data are exposed.
How audits are shown
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.1 $0.00024 $0.02021
Opus 5 $0.00012 $0.01010
Sonnet 5 $0.00005 $0.00404
Haiku 4.5 $0.00002 $0.00202

Measured 12d ago against content hash 030f50938f4d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

slippage-modeling 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 12d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/execution_cost.py, scripts/slippage_curve.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/slippage-modeling/SKILL.md · 199 lines

How it starts

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

Slippage Modeling

Estimate execution costs, model slippage curves from AMM mechanics and empirical quotes, and determine optimal trade sizes that keep costs within acceptable thresholds.

What Is Slippage?

Slippage is the difference between the expected price at the time you decide to trade and the actual execution price you receive. On decentralized exchanges, slippage is deterministic and measurable — unlike CEX slippage, which depends on hidden order book dynamics.

Example: You expect to buy a token at 0.001 SOL. Your trade executes at 0.00105 SOL. That 5% difference is slippage — it directly reduces your profit and increases your break-even threshold.

Sources of Slippage

1. AMM Price Impact (Primary Source)

Automated market makers use bonding curves that move price as liquidity is consumed. On a constant-product AMM (x * y = k):

price_impact = Δx / (x + Δx)

Where x is the reserve of the input token and Δx is your trade size. A 1 SOL trade against a pool with 100 SOL reserves produces ~1% price impact. Against 10 SOL reserves, it produces ~10%.

See references/slippage_math.md for full derivations and CLMM adjustments.

2. DEX Fees

Every swap incurs a fee taken from the trade:

DEX Fee Notes
Raydium 0.25% Standard AMM pools
Orca 0.30% Whirlpool concentrated pools
Meteora 0.1–2.0% Dynamic fees based on volatility
PumpFun 1.0% Bonding curve phase

3. Priority Fees

Solana validators prioritize transactions with higher compute unit prices. During congestion or for time-sensitive trades:

  • Normal: 0.0001 SOL (negligible)
  • Competitive: 0.001–0.01 SOL
  • High congestion: 0.01–0.1 SOL

4. MEV (Sandwich Attacks)

Searchers detect pending swaps and sandwich them — buying before your trade (raising the price) and selling after (capturing the difference). MEV cost depends on:

  • Trade size (larger = more attractive target)
  • Token liquidity (thin pools = easier to manipulate)
  • Slippage tolerance setting (higher tolerance = more extractable)

Read the full file on GitHub · 199 lines

Files

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.

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. 12d ago First seen · 199 lines · 24 tokens per session scan A 030f50938f4d

Subscribe to this mod's changes

slippage-modeling is a skill published in the GitHub repository agiprolabs/claude-trading-skills (356 stars, last pushed 9d ago), licensed MIT. It adds 24 tokens to every session and 2,021 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.