Agent skill

Slippage

by alsk1992 in alsk1992/CloddsBot

Slippage estimation, optimization, and protection for trade execution

MITAuto-check passed

Install Slippage

skills CLI
$ npx skills add alsk1992/CloddsBot --skill slippage -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install alsk1992/CloddsBot slippage --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/alsk1992/CloddsBot.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/skills/bundled/slippage .claude/skills/slippage && rm -rf skills-src

Use ~/.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/

Facts

Skill name
slippage
GitHub stars
2.9k
Token cost
~2k tokens
SKILL.md length
160 words
Files
2
Skills in repo
116
Repo updated
First seen
Licence
MIT

At a glance

Slippage estimation, optimization, and protection for trade execution

  • Works in 5 steps: Always estimate first — Check slippage… → Split large orders — Reduce impact on… → Use limit orders — Protect against… → …
  • SKILL.md covers Chat Commands, TypeScript API Reference, Slippage Factors and Protection Modes, plus 1 more section
  • Runs TypeScript scripts from its folder

What it does

Slippage is an agent skill from alsk1992/CloddsBot. Slippage estimation, optimization, and protection for trade execution

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `index.ts`).

The repository describes itself as: Open Source AI trading agent that operates autonomously across 1000+ markets - Polymarket, Kalshi, Binance, Hyperliquid, Solana DEXs, 5 EVM chains. Scans for edge, executes… The licence is MIT.

Example prompts

  • “/slippage”

Requirements

  • Node.js

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Always estimate first — Check slippage before trading
  2. Split large orders — Reduce impact on thin orderbooks
  3. Use limit orders — Protect against unexpected slippage
  4. Trade liquid markets — Higher volume = lower slippage
  5. Monitor execution — Track actual vs expected slippage

What it can do on your machine

Read from SKILL.md and the folder at commit c930628. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Ships script files (TypeScript), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Slippage loads about 2k tokens when it runs. Until then it costs about 20 tokens; SKILL.md has 160 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~20
When it runs · the whole SKILL.md, loaded when a task matches
~2k

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.

Safety

Auto-check passed

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from alsk1992/CloddsBot at commit c930628, republished under its MIT licence (© alsk1992). 160 words, ~1,971 tokens.

Download SKILL.mdSave it as .claude/skills/slippage/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
slippage
description
Slippage estimation, optimization, and protection for trade execution
emoji
📉

Slippage - Complete API Reference

Estimate, minimize, and protect against slippage across all trading platforms.


Chat Commands

Estimate Slippage
/slippage estimate "Trump" YES 5000    Estimate for $5000 order
/slippage BTCUSDT 1.5 BTC              Estimate for futures
/slippage ETH 50 --dex uniswap         Estimate DEX slippage
Analyze Orderbook
/slippage depth "Trump"                Show orderbook depth
/slippage impact 10000                 Price impact for size
/slippage levels "Trump"               Show slippage at sizes
Optimize Execution
/slippage optimize "Trump" YES 10000   Find best execution
/slippage split 50000                  Optimal order splitting
/slippage timing "Trump"               Best times for low slippage
Protection Settings
/slippage max 1%                       Set max slippage tolerance
/slippage protect on                   Enable slippage protection
/slippage revert-threshold 2%          Cancel if slippage exceeds

TypeScript API Reference

Create Slippage Manager
typescript
import { createSlippageManager } from 'clodds/slippage';

const slippage = createSlippageManager({
  // Default tolerance
  defaultMaxSlippage: 0.01,  // 1%

  // Protection
  enableProtection: true,
  revertThreshold: 0.02,  // Cancel if > 2%

  // Data sources
  orderbookDepth: 20,  // Levels to analyze
  refreshInterval: 1000,  // ms
});
Estimate Slippage
typescript
const estimate = await slippage.estimate({
  platform: 'polymarket',
  market: 'trump-win-2028',
  side: 'YES',
  size: 5000,
});

console.log(`Expected slippage: ${estimate.slippage}%`);
console.log(`Price impact: ${estimate.priceImpact}%`);
console.log(`Effective price: ${estimate.effectivePrice}`);
console.log(`Best price: ${estimate.bestPrice}`);
console.log(`Worst price: ${estimate.worstPrice}`);
console.log(`Confidence: ${estimate.confidence}%`);
Analyze Orderbook Depth
typescript
const depth = await slippage.analyzeDepth({
  platform: 'polymarket',
  market: 'trump-win-2028',
  side: 'YES',
});

console.log('Orderbook Depth:');
console.log(`  Liquidity at 0.5%: $${depth.liquidityAt05Pct}`);
console.log(`  Liquidity at 1%: $${depth.liquidityAt1Pct}`);
console.log(`  Liquidity at 2%: $${depth.liquidityAt2Pct}`);
console.log(`  Total depth: $${depth.totalDepth}`);

console.log('\nSlippage by Size:');
for (const level of depth.slippageLevels) {
  console.log(`  $${level.size}: ${level.slippage}% slippage`);
}
Price Impact Analysis
typescript
const impact = await slippage.priceImpact({
  platform: 'polymarket',
  market: 'trump-win-2028',
  side: 'YES',
  sizes: [1000, 5000, 10000, 25000, 50000],
});

console.log('Price Impact Analysis:');
for (const level of impact.levels) {
  console.log(`  $${level.size}:`);
  console.log(`    Slippage: ${level.slippage}%`);
  console.log(`    Impact: ${level.impact}%`);
  console.log(`    Effective: ${level.effectivePrice}`);
}
Optimize Execution
typescript
const optimized = await slippage.optimize({
  platform: 'polymarket',
  market: 'trump-win-2028',
  side: 'YES',
  size: 25000,
  maxSlippage: 0.01,
});

console.log('Optimized Execution:');
console.log(`  Strategy: ${optimized.strategy}`);  // 'single' | 'split' | 'twap'
console.log(`  Expected slippage: ${optimized.expectedSlippage}%`);
console.log(`  vs naive: ${optimized.naiveSlippage}%`);
console.log(`  Savings: $${optimized.savings}`);

if (optimized.strategy === 'split') {
  console.log('\nOrder Split:');
  for (const order of optimized.orders) {
    console.log(`  ${order.size} @ ${order.limitPrice} (${order.delay}s delay)`);
  }
}
Order Splitting
typescript
const split = await slippage.splitOrder({
  platform: 'polymarket',
  market: 'trump-win-2028',
  side: 'YES',
  totalSize: 50000,
  maxSlippagePerOrder: 0.005,  // 0.5% max per order
  minOrderSize: 1000,
});

console.log(`Split into ${split.orders.length} orders:`);
for (const order of split.orders) {
  console.log(`  $${order.size} - expected ${order.expectedSlippage}%`);
}
console.log(`Total expected slippage: ${split.totalSlippage}%`);
console.log(`Execution time: ${split.estimatedTime}s`);
TWAP Execution
typescript
const twap = await slippage.twapSchedule({
  platform: 'polymarket',
  market: 'trump-win-2028',
  side: 'YES',
  totalSize: 100000,
  duration: 3600,  // 1 hour
  intervals: 12,   // 12 orders
});

console.log('TWAP Schedule:');
for (const order of twap.orders) {
  console.log(`  ${order.time}: $${order.size}`);
}
console.log(`Expected avg slippage: ${twap.expectedSlippage}%`);
Best Timing Analysis
typescript
const timing = await slippage.analyzeTiming({
  platform: 'polymarket',
  market: 'trump-win-2028',
  side: 'YES',
  size: 10000,
});

console.log('Best Times for Low Slippage:');
for (const window of timing.bestWindows) {
  console.log(`  ${window.time}: avg ${window.avgSlippage}% slippage`);
  console.log(`    Liquidity: $${window.avgLiquidity}`);
}

console.log('\nWorst Times:');
for (const window of timing.worstWindows) {
  console.log(`  ${window.time}: avg ${window.avgSlippage}% slippage`);
}
Slippage Protection
typescript
// Set protection parameters
slippage.setProtection({
  maxSlippage: 0.01,           // 1% max
  revertThreshold: 0.02,       // Cancel if > 2%
  notifyThreshold: 0.005,      // Alert at 0.5%
  retryOnRevert: true,         // Retry with lower size
  retryReductionPct: 50,       // Reduce size by 50%
});

// Execute with protection
const result = await slippage.executeProtected({
  platform: 'polymarket',
  market: 'trump-win-2028',
  side: 'YES',
  size: 10000,
});

console.log(`Executed: ${result.executed}`);
console.log(`Actual slippage: ${result.actualSlippage}%`);
console.log(`Protected: ${result.protected}`);
if (result.reverted) {
  console.log(`Reverted: ${result.revertReason}`);
}
DEX Slippage (Crypto)
typescript
const dexSlippage = await slippage.estimateDex({
  chain: 'ethereum',
  dex: 'uniswap',
  tokenIn: 'USDC',
  tokenOut: 'ETH',
  amountIn: 50000,
});

console.log('DEX Slippage Estimate:');
console.log(`  Expected out: ${dexSlippage.expectedOut}`);
console.log(`  Min out (1% slip): ${dexSlippage.minOut1Pct}`);
console.log(`  Price impact: ${dexSlippage.priceImpact}%`);
console.log(`  Route: ${dexSlippage.route.join(' → ')}`);
Historical Slippage
typescript
const history = await slippage.getHistory({
  platform: 'polymarket',
  period: '30d',
});

console.log('Historical Slippage:');
console.log(`  Avg slippage: ${history.avgSlippage}%`);
console.log(`  Max slippage: ${history.maxSlippage}%`);
console.log(`  Trades with > 1%: ${history.tradesOver1Pct}`);
console.log(`  Total slippage cost: $${history.totalCost}`);

Slippage Factors

FactorImpactMitigation
Order sizeLarger = more slipSplit orders
LiquidityThin = more slipCheck depth first
VolatilityHigh = more slipUse limit orders
Time of dayOff-hours = more slipTrade peak hours
Market typeNew = more slipAvoid illiquid markets

Protection Modes

ModeBehavior
warnAlert but execute
confirmRequire confirmation
blockCancel if exceeds
retryRetry with smaller size

Best Practices

  1. Always estimate first — Check slippage before trading
  2. Split large orders — Reduce impact on thin orderbooks
  3. Use limit orders — Protect against unexpected slippage
  4. Trade liquid markets — Higher volume = lower slippage
  5. Monitor execution — Track actual vs expected slippage

© alsk1992, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in src/skills/bundled/slippage of alsk1992/CloddsBot.

  • SKILL.md
  • index.ts

Open the folder on GitHubat commit c930628

Compare with similar skills

Slippage 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.

Slippage compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Slippage this skillalsk1992/CloddsBot2.9k—~2kAutomated safety check: PassMIT
Agent Trading Predictorruvnet/ruflo74k2 repos~2.5kAutomated safety check: PassMIT
LLM Trading Agent Securityaffaan-m/ECC276k2 repos~1.2kAutomated safety check: PassMIT
Trade Journal AnalysisHKUDS/Vibe-Trading35k—~1.8kAutomated safety check: PassMIT
Trading Ledgersickn33/agentic-awesome-skills47k1 repos~2.2kAutomated safety check: PassMIT
Pair Trading SignalsHKUDS/Vibe-Trading35k—~651Automated safety check: PassMIT

Similar skills

  • Agent skill for trading-predictor - invoke with $agent-trading-predictor

    74k GitHub starsUsed in 2 repos~2.5k tokens
    Business, Finance & HRAuto-check passed
  • Security patterns for autonomous trading agents with wallet or transaction authority.

    276k GitHub starsUsed in 2 repos~1.2k tokens
    SecurityAuto-check passed
  • Trade Journal Analysis

    HKUDS/Vibe-Trading

    Reads a broker export of your trades (CSV or Excel), builds a trading profile and runs four behavior checks: disposition effect, overtrading, chasing and anchoring.

    35k GitHub stars~1.8k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Trading Ledger

    sickn33/agentic-awesome-skills

    A trading journal that captures the decision, not just the fill: thesis, plan, and emotion at the moment of entry, written to the user's own Notion database; reviews grade decisions, not P&L.

    47k GitHub starsUsed in 1 repo~2.2k tokens
    Business, Finance & HRAuto-check passed
  • Pair Trading Signals

    HKUDS/Vibe-Trading

    Trades mean reversion between two correlated instruments using the Z-score of their price ratio, going long one leg and short the other when the ratio stretches.

    35k GitHub stars~651 tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Finance research toolkit with backtesting, factor analysis, a library of prebuilt alphas, options pricing and a Shadow Account loop that tests rules extracted from your trade journal.

    35k GitHub stars~6.5k tokensUpdated today
    Business, Finance & HRAuto-check passed

More from alsk1992/CloddsBot

All 116 skills in this repo
  • Qmd

    alsk1992/CloddsBot

    Local hybrid search for markdown notes and docs. An agent skill from alsk1992/CloddsBot.

    2.9k GitHub starsUsed in 3 repos~1.2k tokens
    Auto-check passed
  • AI Strategy

    alsk1992/CloddsBot

    AI Strategy - natural language to trades. An agent skill from alsk1992/CloddsBot.

    2.9k GitHub stars~670 tokensUpdated 6 days ago
    Auto-check passed
  • Alerts

    alsk1992/CloddsBot

    Create and manage price alerts for prediction markets. An agent skill from alsk1992/CloddsBot.

    2.9k GitHub stars~460 tokensUpdated 6 days ago
    Auto-check passed
  • Analytics

    alsk1992/CloddsBot

    Performance attribution, trade analytics, and strategy optimization

    2.9k GitHub stars~1.6k tokensUpdated 6 days ago
    Auto-check passed
  • Arbitrage

    alsk1992/CloddsBot

    Automated cross-platform arbitrage detection and monitoring. An agent skill from alsk1992/CloddsBot.

    2.9k GitHub stars~1.7k tokensUpdated 6 days ago
    Auto-check passed
  • Auto Reply

    alsk1992/CloddsBot

    Automatic response rules, patterns, and scheduled messages. An agent skill from alsk1992/CloddsBot.

    2.9k GitHub stars~1.5k tokensUpdated 6 days ago
    Auto-check passed

Questions about Slippage

What does Slippage do?

Slippage estimation, optimization, and protection for trade execution. Slippage is an agent skill from alsk1992/CloddsBot.

How do I install Slippage in Claude Code?

Run `npx skills add alsk1992/CloddsBot --skill slippage -a claude-code`. Or copy the skill folder (src/skills/bundled/slippage in alsk1992/CloddsBot) into .claude/skills/slippage in your project. Claude Code loads it when a task matches its description.

How do I install Slippage in Codex?

Run `npx skills add alsk1992/CloddsBot --skill slippage -a codex`. Or copy the skill folder (src/skills/bundled/slippage in alsk1992/CloddsBot) into .agents/skills/slippage in your project. Codex loads it when a task matches its description.

Can I use Slippage in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alsk1992/CloddsBot --skill slippage -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, .gemini/skills/slippage, .github/skills/slippage and .opencode/skills/slippage in your project.

What does Slippage need to run?

Going by SKILL.md and its folder, Slippage needs TypeScript for the scripts in its folder. Our summary lists: Node.js.

Does Slippage access the network?

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.

Is Slippage safe to install?

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. Review the folder before installing.

What licence does Slippage use?

Slippage is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Slippage use?

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.

What are the alternatives to Slippage?

Skills that share tags, products or a category with Slippage: Agent Trading Predictor (ruvnet/ruflo, 74k stars), LLM Trading Agent Security (affaan-m/ECC, 276k stars), Trade Journal Analysis (HKUDS/Vibe-Trading, 35k stars) and Trading Ledger (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Slippage?

alsk1992 (a GitHub user) maintains it in alsk1992/CloddsBot, which has 2,933 GitHub stars. The repository holds 116 skills in this directory. The repository was last updated on October 2, 2026.

Source: alsk1992/CloddsBot on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.