
Slippage
- 13 installs
- 610 repo stars
- Updated June 26, 2026
- alsk1992/cloddsbot
Slippage is a Claude Code skill for the clodds bot that estimates, minimizes, and protects against slippage across trading platforms.
About
Slippage is a clodds skill that estimates, minimizes, and protects against slippage during trade execution. Developers use it to analyze orderbook depth, model price impact by size, and optimize execution via single, split, or TWAP strategies with protective revert thresholds. It matters for getting better fills on large orders and avoiding excess slippage.
- Estimates slippage and price impact across prediction, futures, and DEX platforms
- Optimizes execution with order splitting and TWAP scheduling
- Slippage protection with revert thresholds and retry-with-lower-size
Slippage by the numbers
- 13 all-time installs (skills.sh)
- Ranked #759 of 1,106 Finance & Trading skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
slippage capabilities & compatibility
- Capabilities
- slippage estimation · execution optimization · twap execution
- Use cases
- trading
What slippage says it does
Estimate, minimize, and protect against slippage across all trading platforms.
Strategy: ${optimized.strategy}`); // 'single' | 'split' | 'twap'
npx skills add https://github.com/alsk1992/cloddsbot --skill slippageAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 13 |
|---|---|
| repo stars | ★ 610 |
| Last updated | June 26, 2026 |
| Repository | alsk1992/cloddsbot ↗ |
What it does
Estimate slippage and optimize a large order via splitting or TWAP with protective revert thresholds.
Who is it for?
Executing large trades while minimizing slippage via splitting, TWAP, and protection thresholds.
Skip if: Small orders where slippage is negligible or platforms without orderbook depth data.
When should I use this skill?
You are placing a sizable order and want to estimate and reduce slippage before execution.
What you get
Orders are estimated, optimally split or scheduled, and cancelled if slippage exceeds a threshold.
- slippage estimate
- execution plan
- protected execution
By the numbers
- 3 execution strategies (single, split, twap)
- default 1% max slippage and 2% revert threshold
Files
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 slippageAnalyze Orderbook
/slippage depth "Trump" Show orderbook depth
/slippage impact 10000 Price impact for size
/slippage levels "Trump" Show slippage at sizesOptimize Execution
/slippage optimize "Trump" YES 10000 Find best execution
/slippage split 50000 Optimal order splitting
/slippage timing "Trump" Best times for low slippageProtection 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
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
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
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
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
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
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
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
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
// 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)
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
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
| Factor | Impact | Mitigation |
|---|---|---|
| Order size | Larger = more slip | Split orders |
| Liquidity | Thin = more slip | Check depth first |
| Volatility | High = more slip | Use limit orders |
| Time of day | Off-hours = more slip | Trade peak hours |
| Market type | New = more slip | Avoid illiquid markets |
---
Protection Modes
| Mode | Behavior |
|---|---|
warn | Alert but execute |
confirm | Require confirmation |
block | Cancel if exceeds |
retry | Retry 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
/**
* Slippage CLI Skill
*
* Commands:
* /slippage estimate <platform> <market> <size> - Estimate slippage
* /slippage config - Show slippage config
* /slippage set max <value> - Set max slippage
*/
// Session-level slippage config
const slippageConfig = {
maxSlippagePct: 1.0,
};
async function execute(args: string): Promise<string> {
const parts = args.trim().split(/\s+/);
const cmd = parts[0]?.toLowerCase() || 'help';
switch (cmd) {
case 'estimate':
case 'est': {
const platform = parts[1];
const market = parts[2];
const size = parseFloat(parts[3]);
if (!platform || !market || isNaN(size)) {
return 'Usage: /slippage estimate <platform> <market-id> <size-usd>';
}
try {
const { createExecutionService } = await import('../../../execution/index');
const service = createExecutionService({} as any);
const estimate = await service.estimateSlippage({
platform: platform as any,
marketId: market,
side: 'buy',
price: 0.50,
size,
});
let output = `**Slippage Estimate**\n\n`;
output += `Platform: ${platform}\n`;
output += `Market: ${market}\n`;
output += `Size: $${size}\n`;
output += `Estimated slippage: ${(estimate.slippage * 100).toFixed(3)}%\n`;
output += `Expected fill price: ${estimate.expectedPrice.toFixed(4)}\n`;
if (estimate.slippage * 100 > slippageConfig.maxSlippagePct) {
output += `\nWarning: Exceeds max slippage (${slippageConfig.maxSlippagePct}%)`;
}
return output;
} catch (err: any) {
return `Slippage estimation failed: ${err?.message || 'Could not load execution service'}`;
}
}
case 'config':
return `**Slippage Config**\n\nMax slippage: ${slippageConfig.maxSlippagePct}%\nSlippage model: orderbook-based\n\nUse \`/slippage set max <pct>\` to change.`;
case 'set': {
if (parts[1] === 'max') {
const value = parseFloat(parts[2]);
if (isNaN(value) || value <= 0 || value > 50) return 'Usage: /slippage set max <percentage> (0-50)';
slippageConfig.maxSlippagePct = value;
return `Max slippage set to ${value}%. Applied to all subsequent estimates.`;
}
return 'Usage: /slippage set max <percentage>';
}
default:
return `**Slippage Commands**
/slippage estimate <platform> <market> <size> - Estimate slippage
/slippage config - Show configuration
/slippage set max <pct> - Set max slippage %`;
}
}
export default {
name: 'slippage',
description: 'Slippage estimation and configuration for order execution',
commands: ['/slippage'],
handle: execute,
};
Related skills
FAQ
How does it reduce slippage on big orders?
It optimizes execution as a single, split, or TWAP strategy and can revert if slippage exceeds a threshold.
What is the protection behavior?
It cancels or retries with a reduced size when actual slippage passes the configured revert threshold.