All articles
Solana·July 31, 2026·1 min read

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.

Need a bot like this built?

We design, build and run trading bots on Solana, Hyperliquid and Polymarket.

Start a project
#Solana#Trading Bots#Development