Aggregates quotes from multiple DEXs to discover optimal swap routes and minimize trade slippage.

Install

mkdir -p .claude/skills/routing-dex-trades && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4772" && unzip -o skill.zip -d .claude/skills/routing-dex-trades && rm skill.zip

Installs to .claude/skills/routing-dex-trades

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Route trades across multiple DEXs to find optimal prices with minimal
69 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Aggregate quotes from 1inch, Paraswap, and 0x
  • Discover multi-hop routes for trades
  • Calculate split orders for large trades
  • Assess MEV risk before trade execution
  • Minimize slippage and gas costs

How it works

The skill aggregates quotes from multiple decentralized exchanges, discovers multi-hop routes, and calculates split orders. It also assesses MEV risk to optimize trade execution.

Inputs & outputs

You give it
Source token, destination token, and trade amount
You get back
Best price, output amount, gas cost, recommended venue, or optimal allocation percentages

When to use routing-dex-trades

  • Compare prices across DEXs
  • Find optimal swap routes
  • Assess trade slippage and gas costs
  • Execute split-order trading

About this skill

Routing DEX Trades

Contents

Overview | Prerequisites | Instructions | Output | Error Handling | Examples | Resources

Overview

Optimal trade routing across decentralized exchanges by aggregating quotes from 1inch, Paraswap, and 0x. Discovers multi-hop routes, calculates split orders for large trades, and assesses MEV risk to minimize slippage and gas costs.

Prerequisites

  1. Install Python 3.9+ with httpx, pydantic, and rich packages
  2. Verify network access to aggregator APIs (1inch, Paraswap, 0x)
  3. Optionally add API keys for 1inch and 0x (higher rate limits)
  4. Copy settings: cp ${CLAUDE_SKILL_DIR}/config/settings.yaml.example ${CLAUDE_SKILL_DIR}/config/settings.yaml

Instructions

  1. Get a quick quote for the single best price with gas cost and effective rate:

    python ${CLAUDE_SKILL_DIR}/scripts/dex_router.py ETH USDC 1.0
    
  2. Compare all DEXs to see quotes ranked by effective rate (after gas):

    python ${CLAUDE_SKILL_DIR}/scripts/dex_router.py ETH USDC 5.0 --compare
    
  3. Analyze multi-hop routes to compare direct vs. multi-hop (2-3 pools) with hop-by-hop breakdown:

    python ${CLAUDE_SKILL_DIR}/scripts/dex_router.py ETH USDC 10.0 --routes
    
  4. Split large orders ($10K+) across multiple DEXs to minimize total price impact:

    python ${CLAUDE_SKILL_DIR}/scripts/dex_router.py ETH USDC 100.0 --split
    
  5. Assess MEV risk (sandwich attack risk score: LOW/MEDIUM/HIGH) before executing:

    python ${CLAUDE_SKILL_DIR}/scripts/dex_router.py ETH USDC 50.0 --mev-check
    
  6. Run full analysis combining all features for comprehensive output:

    python ${CLAUDE_SKILL_DIR}/scripts/dex_router.py ETH USDC 25.0 --full --output json
    

Output

  • Quick Quote: Best price, output amount, gas cost, recommended venue
  • Comparison: All venues ranked by effective rate with price impact and gas
  • Route Analysis: Direct vs. multi-hop with hop-by-hop breakdown
  • Split Mode: Optimal allocation percentages with dollar savings vs. single-venue
  • MEV Assessment: Risk score, exposure estimate, protection recommendations

See ${CLAUDE_SKILL_DIR}/references/implementation.md for detailed output examples.

Error Handling

ErrorCauseSolution
API Rate LimitedToo many requestsWait 60s or add API key for higher limits
Quote ExpiredStale price dataRefresh before execution; quotes valid ~30s
No Route FoundLow liquidity tokenTry larger DEXs or reduce trade size
Network TimeoutAggregator downRetry or check aggregator status page

See ${CLAUDE_SKILL_DIR}/references/errors.md for comprehensive error handling.

Examples

Compare prices for a 5 ETH swap:

python ${CLAUDE_SKILL_DIR}/scripts/dex_router.py ETH USDC 5.0 --compare

Find optimal split for a large order:

python ${CLAUDE_SKILL_DIR}/scripts/dex_router.py ETH USDC 100.0 --split

Check MEV risk before executing:

python ${CLAUDE_SKILL_DIR}/scripts/dex_router.py ETH USDC 50.0 --mev-check

See ${CLAUDE_SKILL_DIR}/references/examples.md for multi-hop discovery and MEV-protected execution examples.

Resources

  • ${CLAUDE_SKILL_DIR}/references/implementation.md - Trade size guide, split optimization, MEV scoring, API config
  • 1inch API - Primary aggregator
  • Paraswap API - Secondary aggregator
  • 0x API - Third aggregator
  • Flashbots Protect - MEV protection

Prerequisites

Python 3.9+ with httpx, pydantic, and rich packagesNetwork access to aggregator APIs (1inch, Paraswap, 0x)API keys for 1inch and 0x (optional)

How it compares

This skill automates the process of finding optimal DEX trade routes and assessing MEV risk, which is more efficient than manually comparing prices across multiple exchanges.

Compared to similar skills

routing-dex-trades side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
routing-dex-trades (this skill)127dReviewIntermediate
quant-analyst1032moNo flagsAdvanced
stock-analyzer712moReviewBeginner
pair-trade-screener111moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

quant-analyst

zenobi-us

Expert quantitative analyst specializing in financial modeling, algorithmic trading, and risk analytics. Masters statistical methods, derivatives pricing, and high-frequency trading with focus on mathematical rigor, performance optimization, and profitable strategy development.

103355

stock-analyzer

FrancyJGLisboa

Provides comprehensive technical analysis for stocks and ETFs using RSI, MACD, Bollinger Bands, and other indicators. Activates when user requests stock analysis, technical indicators, trading signals, or market data for specific ticker symbols.

71214

pair-trade-screener

tradermonty

Statistical arbitrage tool for identifying and analyzing pair trading opportunities. Detects cointegrated stock pairs within sectors, analyzes spread behavior, calculates z-scores, and provides entry/exit recommendations for market-neutral strategies. Use when user requests pair trading opportunities, statistical arbitrage screening, mean-reversion strategies, or market-neutral portfolio construction. Supports correlation analysis, cointegration testing, and spread backtesting.

1198

risk-metrics-calculation

wshobson

Calculate portfolio risk metrics including VaR, CVaR, Sharpe, Sortino, and drawdown analysis. Use when measuring portfolio risk, implementing risk limits, or building risk monitoring systems.

881

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

model-usage

openclaw

Use CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.

548

Search skills

Search the agent skills registry