nansen-trade
Execute DEX swaps on Solana or Base. Use when buying or selling a token, getting a swap quote, or executing a trade.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/hurcannansen/nansen-tradeTrade
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
| Token | Chain | Address |
|---|---|---|
| SOL | Solana | So11111111111111111111111111111111111111112 |
| USDC | Solana | EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v |
| ETH | Base | 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee |
| USDC | Base | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
Amounts are in base units
| Token | Decimals | 1 token = |
|---|---|---|
| SOL | 9 | 1000000000 |
| ETH | 18 | 1000000000000000000 |
| USDC | 6 | 1000000 |
Flags
| Flag | Purpose |
|---|---|
--chain | solana or base |
--from | Source token (symbol or address) |
--to | Destination token (symbol or address) |
--amount | Amount in base units (integer) |
--wallet | Wallet name (default: default wallet) |
--slippage | Slippage tolerance as decimal (e.g. 0.03) |
--quote | Quote ID for execute |
--no-simulate | Skip pre-broadcast simulation |
Environment Variables
| Var | Purpose |
|---|---|
NANSEN_WALLET_PASSWORD | Required for trade execute. Wallet encryption password — persisted in ~/.nansen/.env. Source before executing: source ~/.nansen/.env && nansen trade execute ... |
NANSEN_API_KEY | API key (also set via nansen login) |
Agents: Never hold a wallet password only in session memory. If
NANSEN_WALLET_PASSWORDis 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
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 skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-hurcannansen-nansen-trade": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
nansen-wallet
Wallet management — create, list, show, export, send, delete. Use when creating wallets, checking balances, or sending tokens.
nansen-token
Token analytics — screener, indicators, OHLCV, holders, flows, PnL, DEX trades, flow intelligence. Use when researching a specific token, checking smart money holders, or screening trending tokens.
nansen-profiler
Wallet profiler — balance, PnL, labels, transactions, counterparties, related wallets, batch, trace, compare. Use when analysing a specific wallet address or comparing wallets.
nansen-smart-money
Smart money tracking — netflow, trades, holdings, DCAs, perp trades. Use when finding what smart money wallets are buying/selling or tracking whale activity.
nansen-search
Search for tokens, wallets, or entities by name or address. Use when you have a token name and need the full address, or want to find an entity.