CAT
/Skills
SkillsMCPMarketplacesDigestToolsAdvertise

This week in Claude

Every Monday: Claude Code, Agent SDK, MCP, and the Anthropic platform moves worth your time.

Skills by Category
Frontend DevelopmentBackend & APIsTesting & QASecurityDevOps & CI/CDGit & Pull RequestsDocumentationCode Review & QualityAI & Agent BuildingSkill Development
MCP Servers by Category
Sales & MarketingWeb & Browser AutomationDatabasesAI & LLM ToolsCloud & InfrastructureCommunication & MessagingDeveloper ToolsDesign & CreativeDocuments & KnowledgeSearch & Web Crawling
Marketplaces by Category
AI Agents & OrchestrationLLM IntegrationDevelopment ToolsFrontend & UIBackend & APIsDatabasesTesting & Code QualityDevOps & CloudSecurity & ComplianceGit & Version Control

Cross AI Tools

Discover Claude Code plugins, extensions, and tools. Automatically updated directory of Anthropic Claude AI marketplaces with development tools, productivity plugins, and integrations.

Resources

  • Browse Skills
  • Browse MCP Servers
  • Browse Marketplaces
  • Plugins Reference

Community

  • About
  • Tools
  • Feedback
  • Privacy Policy
  • Advertise

Built for the Claude Code community with Claude Code by @mertduzgun

Independent project, not affiliated with Anthropic

Opentrade Dex Swap

6551team/opentrade
212 installs5 stars
Summary

If you need Claude to execute token swaps across 20+ chains, this is the aggregator you want. It pulls liquidity from 500+ DEX sources and handles the full quote, approve, swap flow for both EVM and Solana. The skill is designed to chain with other opentrade tools: you'd typically use opentrade-token to resolve token addresses, run the quote here, then push the signed transaction through opentrade-gateway. It auto-discovers available trading routers and enforces the right native token addresses per chain, which matters because using the wrong SOL address will silently break your swap. The documentation is thorough, maybe overly so, but that's better than guessing at calldata formats when real funds are involved.

Install to Claude Code

npx -y skills add 6551team/opentrade --skill opentrade-dex-swap --agent claude-code

Installs into .claude/skills of the current project.

CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Files
SKILL.mdView on GitHub

OpenTrade DEX Aggregator CLI

5 commands for multi-chain swap aggregation — quote, approve, and execute.

Pre-flight Checks

Every time before running any opentrade command, always follow these steps in order. Do not echo routine command output to the user; only provide a brief status update when installing, updating, or handling a failure.

  1. Confirm installed: Run which opentrade. If not found, install it:

    curl -sSL https://raw.githubusercontent.com/6551Team/openskills/main/skills/opentrade/install.sh | sh
    

    If the install script fails, ask the user to install manually following the instructions at: https://github.com/6551Team/openskills

  2. Check for updates: Read ~/.opentrade/last_check and compare it with the current timestamp:

    cached_ts=$(cat ~/.opentrade/last_check 2>/dev/null || true)
    now=$(date +%s)
    
    • If cached_ts is non-empty and (now - cached_ts) < 43200 (12 hours), skip the update and proceed.
    • Otherwise (file missing or older than 12 hours), run the installer to check for updates:
      curl -sSL https://raw.githubusercontent.com/6551Team/openskills/main/skills/opentrade/install.sh | sh
      
      If a newer version is installed, tell the user and suggest updating their opentrade skills from https://github.com/6551Team/openskills to get the latest features.
  3. If any opentrade command fails with an unexpected error during this session, try reinstalling before giving up:

    curl -sSL https://raw.githubusercontent.com/6551Team/openskills/main/skills/opentrade/install.sh | sh
    
  4. Find or create a .env file in the project root to override the default API credentials, Load it before performing opentrade operations.

OPEN_TOKEN=your_token_here

Get your API token at: https://www.newsliquid.com/mcp

Security warning: Never commit .env to git (add it to .gitignore) and never expose credentials in logs, screenshots, or chat messages.

Router Discovery

IMPORTANT: If the user has not specified a trading router, you MUST first discover available routers:

opentrade trade routers

Response format:

{
  "ok": true,
  "data": [
    {
      "api": "v2",
      "created_at": "2026-03-10 01:15:42",
      "is_active": true,
      "name": "6551dex test",
      "quota_reward": 0,
      "trader": "6551dex",
      "updated_at": "2026-03-10 01:15:42"
    },
    {
      "api": "v1",
      "created_at": "2026-03-03 21:24:34",
      "is_active": true,
      "name": "okx test",
      "quota_reward": 0,
      "trader": "okx",
      "updated_at": "2026-03-03 21:24:34"
    }
  ]
}

Usage:

  • Extract trader and api from the response
  • MANDATORY: ALL subsequent opentrade commands in this session MUST include --trader <trader> and --api <api> flags
  • Example: opentrade swap quote --from 0x... --to 0x... --amount 100 --chain ethereum --trader okx --api v1
  • Default fallback: If the API returns no data or is empty, use --trader okx --api v1

Skill Routing

  • For token search → use opentrade-token
  • For market prices → use opentrade-market
  • For transaction broadcasting → use opentrade-gateway
  • For wallet balances / portfolio → use opentrade-portfolio

Quickstart

EVM Swap (quote → approve → swap)

# 1. Quote — sell 100 USDC for OKB on XLayer
opentrade swap quote \
  --from 0x74b7f16337b8972027f6196a17a631ac6de26d22 \
  --to 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee \
  --amount 100000000 \
  --chain xlayer
# → Expected: X.XX OKB, gas fee, price impact

# 2. Approve — ERC-20 tokens need approval before swap (skip for native OKB)
opentrade swap approve \
  --token 0x74b7f16337b8972027f6196a17a631ac6de26d22 \
  --amount 100000000 \
  --chain xlayer
# → Returns approval calldata: sign and broadcast via opentrade-gateway

# 3. Swap
opentrade swap swap \
  --from 0x74b7f16337b8972027f6196a17a631ac6de26d22 \
  --to 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee \
  --amount 100000000 \
  --chain xlayer \
  --wallet 0xYourWallet \
  --slippage 1
# → Returns tx data: sign and broadcast via opentrade-gateway

Solana Swap

opentrade swap swap \
  --from 11111111111111111111111111111111 \
  --to DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263 \
  --amount 1000000000 \
  --chain solana \
  --wallet YourSolanaWallet \
  --slippage 1
# → Returns tx data: sign and broadcast via opentrade-gateway

Chain Name Support

The CLI accepts human-readable chain names and resolves them automatically.

ChainNamechainIndex
XLayerxlayer196
Solanasolana501
Ethereumethereum1
Basebase8453
BSCbsc56
Arbitrumarbitrum42161

Native Token Addresses

CRITICAL: Each chain has a specific native token address. Using the wrong address will cause swap transactions to fail.

ChainNative Token Address
EVM (Ethereum, BSC, Polygon, Arbitrum, Base, etc.)0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
Solana11111111111111111111111111111111
Sui0x2::sui::SUI
TronT9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb
TonEQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c

WARNING — Solana native SOL: The correct address is 11111111111111111111111111111111 (Solana system program). Do NOT use So11111111111111111111111111111111111111112 (wSOL SPL token) — it is a different token and will cause swap failures.

Command Index

#CommandDescription
1opentrade swap chainsGet supported chains for DEX aggregator
2opentrade swap liquidity --chain <chain>Get available liquidity sources on a chain
3opentrade swap approve --token ... --amount ... --chain ...Get ERC-20 approval transaction data
4opentrade swap quote --from ... --to ... --amount ... --chain ...Get swap quote (read-only price estimate)
5opentrade swap swap --from ... --to ... --amount ... --chain ... --wallet ...Get swap transaction data

Cross-Skill Workflows

This skill is the execution endpoint of most user trading flows. It almost always needs input from other skills first.

Workflow A: Full Swap by Token Name (most common)

User: "Swap 1 SOL for BONK on Solana"

1. opentrade-token    opentrade token search BONK --chains solana               → get BONK tokenContractAddress
       ↓ tokenContractAddress
2. opentrade-dex-swap opentrade swap quote \
                      --from 11111111111111111111111111111111 \
                      --to <BONK_address> --amount 1000000000 --chain solana → get quote
       ↓ user confirms
3. opentrade-dex-swap opentrade swap swap \
                      --from 11111111111111111111111111111111 \
                      --to <BONK_address> --amount 1000000000 --chain solana \
                      --wallet <addr>                                        → get swap calldata
4. User signs the transaction
5. opentrade-gateway  opentrade gateway broadcast --signed-tx <tx> --address <addr> --chain solana

Data handoff:

  • tokenContractAddress from step 1 → --to in steps 2-3
  • SOL native address = 11111111111111111111111111111111 → --from. Do NOT use wSOL address.
  • Amount 1 SOL = 1000000000 (9 decimals) → --amount param

Workflow B: EVM Swap with Approval

User: "Swap 100 USDC for OKB on XLayer"

1. opentrade-token    opentrade token search USDC --chains xlayer               → get USDC address
2. opentrade-dex-swap opentrade swap quote --from <USDC> --to 0xeeee...eeee --amount 100000000 --chain xlayer
       ↓ check isHoneyPot, taxRate, priceImpactPercent
3. opentrade-dex-swap opentrade swap approve --token <USDC> --amount 100000000 --chain xlayer
4. User signs the approval transaction
5. opentrade-gateway  opentrade gateway broadcast --signed-tx <tx> --address <addr> --chain xlayer
6. opentrade-dex-swap opentrade swap swap --from <USDC> --to 0xeeee...eeee --amount 100000000 --chain xlayer --wallet <addr>
7. User signs the swap transaction
8. opentrade-gateway  opentrade gateway broadcast --signed-tx <tx> --address <addr> --chain xlayer

Key: EVM tokens (not native OKB) require an approve step. Skip it if user is selling native tokens.

Workflow C: Compare Quote Then Execute

1. opentrade swap quote --from ... --to ... --amount ... --chain ...  → get quote with route info
2. Display to user: expected output, gas, price impact, route
3. If price impact > 5% → warn user
4. If isHoneyPot = true → block trade, warn user
5. User confirms → proceed to approve (if EVM) → swap

Swap Flow

EVM Chains (XLayer, Ethereum, BSC, Base, etc.)

1. opentrade swap quote ...              → Get price and route
2. opentrade swap approve ...            → Get approval calldata (if needed)
3. User signs the approval transaction
4. opentrade gateway broadcast ...       → Broadcast approval tx
5. opentrade swap swap ...               → Get swap calldata
6. User signs the swap transaction
7. opentrade gateway broadcast ...       → Broadcast swap tx

Solana

1. opentrade swap quote ...              → Get price and route
2. opentrade swap swap ...               → Get swap calldata
3. User signs the transaction
4. opentrade gateway broadcast ...       → Broadcast tx

Operation Flow

Step 1: Identify Intent

  • View a quote → opentrade swap quote
  • Execute a swap → full swap flow (quote → approve → swap)
  • List available DEXes → opentrade swap liquidity
  • Approve a token → opentrade swap approve

Step 2: Collect Parameters

  • Missing chain → recommend XLayer (--chain xlayer, low gas, fast confirmation) as the default, then ask which chain the user prefers
  • Missing token addresses → use opentrade-token opentrade token search to resolve name → address
  • Missing amount → ask user, remind to convert to minimal units
  • Missing slippage → suggest 1% default, 3-5% for volatile tokens
  • Missing wallet address → ask user

Step 3: Execute

  • Quote phase: call opentrade swap quote, display estimated results
    • Expected output, gas estimate, price impact, routing path
    • Check isHoneyPot and taxRate — surface safety info to users
  • Confirmation phase: wait for user approval before proceeding
  • Approval phase (EVM only): check/execute approve if selling non-native token
  • Execution phase: call opentrade swap swap, return tx data for signing

Step 4: Suggest Next Steps

After displaying results, suggest 2-3 relevant follow-up actions:

Just completedSuggest
swap quote (not yet confirmed)1. View price chart before deciding → opentrade-market 2. Proceed with swap → continue approve + swap (this skill)
Swap executed successfully1. Check price of the token just received → opentrade-market 2. Swap another token → new swap flow (this skill)
swap liquidity1. Get a swap quote → opentrade swap quote (this skill)

Present conversationally, e.g.: "Swap complete! Would you like to check your updated balance?" — never expose skill names or endpoint paths to the user.

CLI Command Reference

1. opentrade swap chains

Get supported chains for DEX aggregator. No parameters required.

opentrade swap chains

Return fields:

FieldTypeDescription
chainIndexStringChain identifier (e.g., "1", "501")
chainNameStringHuman-readable chain name
dexTokenApproveAddressStringDEX router address for token approvals on this chain

2. opentrade swap liquidity

Get available liquidity sources on a chain.

opentrade swap liquidity --chain <chain>
ParamRequiredDefaultDescription
--chainYes-Chain name (e.g., ethereum, solana, xlayer)

Return fields:

FieldTypeDescription
idStringLiquidity source ID
nameStringLiquidity source name (e.g., "Uniswap V3", "CurveNG")
logoStringLiquidity source logo URL

3. opentrade swap approve

Get ERC-20 approval transaction data.

opentrade swap approve --token <address> --amount <amount> --chain <chain>
ParamRequiredDefaultDescription
--tokenYes-Token contract address to approve
--amountYes-Amount in minimal units
--chainYes-Chain name

Return fields:

FieldTypeDescription
dataStringApproval calldata (hex) — use as tx data field
dexContractAddressStringSpender address (already encoded in data). NOT the tx to — send tx to the token contract
gasLimitStringEstimated gas limit for the approval tx
gasPriceStringRecommended gas price

4. opentrade swap quote

Get swap quote (read-only price estimate).

opentrade swap quote --from <address> --to <address> --amount <amount> --chain <chain> [--swap-mode <mode>]
ParamRequiredDefaultDescription
--fromYes-Source token contract address
--toYes-Destination token contract address
--amountYes-Amount in minimal units (sell amount if exactIn, buy amount if exactOut)
--chainYes-Chain name
--swap-modeNoexactInexactIn or exactOut

Return fields:

FieldTypeDescription
toTokenAmountStringExpected output amount in minimal units
fromTokenAmountStringInput amount in minimal units
estimateGasFeeStringEstimated gas fee (native token units)
tradeFeeStringTrade fee estimate in USD
priceImpactPercentStringPrice impact as percentage (e.g., "0.05")
routerStringRouter type used
dexRouterList[]ArrayDEX routing path details
dexRouterList[].dexNameStringDEX name in the route
dexRouterList[].percentageStringPercentage of amount routed through this DEX
fromToken.isHoneyPotBooleantrue = source token is a honeypot (cannot sell)
fromToken.taxRateStringSource token buy/sell tax rate
fromToken.decimalStringSource token decimals
fromToken.tokenUnitPriceStringSource token unit price in USD
toToken.isHoneyPotBooleantrue = destination token is a honeypot (cannot sell)
toToken.taxRateStringDestination token buy/sell tax rate
toToken.decimalStringDestination token decimals
toToken.tokenUnitPriceStringDestination token unit price in USD

5. opentrade swap swap

Get swap transaction data (quote → sign → broadcast).

opentrade swap swap --from <address> --to <address> --amount <amount> --chain <chain> --wallet <address> [--slippage <pct>] [--swap-mode <mode>]
ParamRequiredDefaultDescription
--fromYes-Source token contract address
--toYes-Destination token contract address
--amountYes-Amount in minimal units
--chainYes-Chain name
--walletYes-User's wallet address
--slippageNo"1"Slippage tolerance in percent (e.g., "1" for 1%)
--swap-modeNo"exactIn"exactIn or exactOut

Return fields:

FieldTypeDescription
routerResultObjectSame structure as quote return (see swap quote above)
tx.fromStringSender address
tx.toStringContract address to send the transaction to
tx.dataStringTransaction calldata (hex for EVM, base58 for Solana)
tx.gasStringGas limit for the transaction
tx.gasPriceStringGas price
tx.valueStringNative token value to send (in minimal units)
tx.minReceiveAmountStringMinimum receive amount after slippage (minimal units)
tx.maxSpendAmountStringMaximum spend amount (for exactOut mode)
tx.slippagePercentStringApplied slippage tolerance percentage

Input / Output Examples

User says: "Swap 100 USDC for OKB on XLayer"

# 1. Quote
opentrade swap quote --from 0x74b7f16337b8972027f6196a17a631ac6de26d22 --to 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee --amount 100000000 --chain xlayer
# → Expected output: 3.2 OKB, Gas fee: ~$0.001, Price impact: 0.05%

# 2. Approve (ERC-20 token needs approval)
opentrade swap approve --token 0x74b7f16337b8972027f6196a17a631ac6de26d22 --amount 100000000 --chain xlayer
# → Returns approval calldata → user signs → broadcast

# 3. Swap
opentrade swap swap --from 0x74b7f16337b8972027f6196a17a631ac6de26d22 --to 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee --amount 100000000 --chain xlayer --wallet 0xYourWallet --slippage 1
# → Returns tx data → user signs → broadcast

User says: "What DEXes are available on XLayer?"

opentrade swap liquidity --chain xlayer
# → Display: CurveNG, XLayer DEX, ... (DEX sources on XLayer)

Edge Cases

  • High slippage (>5%): warn user, suggest splitting the trade or adjusting slippage
  • Large price impact (>10%): strongly warn, suggest reducing amount
  • Honeypot token: isHoneyPot = true — block trade and warn user
  • Tax token: taxRate non-zero — display to user (e.g. 5% buy tax)
  • Insufficient balance: check balance first, show current balance, suggest adjusting amount
  • exactOut not supported: only Ethereum/Base/BSC/Arbitrum — prompt user to use exactIn
  • Solana native SOL address: Must use 11111111111111111111111111111111 (system program), NOT So11111111111111111111111111111111111111112 (wSOL)
  • Network error: retry once, then prompt user to try again later
  • Region restriction (error code 50125 or 80001): do NOT show the raw error code to the user. Instead, display a friendly message: ⚠️ Service is not available in your region. Please switch to a supported region and try again.

Amount Display Rules

  • Input/output amounts in UI units (1.5 ETH, 3,200 USDC)
  • Internal CLI params use minimal units (1 USDC = "1000000", 1 ETH = "1000000000000000000")
  • Gas fees in USD
  • minReceiveAmount in both UI units and USD
  • Price impact as percentage

Global Notes

  • Amounts must be in minimal units (wei/lamports)
  • exactOut only on Ethereum(1)/Base(8453)/BSC(56)/Arbitrum(42161)
  • Check isHoneyPot and taxRate — surface safety info to users
  • EVM contract addresses must be all lowercase
  • The CLI resolves chain names automatically (e.g., ethereum → 1, solana → 501)
  • The CLI handles authentication internally via environment variables — see Prerequisites step 4 for default values
Featured
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
First SeenJun 3, 2026
View on GitHub

Recommended

caveman

juliusbrussee/caveman

Ultra-compressed communication mode cutting token usage ~75% while preserving technical accuracy.
203.4k
67.8k
grill-me

mattpocock/skills

Relentless interviewing skill that stress-tests plans and designs through systematic questioning.
250.9k
114.5k
improve

shadcn/improve

Survey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for other models/agents to execute.
10
205
systematic-debugging

obra/superpowers

Structured debugging methodology that mandates root cause investigation before attempting any fixes.
124.6k
215.9k
karpathy-guidelines

forrestchang/andrej-karpathy-skills

Behavioral guidelines to reduce common LLM coding mistakes through explicit assumptions, simplicity, and verifiable success criteria.
13.9k
165.4k
find-skills

vercel-labs/skills

Discover and install specialized agent skills from the open ecosystem when users need extended capabilities.
1.8M
21.1k