Research & Trade with Nansen CLI

Written By Nansen Intern

Last updated About 3 hours ago

Research with CLI

Which chains are supported?

Currently, 20+ chains including Ethereum, Solana, Base, Arbitrum, Polygon, BNB Chain, Optimism, and Avalanche.

Run nansen help to show chains in help output or nansen schema which is an JSON output that includes chains array.

How do I track Smart Money flows?

The following example commands return net inflows/outflows by token, segmented by Smart Money wallet type.

nansen research smart-money netflow --chain ethereum 
nansen research smart-money netflow --chain solana 

How do I profile a wallet?

The following commands return portfolio breakdown, PnL, transaction history, and Smart Money labels:

nansen research profiler balance --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 
nansen research profiler balance --address vitalik.eth --chain ethereum

How does the token screener work?

The following command filters by Smart Money activity, volume, holder count, and more. All output is JSON:

nansen research token screener --chain solana --timeframe 24h

Can I pull perpetuals data?

Yes you can. Just input one of the following commands:

nansen research perp screener
nansen research token perp-positions --symbol BTC

Note: Perp data is available for supported protocols only. If you get empty results, check supported scope via

nansen schema perp

The response is too large. How do I reduce it?

Use --fields to return only what you need:

nansen research profiler balance --address vitalik.eth --chain ethereum

Combine with --limit on list endpoints:

nansen research smart-money netflow --chain ethereum --limit 10

Trade with Nansen CLI

How do I execute a DEX swap?

Two commands. Supported on Solana and Base.

Step 1 β€” Get a quote:

nansen trade quote --chain solana --from SOL --to USDC --amount 100

Step 2 β€” Execute:

nansen trade execute --quote <quote-id>

Review the quote (price, slippage, route) before executing. Once submitted, transactions cannot be cancelled.

Are hardware wallets supported?

Yes, it is supported via WalletConnect Integration.

Can I use token symbols instead of contract addresses?

Yes. Common tokens resolve automatically:

nansen trade quote --chain base --from ETH --to USDC --amount 1

For long-tail tokens, use the contract address directly to avoid ambiguity.

Is it safe to use for large trades?

The CLI routes through the same multi DEX aggregator as Nansen's web app (Jupiter, OKX DEX, LI.FI). For large trades: do a small test first, check slippage in the quote output, avoid high network congestion periods. Standard DEX risks apply.


Wallet Management

Where are my private keys stored?

Keys are stored in ~/.nansen/wallets.json. Config stores API key.

How do I use the CLI in a CI/CD or non-interactive environment?

Set credentials as environment variables:

NANSEN_API_KEY=your_key 

The CLI detects these automatically and skips interactive prompts. Works in GitHub Actions, cron jobs, and agent pipelines.

Can I use multiple wallets?

Yes. Use named profiles:

nansen login --api-key <key>

Profiles are stored separately and can be switched per command.