ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

nansen-trade

Execute DEX swaps on Solana or Base. Use when buying or selling a token, getting a swap quote, or executing a trade.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/hurcannansen/nansen-trade
Or

Trade

Two-step flow: quote then execute. Trades are irreversible once on-chain.

Prerequisite: You need a wallet first. Run nansen wallet create before trading.

Quote

nansen trade quote \
  --chain solana \
  --from SOL \
  --to USDC \
  --amount 1000000000

Symbols resolve automatically: SOL, ETH, USDC, USDT, WETH. Raw addresses also work.

Execute

nansen trade execute --quote <quote-id>

Agent pattern

# Pipe quote ID directly into execute
quote_id=$(nansen trade quote --chain solana --from SOL --to USDC --amount 1000000000 2>&1 | grep "Quote ID:" | awk '{print $NF}')
nansen trade execute --quote "$quote_id"

Common Token Addresses

TokenChainAddress
SOLSolanaSo11111111111111111111111111111111111111112
USDCSolanaEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
ETHBase0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
USDCBase0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

Amounts are in base units

TokenDecimals1 token =
SOL91000000000
ETH181000000000000000000
USDC61000000

Flags

FlagPurpose
--chainsolana or base
--fromSource token (symbol or address)
--toDestination token (symbol or address)
--amountAmount in base units (integer)
--walletWallet name (default: default wallet)
--slippageSlippage tolerance as decimal (e.g. 0.03)
--quoteQuote ID for execute
--no-simulateSkip pre-broadcast simulation

Environment Variables

VarPurpose
NANSEN_WALLET_PASSWORDRequired for trade execute. Wallet encryption password — persisted in ~/.nansen/.env. Source before executing: source ~/.nansen/.env && nansen trade execute ...
NANSEN_API_KEYAPI key (also set via nansen login)

Agents: Never hold a wallet password only in session memory. If NANSEN_WALLET_PASSWORD is not in ~/.nansen/.env, follow the setup flow in the nansen-wallet skill Password Policy to generate and persist one before proceeding.

Notes

  • Quotes expire after ~1 hour. If execute fails, get a fresh quote.
  • A wallet is required even for quotes (the API builds sender-specific transactions).
  • ERC-20 swaps may require an approval step — execute handles this automatically.

Metadata

Stars2387
Views1
Updated2026-03-09
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-hurcannansen-nansen-trade": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.