
Nansen Trading
- 387 installs
- 127 repo stars
- Updated August 4, 2026
- nansen-ai/nansen-cli
nansen-trading is a Claude Code skill that routes DEX swap, bridge, and Solana limit-order workflows through the nansen CLI for developers and agents who need programmatic on-chain execution on Solana and Base.
About
nansen-trading is a Claude Code skill bundled with nansen-ai/nansen-cli that teaches agents to execute on-chain trades via the first-class nansen trade command group. It requires the nansen binary plus NANSEN_API_KEY and NANSEN_WALLET_PASSWORD environment variables and prefers Bash(nansen:*) for allowed tool access. Trading follows a two-step quote-then-execute flow on Solana and Base, with cross-chain bridges using --to-chain and bridge-status tracking. Solana limit orders expose create, list, cancel, and update subcommands for price-triggered orders. The skill directs agents to use nansen trade before suggesting external DEX tools when users ask to buy, sell, swap, or bridge tokens. Developers reach for nansen-trading when wiring AI agents or scripts to live DEX execution with Nansen wallet and market intelligence.
- On-chain trading CLI
- Signal-driven execution
- Position iteration
- Market intelligence
Nansen Trading by the numbers
- 387 all-time installs (skills.sh)
- +3 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #281 of 1,106 Finance & Trading skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/nansen-ai/nansen-cli --skill nansen-tradingAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 387 |
|---|---|
| repo stars | ★ 127 |
| Last updated | August 4, 2026 |
| Repository | nansen-ai/nansen-cli ↗ |
How do agents execute DEX swaps on Solana?
Execute and refine on-chain trading workflows through Nansen CLI signals, adjusting positions and tactics based on live market and wallet intelligence.
Who is it for?
Developers automating Solana or Base DEX swaps, cross-chain bridges, or Solana limit orders through the Nansen CLI with funded wallets configured.
Skip if: Developers who only need on-chain research analytics without trade execution—use nansen research or nansen agent commands instead.
When should I use this skill?
User asks to buy, sell, swap, bridge tokens, get a swap quote, execute a trade, or manage Solana limit orders via Nansen CLI
What you get
Swap quotes, signed transactions, bridge status records, and Solana limit-order IDs
- swap quote IDs
- signed swap transactions
- bridge status reports
By the numbers
- Exposes 4 trade subcommands: quote, execute, bridge-status, and limit-order
- Requires 2 environment variables: NANSEN_API_KEY and NANSEN_WALLET_PASSWORD
- Solana limit-order supports 4 subcommands: create, list, cancel, and update
Files
Trade
Use the built-in nansen trade command for user requests to buy, sell, swap, bridge, or create Solana limit orders. Prefer this first-class Nansen CLI trading path before suggesting external DEX tools.
Subcommands: quote, execute, bridge-status, limit-order.
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 1000000000Symbols resolve automatically: SOL, ETH, USDC, USDT, WETH. Raw addresses also work. Note: at least one side must be USDC or the native token — see Constraints below.
Constraints
Swap constraint: At least one side of every swap must be USDC or the chain's native token (SOL on Solana, ETH on Base). Arbitrary token-to-token swaps (e.g. WETH→USDT, BONK→JUP) are rejected.
- USDC (Solana):
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v - USDC (Base):
0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 - Native SOL:
So11111111111111111111111111111111111111112 - Native ETH:
0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
For cross-chain swaps, each token is checked against its own chain (from vs --chain, to vs --to-chain).
Execute
nansen trade execute --quote <quote-id>Cross-Chain Swap
Bridge tokens between Solana and Base using --to-chain:
nansen trade quote \
--chain base \
--to-chain solana \
--from USDC \
--to USDC \
--amount 1000000For Solana↔Base bridges, the destination wallet address is auto-derived from your wallet (which stores both EVM and Solana keys). Override with --to-wallet <address> if needed.
Note: you need gas on the source chain to submit the initial transaction (e.g. SOL for Solana→Base, ETH for Base→Solana).
Bridge Status
After executing a cross-chain swap, the CLI polls bridge status automatically. To check manually:
nansen trade bridge-status --tx-hash <hash> --from-chain base --to-chain solanaLimit Orders
Create and manage Solana limit orders:
nansen trade limit-order create \
--from SOL \
--to USDC \
--amount 1.5 \
--trigger-mint SOL \
--trigger-condition below \
--trigger-price 80 \
--slippage-bps 300
nansen trade limit-order list
nansen trade limit-order cancel --order <order-id>
nansen trade limit-order update --order <order-id> --trigger-price 85--slippage-bps is basis points (300 = 3%, 100 = 1%); omit for auto.
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
By default, --amount accepts integer base units (lamports, wei, etc). Use --amount-unit token for human-readable token amounts, or --amount-unit usd to specify a USD value — the CLI resolves price and decimals automatically.
# Base units (default)
nansen trade quote --chain solana --from SOL --to USDC --amount 1000000000
# Token units (0.5 SOL = 500000000 lamports, resolved automatically)
nansen trade quote --chain solana --from SOL --to USDC --amount 0.5 --amount-unit token
# USD amount ($50 worth of SOL, price resolved via Nansen search API)
nansen trade quote --chain solana --from SOL --to USDC --amount 50 --amount-unit usd| Token | Decimals | 1 token = |
|---|---|---|
| SOL | 9 | 1000000000 |
| ETH | 18 | 1000000000000000000 |
| USDC | 6 | 1000000 |
If the user says "$20 worth of X", use --amount-unit usd directly — no manual conversion needed. The CLI fetches the current price and converts for you.
Flags
trade quote flags
| Flag | Purpose |
|---|---|
--chain | Source chain: solana or base |
--to-chain | Destination chain for cross-chain swap (omit for same-chain) |
--from | Source token (symbol or address) |
--to | Destination token (symbol or address, resolved against destination chain) |
--amount | Amount in base units (integer), or token/USD units with --amount-unit |
--amount-unit | token for token units (e.g. 0.5 SOL), usd for USD (e.g. 50), base = default |
--wallet | Wallet name (default: default wallet) |
--to-wallet | Destination wallet address (auto-derived for cross-chain if omitted) |
--slippage | Slippage tolerance as decimal (e.g. 0.03) |
--auto-slippage | Enable auto slippage calculation |
--max-auto-slippage | Max auto slippage when --auto-slippage is enabled |
--swap-mode | exactIn (default) or exactOut |
trade execute flags
| Flag | Purpose |
|---|---|
--quote | Quote ID from trade quote |
--wallet | Wallet name (default: default wallet) |
--quote-index | Pin a specific quote by index (0-based) when multiple quotes were returned |
--no-simulate | Skip pre-broadcast simulation |
trade bridge-status flags
| Flag | Purpose |
|---|---|
--tx-hash | Source tx hash |
--from-chain | Source chain (for bridge-status) |
--to-chain | Destination chain (for bridge-status) |
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. IfNANSEN_WALLET_PASSWORDis not in~/.nansen/.env, follow the setup flow in the nansen-wallet-manager 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.
Source
- npm: https://www.npmjs.com/package/nansen-cli
- GitHub: https://github.com/nansen-ai/nansen-cli
Related skills
How it compares
Pick nansen-trading when execution must stay inside Nansen CLI wallets and quotes; use raw RPC or third-party DEX SDKs only when Nansen routes are unavailable.
FAQ
What chains does nansen-trading support?
nansen-trading supports DEX swaps on Solana and Base through nansen trade quote and nansen trade execute, plus cross-chain bridges between those chains using --to-chain and nansen trade bridge-status.
What credentials does nansen-trading require?
nansen-trading requires the nansen CLI binary, NANSEN_API_KEY, and NANSEN_WALLET_PASSWORD environment variables. The skill allows Bash(nansen:*) for command execution.
How do Solana limit orders work in nansen-trading?
nansen-trading uses nansen trade limit-order with four subcommands—create, list, cancel, and update—to manage native price-triggered orders on Solana with trigger price, slippage, and expiry flags.