How to Calculate Solana Wallet PnL from On-Chain Transactions
A reliable cost-basis and PnL pipeline for Solana wallets across swaps, transfers and token-account changes.
A reliable cost-basis and PnL pipeline for Solana wallets across swaps, transfers and token-account changes.
Normalize trades
Decode inner instructions and net token changes by owner. A transfer is not automatically a trade and failed transactions must be excluded.
Cost basis
Choose FIFO, average cost or another explicit method. Treat inbound transfers with unknown basis separately rather than inventing profit.
Prices and fees
Attach timestamped prices, SOL fees, priority fees and token transfer fees. Preserve the price source for auditability.
Reconciliation
Compare computed holdings with live token accounts and flag unsupported programs or missing history.
Start with our Solana TX Inspector or build a wallet tracker.
Building this for production?
We turn this architecture into tested, non-custodial software with monitoring, documentation and deployment support.
Related technical guides
Solana Copy-Trading Bots: How to Mirror Winning Wallets
Learn how to build a Solana copy-trading bot that selects wallets by on-chain edge, replicates trades with sub-100ms latency, and protects capital with kill-switches.
Read articleBuilding a Solana Copy-Trade Bot That Tracks Alpha Wallets
Copy-trading on Solana means streaming transaction logs, filtering by target wallets, decoding swap instructions, and replaying them with minimal latency. This tutorial covers the full implementation pipeline.
Read articleHow Solana Sniper Bots Work: Jito Bundles, Priority Fees & Anti-Rug
What actually makes a Solana sniper land first — block engines, priority fees, transaction simulation and the rug checks that keep you out of honeypots.
Read article