Cost Optimize
ruvnet/ruflo
Analyze token usage patterns and recommend cost optimizations with estimated savings
Execution cost estimation, slippage curve modeling, and optimal trade sizing based on AMM liquidity depth
$ npx skills add agiprolabs/claude-trading-skills --skill slippage-modeling -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install agiprolabs/claude-trading-skills slippage-modeling --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/slippage-modeling .claude/skills/slippage-modeling && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "slippage-modeling" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/slippage-modeling into .claude/skills/slippage-modeling/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "slippage-modeling", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/slippage-modelingType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add agiprolabs/claude-trading-skills --skill slippage-modeling -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install agiprolabs/claude-trading-skills slippage-modeling --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/slippage-modeling .agents/skills/slippage-modeling && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "slippage-modeling" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/slippage-modeling into .agents/skills/slippage-modeling/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "slippage-modeling", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add agiprolabs/claude-trading-skills --skill slippage-modeling -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install agiprolabs/claude-trading-skills slippage-modeling --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/slippage-modeling .cursor/skills/slippage-modeling && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "slippage-modeling" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/slippage-modeling into .cursor/skills/slippage-modeling/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "slippage-modeling", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/agiprolabs/claude-trading-skills.git --path skills/slippage-modeling--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add agiprolabs/claude-trading-skills --skill slippage-modeling -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install agiprolabs/claude-trading-skills slippage-modeling --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/slippage-modeling .gemini/skills/slippage-modeling && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "slippage-modeling" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/slippage-modeling into .gemini/skills/slippage-modeling/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "slippage-modeling", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install agiprolabs/claude-trading-skills slippage-modelingInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add agiprolabs/claude-trading-skills --skill slippage-modeling -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/slippage-modeling .github/skills/slippage-modeling && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "slippage-modeling" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/slippage-modeling into .github/skills/slippage-modeling/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "slippage-modeling", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add agiprolabs/claude-trading-skills --skill slippage-modeling -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install agiprolabs/claude-trading-skills slippage-modeling --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/slippage-modeling .opencode/skills/slippage-modeling && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "slippage-modeling" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/slippage-modeling into .opencode/skills/slippage-modeling/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "slippage-modeling", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
slippage-modelingExecution cost estimation, slippage curve modeling, and optimal trade sizing based on AMM liquidity depth
Slippage Modeling is an agent skill from agiprolabs/claude-trading-skills. Execution cost estimation, slippage curve modeling, and optimal trade sizing based on AMM liquidity depth
Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts and reference files (for example `references/cost_model.md`, `references/slippage_math.md` and `scripts/execution_cost.py`).
The repository describes itself as: 68 trading, DeFi, and quantitative finance Agent Skills. Works with Claude Code, Cursor, Codex, Gemini CLI, and 30+ other tools. The licence is MIT.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 981e1d7. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 2 files in scripts/ (Python), which the agent can run.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Slippage Modeling loads about 2k tokens when it runs, and up to ~5k if it reads all its reference files. Until then it costs about 31 tokens; SKILL.md has 832 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from agiprolabs/claude-trading-skills at commit 981e1d7, republished under its MIT licence (© agiprolabs). 832 words, ~1,969 tokens.
.claude/skills/slippage-modeling/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.Estimate execution costs, model slippage curves from AMM mechanics and empirical quotes, and determine optimal trade sizes that keep costs within acceptable thresholds.
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.
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.
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 |
Solana validators prioritize transactions with higher compute unit prices. During congestion or for time-sensitive trades:
Searchers detect pending swaps and sandwich them — buying before your trade (raising the price) and selling after (capturing the difference). MEV cost depends on:
Typical MEV cost: 0–200 bps on vulnerable trades.
Between receiving a quote and landing the transaction on-chain (0.4–2 seconds on Solana), the price may move. Volatile tokens can shift 50–500 bps in that window.
For a pool with reserves (x, y) and invariant k = x * y:
Buying tokens with SOL (input Δx SOL):
tokens_received = y * Δx / (x + Δx)
effective_price = Δx / tokens_received = (x + Δx) / y
spot_price = x / y
price_impact = effective_price / spot_price - 1 = Δx / (x + Δx)Selling tokens for SOL (input Δy tokens):
sol_received = x * Δy / (y + Δy)
effective_price = sol_received / Δy = x / (y + Δy)
spot_price = x / y
price_impact = 1 - effective_price / spot_price = Δy / (y + Δy)Key insight: Slippage scales with trade_size / (reserves + trade_size). This is approximately linear for small trades and accelerates sharply as trade size approaches reserve size.
| Trade / Reserve Ratio | Approximate Slippage |
|---|---|
| 0.1% | 0.1% (1 bp) |
| 1% | 1.0% (100 bps) |
| 5% | 4.8% (476 bps) |
| 10% | 9.1% (909 bps) |
| 25% | 20% (2000 bps) |
| 50% | 33% (3333 bps) |
Concentrated Liquidity Market Makers (Orca Whirlpools, Meteora DLMM) concentrate liquidity in specific price ranges:
clmm_slippage ≈ cp_slippage / concentration_factorTypical concentration factors: 5–50x for well-managed positions.
Theoretical formulas assume single-pool routing. In practice, Jupiter aggregates across multiple pools and routes. Empirical measurement is more accurate:
/quote at multiple trade sizes (0.01, 0.1, 1, 5, 10, 50 SOL)slippage_bps = a * trade_size^bThis captures real routing behavior, multi-pool splitting, and available liquidity.
See scripts/slippage_curve.py for the full implementation.
total_cost_bps = price_impact_bps + fee_bps + priority_fee_bps + mev_risk_bps
total_cost_sol = trade_size_sol * total_cost_bps / 10_000See references/cost_model.md for component breakdowns and worked examples.
For a roundtrip (buy + sell):
roundtrip_cost_bps = entry_impact + exit_impact + 2 * fee_bps + 2 * priority_bps + mev_bpsThe token must move more than roundtrip_cost_bps in your favor to be profitable. For a token with 200 bps entry slippage, 200 bps exit slippage, and 50 bps fees:
roundtrip = 200 + 200 + 50 = 450 bps = 4.5%You need at least a 4.5% price move just to break even.
See scripts/execution_cost.py for automated cost estimation.
Given a slippage curve s(q) = a * q^b, solve for max trade size:
q_max = (threshold_bps / a) ^ (1/b)For large orders, splitting reduces total slippage because each tranche faces a partially-reset order book (on CLMMs) or allows arbitrageurs to rebalance between tranches:
n_tranches = ceil(total_size / q_max)
tranche_size = total_size / n_tranches
wait_between = 2-10 seconds (allow arb rebalancing)Time-Weighted Average Price execution:
| Category | Typical Pool TVL | Slippage for 1 SOL | Slippage for 10 SOL |
|---|---|---|---|
| Blue chip | >$10M | <5 bps | <20 bps |
| Mid-cap | $100K–$10M | 10–50 bps | 50–500 bps |
| Small-cap | $10K–$100K | 50–200 bps | 500–2000 bps |
| Micro/PumpFun | <$10K | 200–2000 bps | Often impossible |
| File | Description |
|---|---|
references/slippage_math.md | AMM slippage derivations, CLMM adjustments, multi-pool routing math |
references/cost_model.md | Total execution cost components, break-even analysis, cost comparison tables |
| File | Description |
|---|---|
scripts/slippage_curve.py | Build empirical slippage curves from Jupiter quotes, fit power-law model |
scripts/execution_cost.py | Estimate total execution cost and break-even for a specific trade |
© agiprolabs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 4 other files (scripts, references) in skills/slippage-modeling of agiprolabs/claude-trading-skills.
Open the folder on GitHubat commit 981e1d7
Slippage Modeling next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Slippage Modeling this skillagiprolabs/claude-trading-skills | 410 | — | ~2k | Automated safety check: Pass | MIT | |
| Cost Optimizeruvnet/ruflo | 74k | — | ~997 | Automated safety check: Notes | MIT | |
| Cloud Cost Optimizationwshobson/agents | 40k | 14 repos | ~1.7k | Automated safety check: Pass | MIT | |
| LLM Cost Optimizationsickn33/agentic-awesome-skills | 47k | 1 repos | ~2.5k | Automated safety check: Pass | MIT | |
| Gke Cost Optimizationgoogle/skills | 21k | — | ~2.1k | Automated safety check: Pass | Apache-2.0 | |
| BigQuery Slot and Cost Optimizergoogle/skills | 21k | — | ~2.3k | Automated safety check: Pass | Apache-2.0 |
ruvnet/ruflo
Analyze token usage patterns and recommend cost optimizations with estimated savings
wshobson/agents
Cuts cloud spend across AWS, Azure, GCP and OCI with cost tagging, rightsizing, commitment and spot pricing models, and architecture changes.
sickn33/agentic-awesome-skills
Reduce LLM API and infrastructure costs through model selection, prompt caching, batching, caching, quantization, and self-hosting strategies.
google/skills
Optimizes GKE costs, rightsizes workloads, and configures Spot VMs, CUDs, cost allocation, and resource quotas.
google/skills
Analyzes BigQuery slot use, query costs and execution bottlenecks from INFORMATION_SCHEMA to diagnose slow queries, slot contention and unpartitioned scans.
davila7/claude-code-templates
Generates cost optimization guidance for Google Cloud workloads based on the Google Cloud Well-Architected Framework (WAF).
agiprolabs/claude-trading-skills
Event-driven backtesting with bar-by-bar execution, complex order types, multiple analyzers, and custom indicators
agiprolabs/claude-trading-skills
Solana token market data via Birdeye — prices, OHLCV, trades, token metadata, security checks, and trader activity
agiprolabs/claude-trading-skills
Broad crypto market data from CoinGecko covering 13,000+ tokens.
agiprolabs/claude-trading-skills
Cointegration testing for pairs trading using Engle-Granger, Johansen, and rolling stability analysis
agiprolabs/claude-trading-skills
Wallet evaluation, monitoring, and copy-trade strategy design for Solana DEX trading
agiprolabs/claude-trading-skills
Cross-asset correlation analysis including rolling correlation, hierarchical clustering, tail dependence, and regime-dependent correlation
Execution cost estimation, slippage curve modeling, and optimal trade sizing based on AMM liquidity depth. Slippage Modeling is an agent skill from agiprolabs/claude-trading-skills.
Run `npx skills add agiprolabs/claude-trading-skills --skill slippage-modeling -a claude-code`. Or copy the skill folder (skills/slippage-modeling in agiprolabs/claude-trading-skills) into .claude/skills/slippage-modeling in your project. Claude Code loads it when a task matches its description.
Run `npx skills add agiprolabs/claude-trading-skills --skill slippage-modeling -a codex`. Or copy the skill folder (skills/slippage-modeling in agiprolabs/claude-trading-skills) into .agents/skills/slippage-modeling in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add agiprolabs/claude-trading-skills --skill slippage-modeling -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/slippage-modeling, .gemini/skills/slippage-modeling, .github/skills/slippage-modeling and .opencode/skills/slippage-modeling in your project.
Going by SKILL.md and its folder, Slippage Modeling needs Python for the scripts in its folder. Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Slippage Modeling is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Slippage Modeling: Cost Optimize (ruvnet/ruflo, 74k stars), Cloud Cost Optimization (wshobson/agents, 40k stars), LLM Cost Optimization (sickn33/agentic-awesome-skills, 47k stars) and Gke Cost Optimization (google/skills, 21k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
agiprolabs (a GitHub user) maintains it in agiprolabs/claude-trading-skills, which has 410 GitHub stars. The repository holds 68 skills in this directory. The repository was last updated on September 3, 2026.
Source: agiprolabs/claude-trading-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.