← Back to Skills Marketplace
joelccodes

ClawDex Trading

by JoelCCodes · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
710
Downloads
0
Stars
5
Active Installs
1
Versions
Install in OpenClaw
/install clawdex-trading
Description
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.
README (SKILL.md)

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:

  1. Health checkclawdex status --json — abort if rpc.healthy is false
  2. Check balancesclawdex balances --json — verify sufficient funds
  3. Simulateclawdex swap --simulate-only --json — preview the trade
  4. Executeclawdex swap --yes --json — only if simulation looks good
  5. Verifyclawdex 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 --json for machine-parseable output
  • Always use --yes for real swaps (not needed for --simulate-only)
  • Never skip simulation unless you have a good reason — use --simulate-only first
  • Parse balance as 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
Usage Guidance
This skill can run real trades and expects access to a local Solana wallet and an API key, but those requirements are not declared in the registry metadata — treat it as risky until clarified. Before installing or enabling it: 1) Do not keep high-value private keys at the default path if you plan to let an agent run such skills; use a dedicated low-value wallet for automation. 2) Require explicit user confirmation for any non-simulated swap or disable autonomous invocation for this skill. 3) Verify the clawdex npm package source (repository, authors, recent releases) and consider pinning a known-good version instead of installing latest. 4) Ensure JUPITER_API_KEY and SOLANA_RPC_URL are managed securely (use environment isolation/secrets manager) and rotate credentials if exposed. 5) Ask the skill author to update the manifest to declare required env vars and document the expected wallet usage and safety model — that would materially reduce the risk and could change this assessment.
Capability Analysis
Type: OpenClaw Skill Name: clawdex-trading Version: 1.0.0 The skill is classified as suspicious due to two primary reasons found in `SKILL.md`. First, it instructs the agent to perform a global `npm install -g clawdex@latest`, which introduces a significant supply chain risk by executing arbitrary code from an external package. Second, it explicitly instructs the agent to configure the `clawdex` tool using highly sensitive credentials, including a Solana wallet private key (`~/.config/solana/id.json`) and a Jupiter API key (`$JUPITER_API_KEY`). While these actions are plausibly needed for the skill's stated purpose of Solana trading, they represent a high-risk capability and a substantial security exposure without clear malicious intent within the skill's instructions themselves.
Capability Assessment
Purpose & Capability
The name/description (Solana trading via ClawDex/Jupiter) matches the CLI commands shown. However the SKILL.md references environment values and paths (JUPITER_API_KEY, SOLANA_RPC_URL, and ~/.config/solana/id.json) that are required for operation but are not declared in the skill's metadata. That omission is an incoherence between declared requirements and actual needs.
Instruction Scope
The instructions explicitly direct the agent to run clawdex CLI commands that can simulate and execute real swaps (including a required '--yes' for non-interactive execution). They also reference a local wallet file (~/.config/solana/id.json) and an API key. The skill gives the agent permission to read local config and perform fund-moving operations if the wallet is present — this is beyond a purely read-only or quote-only skill and requires explicit, declared consent mechanisms.
Install Mechanism
There is no install spec in the registry, but the SKILL.md suggests running `npm install -g clawdex@latest`. Installing an npm package at runtime pulls code from a remote package registry and grants it execution on the host; this is a legitimate way to obtain a CLI but increases supply-chain risk and should be acknowledged explicitly in the manifest (package provenance, expected version, and source repository).
Credentials
The skill uses and expects secrets/credentials (JUPITER_API_KEY, possibly wallet private key at ~/.config/solana/id.json and RPC URL) yet the skill metadata declares no required env vars or primary credential. Requesting access to a local wallet file and to an API key without declaring them is disproportionate and makes it easy to accidentally expose private keys or allow automated trades.
Persistence & Privilege
always:false (good) but model invocation is allowed (default). Combined with instructions that enable non-interactive swaps (`--yes`) and access to a local wallet, the agent could autonomously execute financial transactions if invoked. The skill does not require explicit interactive confirmations in its manifest; that gap increases risk for autonomous agents.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install clawdex-trading
  3. After installation, invoke the skill by name or use /clawdex-trading
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of clawdex-trading skill. - Enables token trading, quoting, and balance checks on Solana using the ClawDex CLI. - Provides clear workflow and safety guardrails for swaps, including simulation before execution. - Full JSON output supported for all commands for reliable parsing. - Supports both token symbols and mint addresses for specification. - Includes detailed error codes and recommendations for safe usage.
Metadata
Slug clawdex-trading
Version 1.0.0
License
All-time Installs 5
Active Installs 5
Total Versions 1
Frequently Asked Questions

What is 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. It is an AI Agent Skill for Claude Code / OpenClaw, with 710 downloads so far.

How do I install ClawDex Trading?

Run "/install clawdex-trading" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is ClawDex Trading free?

Yes, ClawDex Trading is completely free (open-source). You can download, install and use it at no cost.

Which platforms does ClawDex Trading support?

ClawDex Trading is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created ClawDex Trading?

It is built and maintained by JoelCCodes (@joelccodes); the current version is v1.0.0.

💬 Comments