routing-dex-trades — скилл для Claude Code
Скилл routing-dex-trades для Claude Code собирает котировки 1inch, Paraswap и 0x и ищет маршрут свопа с минимальным проскальзыванием и расходом газа. Сравнивает цены на DEX и разбивает крупные ордера.
MIT 1 установок ★ 2 935 обновлён 2026-11-01
npx skills add jeremylongshore/tons-of-skills-marketplace --skill routing-dex-trades -a claude-codeЧто делает routing-dex-trades
Скилл агрегирует котировки трёх агрегаторов — 1inch, Paraswap и 0x — и считает эффективную цену после вычета газа. Умеет находить multi-hop маршруты через 2–3 пула и показывать разбивку по каждому шагу. Для крупных сделок от $10K считает оптимальное распределение по нескольким DEX, чтобы снизить суммарное ценовое воздействие.
Внутри — Python-скрипт dex_router.py, который запускается из командной строки. Режимы задаются флагами: --compare ранжирует все площадки по эффективной цене, --routes сравнивает прямой маршрут с multi-hop, --split делит ордер, --mev-check оценивает риск сэндвич-атаки по шкале LOW/MEDIUM/HIGH. Флаг --full запускает всё сразу и отдаёт результат в JSON.
Для работы нужен Python 3.9+ с пакетами httpx, pydantic и rich. Без API-ключей 1inch и 0x скилл работает, но упрётся в более жёсткие лимиты запросов — при частых вызовах лучше добавить ключи. Настройки копируются из config/settings.yaml.example в config/settings.yaml.
Какие задачи решает
- сравнить цены свопа на разных DEX
- найти multi-hop маршрут вместо прямого
- разбить крупный ордер на несколько площадок
- оценить риск сэндвич-атаки перед сделкой
- посчитать эффективную цену с учётом газа
Примеры запросов агенту
- Сравни цены для свопа 5 ETH в USDC и покажи лучшую площадку
- Разбей ордер на 100 ETH по нескольким DEX, чтобы снизить ценовое воздействие
- Проверь MEV-риск для свопа 50 ETH в USDC
Как установить routing-dex-trades
1Через Skills CLI (Vercel)
npx skills add jeremylongshore/tons-of-skills-marketplace --skill routing-dex-trades -a claude-code2Вручную: положить файлы
~/.claude/skills/routing-dex-trades/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/routing-dex-trades/
1Через Skills CLI (Vercel)
npx skills add jeremylongshore/tons-of-skills-marketplace --skill routing-dex-trades -a codex2Вручную: положить файлы
.agents/skills/routing-dex-trades/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add jeremylongshore/tons-of-skills-marketplace --skill routing-dex-trades -a cursor2Вручную: положить файлы
.cursor/skills/routing-dex-trades/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install jeremylongshore/tons-of-skills-marketplace skills/.curated/routing-dex-trades2Вручную: положить файлы
.github/skills/routing-dex-trades/SKILL.md1Через Skills CLI (Vercel)
npx skills add jeremylongshore/tons-of-skills-marketplace --skill routing-dex-trades -a gemini-cli2Командой платформы
gemini skills install https://github.com/jeremylongshore/tons-of-skills-marketplace --path skills/.curated/routing-dex-tradesВручную: положить файлы
.devin/skills/routing-dex-trades/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add jeremylongshore/tons-of-skills-marketplace --skill routing-dex-trades -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о routing-dex-trades
Как установить routing-dex-trades в Claude Code?
Выполни npx skills add jeremylongshore/tons-of-skills-marketplace --skill routing-dex-trades -a claude-code. Скилл появится в ~/.claude/skills/routing-dex-trades/SKILL.md.
Что делает routing-dex-trades?
Собирает котировки с 1inch, Paraswap и 0x, находит маршруты свопа с минимальным проскальзыванием и газом, умеет делить крупные ордера и оценивать MEV-риск.
Что нужно для работы скилла?
Python 3.9+ с пакетами httpx, pydantic и rich, а также сетевой доступ к API агрегаторов. API-ключи 1inch и 0x не обязательны, но поднимают лимиты запросов.
Исходный текст
SKILL.md · MIT
--- name: routing-dex-trades description: '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". ' allowed-tools: Read, Write, Edit, Grep, Glob, Bash(crypto:dex-*) version: 1.26.0 author: Jeremy Longshore <[email protected]> license: MIT tags: - crypto - cost-optimization - routing-dex compatibility: Designed for Claude Code --- # Routing DEX Trades ## Contents [Overview](#overview) | [Prerequisites](#prerequisites) | [Instructions](#instructions) | [Output](#output) | [Error Handling](#error-handling) | [Examples](#examples) | [Resources](#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: ```bash 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): ```bash 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: ```bash 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: ```bash 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: ```bash python ${CLAUDE_SKILL_DIR}/scripts/dex_router.py ETH USDC 50.0 --mev-check ``` 6. Run full analysis combining all features for comprehensive output: ```bash 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 [`references/implementation.md`](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 [`references/errors.md`](references/errors.md) for comprehensive error handling. ## Examples **Compare prices for a 5 ETH swap:** ```bash python ${CLAUDE_SKILL_DIR}/scripts/dex_router.py ETH USDC 5.0 --compare ``` **Find optimal split for a large order:** ```bash python ${CLAUDE_SKILL_DIR}/scripts/dex_router.py ETH USDC 100.0 --split ``` **Check MEV risk before executing:** ```bash python ${CLAUDE_SKILL_DIR}/scripts/dex_router.py ETH USDC 50.0 --mev-check ``` See [`references/examples.md`](references/examples.md) for multi-hop discovery and MEV-protected execution examples. ## Resources - [`references/implementation.md`](references/implementation.md) - Trade size guide, split optimization, MEV scoring, API config - [1inch API](https://docs.1inch.io/) - Primary aggregator - [Paraswap API](https://developers.paraswap.network/) - Secondary aggregator - [0x API](https://0x.org/docs/api) - Third aggregator - [Flashbots Protect](https://docs.flashbots.net/flashbots-protect/overview) - MEV protection
© Jeremy Longshore · MIT · jeremylongshore/tons-of-skills-marketplace