routing-dex-trades

0
0
Source

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

Installs 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

  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

svg-icon-generator

jeremylongshore

Svg Icon Generator - Auto-activating skill for Visual Content. Triggers on: svg icon generator, svg icon generator Part of the Visual Content skill category.

6814

d2-diagram-creator

jeremylongshore

D2 Diagram Creator - Auto-activating skill for Visual Content. Triggers on: d2 diagram creator, d2 diagram creator Part of the Visual Content skill category.

2412

performing-penetration-testing

jeremylongshore

This skill enables automated penetration testing of web applications. It uses the penetration-tester plugin to identify vulnerabilities, including OWASP Top 10 threats, and suggests exploitation techniques. Use this skill when the user requests a "penetration test", "pentest", "vulnerability assessment", or asks to "exploit" a web application. It provides comprehensive reporting on identified security flaws.

379

designing-database-schemas

jeremylongshore

Design and visualize efficient database schemas, normalize data, map relationships, and generate ERD diagrams and SQL statements.

978

performing-security-audits

jeremylongshore

This skill allows Claude to conduct comprehensive security audits of code, infrastructure, and configurations. It leverages various tools within the security-pro-pack plugin, including vulnerability scanning, compliance checking, cryptography review, and infrastructure security analysis. Use this skill when a user requests a "security audit," "vulnerability assessment," "compliance review," or any task involving identifying and mitigating security risks. It helps to ensure code and systems adhere to security best practices and compliance standards.

86

analyzing-logs

jeremylongshore

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

965

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.

643969

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.

591705

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

318399

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.

340397

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.

452339

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.

304231

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.