MCPInstall

nansen-trade

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

Installs
122
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/nansen-ai/nansen-cli --skill nansen-trade
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads nansen-trade automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

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.

Source

FAQ

What does the nansen-trade skill do?

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

How do I install nansen-trade?

Run npx skills add https://github.com/nansen-ai/nansen-cli --skill nansen-trade in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/nansen-trade/ (personal) or .claude/skills/nansen-trade/ (project).

Which AI agents can use nansen-trade?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is nansen-trade safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains nansen-trade?

It is published by nansen-ai in nansen-ai/nansen-cli. It has 122 recorded installs.

More from nansen-ai/nansen-cli

View all →

nansen-web-searcher

nansen-ai/nansen-cli

Search the web for one or more queries in parallel. Use when you need current information, news, prices, or any web content to complement on-chain Nansen data.

653 installs

nansen-smart-money-tracker

nansen-ai/nansen-cli

Smart money tracking — netflow, trades, holdings, perp trades. Use when finding what smart money wallets are buying/selling or tracking whale activity.

543 installs

nansen-prediction-markets

nansen-ai/nansen-cli

Polymarket screeners — discover trending events, top markets by volume, and search for specific markets. Use when browsing what's happening on prediction markets.

488 installs

nansen-smart-money-alpha

nansen-ai/nansen-cli

Open the skill to read its SKILL.md instructions.

472 installs

nansen-web-fetcher

nansen-ai/nansen-cli

Open the skill to read its SKILL.md instructions.

457 installs

nansen-portfolio-tracker

nansen-ai/nansen-cli

Open the skill to read its SKILL.md instructions.

443 installs

Popular other skills

View category →

hyperframes-cli

heygen-com/hyperframes

The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.

1.3M installs

triage

mattpocock/skills

Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.

1M installs

ask-matt

mattpocock/skills

Ask which skill or flow fits your situation. A router over the skills in this repo.

778.4K installs

to-questionnaire

mattpocock/skills

Turn a decision you can't fully answer into a questionnaire for someone else to fill in.

508.9K installs

wait-what

mattpocock/skills

Stop. That last message did not land: re-pitch it.

459.7K installs

loop-me

mattpocock/skills

Grill me about specs for the workflows I want to build, within this workspace.

447.9K installs