Wallet cost-basis PnL summary
Phase 8 cost-basis PnL summary for a wallet: realized + read-time-spot unrealized SOL, open/closed position counts, USD via Pyth, and a compact per-position list. Empty wallets return zeros and an empty positions array.
Cached 5s when any position traded in the last 5 minutes, otherwise 30s.
Authorizations
Preferred for swaps-api endpoints (/swaps/*, /stats/*, /trending, /pool-events).
Path Parameters
Wallet address (base58, 32–44 characters).
Query Parameters
PnL accounting mode. strict (FIFO) and adjusted (weighted-avg cost) are realized-PnL figures; raw is net cash-flow (Σ sells − Σ buys), not realized PnL. Unknown values fall back to adjusted.
raw, strict, adjusted Response
PnL summary
Cost-basis PnL summary for a wallet (Phase 8 engine). All *_sol fields are SOL. unrealized_sol is read-time spot Σ(price−avg_cost)*balance; null-priced mints contribute 0. Wallets with no positions return zeros and an empty positions array.
Read-time spot unrealized PnL (null-priced mints contribute 0).
Count of positions with balance > 0 and not a quote mint.
Count of positions with balance == 0.
Pyth SOL/USD oracle snapshot used for USD conversion. null when the oracle is unavailable.
Compact per-position rows.

