ClawDex Trading
/install clawdex-trading
ClawDex — Solana DEX Trading Skill
Trade any Solana token through Jupiter aggregator with simulation, safety guardrails, and full JSON output.
Prerequisites
Before using this skill, ensure ClawDex is installed and configured:
which clawdex || npm install -g clawdex@latest
If not configured yet, run onboarding:
clawdex status --json
If status fails, set up with:
clawdex onboarding \
--jupiter-api-key "$JUPITER_API_KEY" \
--rpc "${SOLANA_RPC_URL:-https://api.mainnet-beta.solana.com}" \
--wallet ~/.config/solana/id.json \
--json
Commands
Check wallet balances
clawdex balances --json
Returns an array of { token, symbol, mint, balance, decimals } objects. Zero-balance accounts are included in JSON output.
Get a quote (no execution)
clawdex quote --in SOL --out USDC --amount 0.01 --json
Lightweight price check — no simulation, no wallet needed.
Simulate a swap (dry run)
clawdex swap --in SOL --out USDC --amount 0.01 --simulate-only --json
Runs full simulation on-chain without broadcasting. Does not require --yes. Use this to preview the output amount and route before committing.
Execute a swap
clawdex swap --in SOL --out USDC --amount 0.01 --yes --json
--yes is required for non-interactive execution. Without it, ClawDex exits with code 1.
Health check
clawdex status --json
Verify RPC connectivity, wallet validity, and config state.
Trading Workflow
Always follow this sequence:
- Health check —
clawdex status --json— abort ifrpc.healthyis false - Check balances —
clawdex balances --json— verify sufficient funds - Simulate —
clawdex swap --simulate-only --json— preview the trade - Execute —
clawdex swap --yes --json— only if simulation looks good - Verify —
clawdex balances --json— confirm balances updated (may need 5s delay on public RPC)
Token Specification
Tokens can be passed by symbol or mint address:
- By symbol:
SOL,USDC,USDT - By mint:
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Exit Codes
| Code | Meaning | Agent action |
|---|---|---|
| 0 | Success | Continue |
| 1 | General error | Check message |
| 2 | Config error | Run onboarding |
| 3 | Safety violation | Reduce amount or adjust limits |
| 4 | Simulation failed | Try different pair/amount |
| 5 | Send failed | Retry with backoff |
Safety
Set guardrails to prevent runaway trades:
clawdex safety set max_slippage_bps=300 max_trade_sol=1 max_price_impact_bps=100
When a guardrail triggers, the JSON response includes a violations array describing what failed.
Important Rules
- Always use
--jsonfor machine-parseable output - Always use
--yesfor real swaps (not needed for--simulate-only) - Never skip simulation unless you have a good reason — use
--simulate-onlyfirst - Parse
balanceas a string, not a number — it preserves full decimal precision - Check exit codes — non-zero means the trade did not succeed
- Wait before verifying — RPC balance reads can lag a few seconds after a swap
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install clawdex-trading - 安装完成后,直接呼叫该 Skill 的名称或使用
/clawdex-trading触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
ClawDex Trading 是什么?
Trade tokens on Solana using the ClawDex CLI. Use when the user asks to swap tokens, check balances, get quotes, or manage a Solana trading wallet. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 710 次。
如何安装 ClawDex Trading?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install clawdex-trading」即可一键安装,无需额外配置。
ClawDex Trading 是免费的吗?
是的,ClawDex Trading 完全免费(开源免费),可自由下载、安装和使用。
ClawDex Trading 支持哪些平台?
ClawDex Trading 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 ClawDex Trading?
由 JoelCCodes(@joelccodes)开发并维护,当前版本 v1.0.0。