solana.assets.pnl table holds transaction-level PNL records.
Table Details
PNL calculation and Methodology
See here for details.Key Fields
The PNL model provides several important fields for analysis:average_cost: The current weighted average cost per token unit, calculated ascumulative_costs / cumulative_quantitiescumulative_costs: The total USD cost basis remaining after accounting for sales (reduces proportionally when tokens are sold)cumulative_quantities: The remaining token quantity after accounting for salesrealized_pnl: The cumulative realized profit/loss from all sales transactions for this tokenunrealized_pnl: The unrealized profit/loss based on the token price at the time of the transactionunrealized_pnl_latest: The current unrealized profit/loss using the latest available token price
Getting Daily PNL
Getting Daily PNL
This query shows how to get daily PNL snapshots for a wallet
Getting Aggregated PNL
Getting Aggregated PNL
This query shows how to get aggregated PNL across multiple address and/or tokens for portfolio-level analysis.