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
How 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 articleToken Launch Anti-Bot Measures on Solana and How Bots Adapt
Launchpads increasingly deploy delay pools, fee tiers, and blocklist logic to deter bots. This post catalogs common anti-bot patterns seen on Solana launchpads and the countermeasures sophisticated sniper bots employ.
Read articleOrca Whirlpool Tick Ranges and How Bots Snipe New Positions
Orca's concentrated liquidity Whirlpool pools create predictable initial tick ranges on launch. This post dissects the pool initialization instruction and shows how bots size entries relative to the initial price range.
Read article