---
name: wallet-trades
description: Read a Solana wallet's most recent transactions and turn each into plain balance changes - which tokens went in and out, whether it was a swap, a buy, a send or a receive, with time and fee. Use when the user asks what a wallet has been trading, buying or selling lately. Read-only; needs only the public address.
---
# Wallet recent trades
Free and read-only. Uses the public Solana RPC. Only a public address is needed: never ask
the user for a private key or seed phrase, and refuse if one is offered.
## Run
```bash
node scripts/trades.mjs <wallet address> # last 10 transactions
node scripts/trades.mjs <wallet address> --limit 20 # up to 20
```
Optional: set `SOLANA_RPC_URL` to your own RPC. The public RPC is rate-limited, so the
script waits between calls and a run of 20 takes several seconds.
## Output
JSON on stdout: `{ wallet, count, swaps, transactions: [ { signature, time, kind, changes:
[ { mint, delta } ], feeSol, failed } ] }`.
- `kind` is `swap` (something in and something out), `received`, `sent` or `other`.
- `mint` is `SOL` for native and wrapped SOL, otherwise the token mint address.
- `delta` is in whole tokens: negative left the wallet, positive came in.
## Notes for the agent
- To name the tokens, look up each mint (for example with the `dexscreener-token` skill).
- Link a transaction as `https://solscan.io/tx/<signature>`.
- Failed transactions are included with `failed: true`; leave them out of trade summaries.
MIT License
Copyright (c) 2026 Shelfwise
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.