routing-dex-trades
Route trades across multiple DEXs to find optimal prices with minimal slippage and gas costs. Use when comparing DEX prices, finding optimal swap routes, analyzing price impact, splitting large orders, or assessing MEV risk. Trigger with phrases like "find best swap", "compare DEX prices", "route trade", "optimal swap route", "split order", "DEX aggregator", "check slippage", or "MEV protection".
Install
mkdir -p .claude/skills/routing-dex-trades && curl -L -o skill.zip "https://mcp.directory/api/skills/download/4772" && unzip -o skill.zip -d .claude/skills/routing-dex-trades && rm skill.zipInstalls to .claude/skills/routing-dex-trades
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
- Install Python 3.9+ with
httpx,pydantic, andrichpackages - Verify network access to aggregator APIs (1inch, Paraswap, 0x)
- Optionally add API keys for 1inch and 0x (higher rate limits)
- Copy settings:
cp ${CLAUDE_SKILL_DIR}/config/settings.yaml.example ${CLAUDE_SKILL_DIR}/config/settings.yaml
Instructions
- 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 - 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 - 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 - 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 - 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 - 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
| Error | Cause | Solution |
|---|---|---|
| API Rate Limited | Too many requests | Wait 60s or add API key for higher limits |
| Quote Expired | Stale price data | Refresh before execution; quotes valid ~30s |
| No Route Found | Low liquidity token | Try larger DEXs or reduce trade size |
| Network Timeout | Aggregator down | Retry 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
More by jeremylongshore
View all skills by jeremylongshore →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Related MCP Servers
Browse all serversMindbridge unifies top LLM providers like OpenAI, Anthropic, and Google, enabling easy response comparison and advanced
AI Consultant (OpenRouter) delivers intelligent consultations, multi-model support, and reliable conversation management
Unlock AI-ready web data with Firecrawl: scrape any website, handle dynamic content, and automate web scraping for resea
Boost productivity with Task Master: an AI-powered tool for project management and agile development workflows, integrat
Claude Context offers semantic code search and indexing with vector embeddings and AST-based code splitting. Natural lan
Empower your CLI agents with NotebookLM—connect AI tools for citation-backed answers from your docs, grounded in your ow
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.