Skip to content
Automation
Skill

/router

Smart order routing for best price, liquidity, and execution

From plugin
cloddsbot
3.1k121 skills

Claude Code

$ npx -y skills add alsk1992/CloddsBot --skill router --agent claude-code

SKILL.md

router.SKILL.md
name: router
description: "Smart order routing for best price, liquidity, and execution"
emoji: "🔀"

Router - Complete API Reference

Route orders to the best platform based on price, liquidity, fees, and execution quality.

---

Chat Commands

Route Order

/route "Trump 2028" YES 1000        Find best route for $1000
/route BTCUSDT long 0.5             Route futures order
/route --mode best-price "Fed" YES  Optimize for price
/route --mode best-liquidity ...    Optimize for fills

Compare Routes

/route compare "Trump" YES 1000     Compare all platforms
/route fees "Trump"                 Compare fee structures
/route liquidity "Trump"            Compare orderbook depth

Execution

/route execute <route-id>           Execute routed order
/route split "Trump" YES 5000       Split across platforms

---

TypeScript API Reference

Create Smart Router

import { createSmartRouter } from 'clodds/router';

const router = createSmartRouter({
  // Supported platforms
  platforms: ['polymarket', 'kalshi', 'manifold'],

  // Default mode
  defaultMode: 'balanced',

  // Fee structures
  fees: {
    polymarket: { maker: -0.005, taker: 0.01 },
    kalshi: { maker: 0, taker: 0.01 },
    manifold: { maker: 0, taker: 0 },
  },
});

Find Best Route

const route = await router.findBestRoute({
  market: 'trump-win-2028',
  side: 'YES',
  size: 1000,
  mode: 'best-price',  // 'best-price' | 'best-liquidity' | 'lowest-fee' | 'balanced'
});

console.log(`Best platform: ${route.platform}`);
console.log(`Expected price: ${route.expectedPrice}`);
console.log(`Expected slippage: ${route.expectedSlippage}%`);
console.log(`Fees: $${route.fees}`);
console.log(`Net cost: $${route.netCost}`);
console.log(`Fill probability: ${route.fillProbability}%`);

Compare All Platforms

const comparison = await router.compare({
  market: 'trump-win-2028',
  side: 'YES',
  size: 1000,
});

console.log('Platform Comparison:');
for (const platform of comparison) {
  console.log(`\n${platform.name}:`);
  console.log(`  Price: ${platform.price}`);
  console.log(`  Liquidity: $${platform.liquidity}`);
  console.log(`  Slippage: ${platform.slippage}%`);
  console.log(`  Fees: $${platform.fees}`);
  console.log(`  Net cost: $${platform.netCost}`);
  console.log(`  Score: ${platform.score}`);
}

Split Order Across Platforms

// Large orders split for better execution
const split = await router.splitOrder({
  market: 'trump-win-2028',
  side: 'YES',
  size: 10000,
  maxSlippage: 0.02,
});

console.log('Order Split:');
for (const leg of split.legs) {
  console.log(`  ${leg.platform}: $${leg.size} @ ${leg.price}`);
}
console.log(`Total slippage: ${split.totalSlippage}%`);
console.log(`Avg price: ${split.avgPrice}`);

Execute Route

// Execute the routed order
const result = await router.execute(route);

console.log(`Order ID: ${result.orderId}`);
console.log(`Platform: ${result.platform}`);
console.log(`Fill price: ${result.fillPrice}`);
console.log(`Slippage: ${result.actualSlippage}%`);
console.log(`Fees: $${result.fees}`);

Routing Modes

// Best price - minimize price paid
const priceRoute = await router.findBestRoute({
  ...order,
  mode: 'best-price',
});

// Best liquidity - maximize fill probability
const liquidityRoute = await router.findBestRoute({
  ...order,
  mode: 'best-liquidity',
});

// Lowest fees - minimize transaction costs
const feeRoute = await router.findBestRoute({
  ...order,
  mode: 'lowest-fee',
});

// Balanced - weighted optimization
const balancedRoute = await router.findBestRoute({
  ...order,
  mode: 'balanced',
  weights: {
    price: 0.4,
    liquidity: 0.3,
    fees: 0.3,
  },
});

Fee Analysis

const fees = await router.analyzeFees({
  market: 'trump-win-2028',
  side: 'YES',
  size: 1000,
});

for (const platform of fees) {
  console.log(`${platform.name}:`);
  console.log(`  Maker fee: ${platform.makerFee}%`);
  console.log(`  Taker fee: ${platform.takerFee}%`);
  console.log(`  For this order: $${platform.totalFee}`);
  console.log(`  Rebate available: ${platform.hasRebate}`);
}

Liquidity Analysis

const liquidity = await router.analyzeLiquidity({
  market: 'trump-win-2028',
  side: 'YES',
});

for (const platform of liquidity) {
  console.log(`${platform.name}:`);
  console.log(`  Best bid: ${platform.bestBid}`);
  console.log(`  Best ask: ${platform.bestAsk}`);
  console.log(`  Spread: ${platform.spread}%`);
  console.log(`  Depth at 1%: $${platform.depth1Pct}`);
  console.log(`  Depth at 2%: $${platform.depth2Pct}`);
}

---

Routing Modes

| Mode | Optimizes For | Best When | |------|---------------|-----------| | `best-price` | Lowest price | Small orders | | `best-liquidity` | Fill probability | Large orders | | `lowest-fee` | Minimize fees | High frequency | | `balanced` | Weighted combo | Default choice |

---

Platform Comparison

| Platform | Maker Fee | Taker Fee | Notes | |----------|-----------|-----------|-------| | **Polymarket** | 0% | 0% | Zero fees on most markets; 15-min crypto markets have dynamic fees | | **Kalshi** | ~0.17% | ~1.2% | Formula-based fees, capped at ~2% | | **Manifold** | 0% | 0% | Play money |

---

Best Practices

1. **Compare before trading** — Always check alternatives 2. **Use maker orders** — Pay no fees on Polymarket (vs dynamic fees on 15-min crypto markets) 3. **Split large orders** — Reduce slippage 4. **Check liquidity** — Don't trade thin markets 5. **Account for fees** — Polymarket: 0% most markets; Kalshi: ~1.2% average

Read more
@alsk1992
Ships withcloddsbot

Open Source AI trading agent that operates autonomously across 1000+ markets - Polymarket, Kalshi, Binance, Hyperliquid, Solana DEXs, 5 EVM chains. Scans for edge, executes instantly, manages risk while you sleep. Agent commerce protocol for machine-to-machine payments. Self-hosted. Built on Claude.

3.1k121 skills
Get the whole plugin

Stars on GitHub

Momentum

stars in total
3.1k
Star history of alsk1992/CloddsBot on GitHub, a chart by star-history.com

Other skills on cloddsbot.

acp

acp

Enable agent-to-agent commerce with on-chain escrow, cryptographic agreements, and service discovery.

@alsk1992@alsk1992Install Skill

More skills from other plugins.

agent-builder

agent-builder

Load immediately after an Agent intent, before the first agent_builder_* call. Governs how you create, configure, test, and…

n8n13d209k
@n8n-io@n8n-ioInstall Skill
browser-use

browser-use

Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work. Also covers…

@browser-use@browser-useInstall Skill
agent-browser

agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…

@vercel-labs-2@vercel-labs-2Install Skill
add-anydoc

add-anydoc

Add local office-document-to-Markdown conversion to NanoClaw agent containers with the pinned Firecrawl AnyDoc CLI. Use when…

@nanocoai@nanocoaiInstall Skill

Questions about router.

Which coding agents can use router?
router installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.