Index of every page on this site: llms.txt
All skills
Run it yourself

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

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/routing-dex-trades

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesimplementation.md

≈822 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Implementation Details

Trade Size Recommendations

Trade Size Strategy Notes
< $1K Direct quote Gas may exceed savings from optimization
$1K - $10K Compare + routes Multi-hop can save 0.1-0.5%
$10K - $100K Split analysis 2-3 way splits reduce price impact
> $100K Full + MEV + private TX Consider OTC or algorithmic execution

Split Order Optimization

For large trades ($10K+), the router calculates optimal allocation across venues:

Split Recommendation:
  60% via Uniswap V3  (60 ETH -> 152,589 USDC)
  40% via Curve       (40 ETH -> 101,843 USDC)
  ─────────────────────────────────────────────
  Total: 254,432 USDC (vs. 251,200 single-venue)
  Improvement: +1.28% ($3,232 saved)

The optimization algorithm:

  1. Queries each venue for the full trade amount to measure price impact curves
  2. Uses gradient descent to find the allocation that minimizes total slippage
  3. Accounts for gas costs of multiple transactions (splitting adds ~$5-15 per venue)
  4. Only recommends splitting when savings exceed additional gas overhead

Output Mode Details

Quick Quote Mode:

  • Best price across aggregators, output amount, effective rate, gas estimate, recommended venue

Comparison Mode (--compare):

  • All venues ranked by effective rate (price minus gas)
  • Price impact percentage per venue
  • Gas costs compared in USD
  • Liquidity depth indicators (shallow/moderate/deep)

Route Analysis (--routes):

  • Direct vs. multi-hop comparison
  • Hop-by-hop breakdown with intermediate tokens
  • Cumulative price impact at each hop
  • Gas cost per route type

Split Mode (--split):

  • Optimal allocation percentages across venues
  • Per-venue output amounts
  • Total vs. single-venue comparison
  • Dollar savings estimate

MEV Assessment (--mev-check):

  • Risk score: LOW/MEDIUM/HIGH
  • Estimated sandwich attack exposure in USD
  • Protection recommendations (Flashbots Protect, CoW Swap, private mempool)
  • Alternative MEV-resistant venues

MEV Risk Scoring

The MEV check analyzes:

  • Token pair popularity: High-volume pairs attract more MEV bots
  • Trade size relative to pool: Larger trades = more profitable to sandwich
  • Current mempool activity: Active searcher presence
  • Slippage tolerance: Higher tolerance = more extractable value

Risk levels:

  • LOW (score 0-30): Safe to execute via public mempool
  • MEDIUM (score 31-70): Consider private transaction relay
  • HIGH (score 71-100): Use Flashbots Protect or CoW Swap batch auctions

API Configuration

Edit ${CLAUDE_SKILL_DIR}/config/settings.yaml:

api_keys:
  oneinch: "your-1inch-api-key"    # Optional, increases rate limits
  zerox: "your-0x-api-key"         # Optional

chain: ethereum                     # Default: ethereum, arbitrum, polygon, optimism

aggregators:
  - name: 1inch
    enabled: true
    timeout: 10
  - name: paraswap
    enabled: true
    timeout: 10
  - name: zerox
    enabled: true
    timeout: 10

Tons of Skills by Intent Solutions | jeremylongshore.com

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    This skill provides trade routing and price discovery across major decentralized exchanges (DEXs). It follows secure practices such as using environment variables for API keys and restricted tool permissions. It retrieves data from well-known services like 1inch and 0x, but like all tools processing external API data, it carries a minor theoretical risk of indirect prompt injection.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: MEDIUM · 1 issue

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
What it can do
Reads files Edits files Runs commands
version
1.26.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "crypto",
  "cost-optimization",
  "routing-dex"
]
All 6 allowed tools
ReadWriteEditGrepGlobBash(crypto:dex-*)
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/routing-dex-trades