nansen-trade
Original:🇺🇸 English
Translated
Execute DEX swaps on Solana, Ethereum, Base, or BSC. Use when buying or selling a token, getting a swap quote, or executing a trade.
8installs
Sourcenansen-ai/nansen-cli
Added on
NPX Install
npx skill4agent add nansen-ai/nansen-cli nansen-tradeTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Trade
Two-step flow: quote then execute. Trades are irreversible once on-chain.
Prerequisite: You need a wallet first. Run before trading.
nansen wallet createQuote
bash
nansen trade quote \
--chain solana \
--from SOL \
--to USDC \
--amount 1000000000Symbols resolve automatically: , , , , , , . Raw addresses also work.
SOLETHBNBUSDCUSDTWETHWBNBExecute
bash
nansen trade execute --quote <quote-id>Agent pattern
bash
# 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 | |
| USDC | Solana | |
| ETH | Base | |
| USDC | Base | |
Amounts are in base units
| Token | Decimals | 1 token = |
|---|---|---|
| SOL | 9 | |
| ETH | 18 | |
| USDC | 6 | |
Flags
| Flag | Purpose |
|---|---|
| |
| Source token (symbol or address) |
| Destination token (symbol or address) |
| Amount in base units (integer) |
| Wallet name (default: default wallet) |
| Slippage tolerance as decimal (e.g. 0.03) |
| Quote ID for execute |
| Skip pre-broadcast simulation |
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.