Skip to main content
GET
Wallet cost-basis PnL summary

Authorizations

X-API-Key
string
header
required

Preferred for swaps-api endpoints (/swaps/*, /stats/*, /trending, /pool-events).

Path Parameters

wallet
string
required

Wallet address (base58, 32–44 characters).

Query Parameters

pnl_mode
enum<string>
default:adjusted

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.

Available options:
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.

wallet
string
pnl_mode
string
realized_sol
number
unrealized_sol
number

Read-time spot unrealized PnL (null-priced mints contribute 0).

cost_basis_sol
number
open_positions
integer

Count of positions with balance > 0 and not a quote mint.

closed_positions
integer

Count of positions with balance == 0.

realized_usd
number | null
unrealized_usd
number | null
oracle
object | null

Pyth SOL/USD oracle snapshot used for USD conversion. null when the oracle is unavailable.

positions
object[]

Compact per-position rows.