About PNL
What is it?
The PnL API (Profit and Loss API) provides time-series financial analytics for assets held in wallets on the TON blockchain. It is designed to track the performance of tokens - both TON and Jettons across time, calculating balances, prices, and realized/unrealized profit and loss
Net Worth Flow
Returns the historical net worth of a given asset in a user wallet. It combines the token balance and its USD price over a specified time range and interval (e.g., hourly, daily) to compute: - balance: Token balance at each interval - estimate_usd: Estimated token price in USD - net_worth: Total value of the asset in USD
PNL Flow
Provides a detailed realized and unrealized PnL breakdown over time. For each interval: - Tracks tokens bought/sold and corresponding USD values - Computes realized PnL from sold assets - Computes unrealized PnL from the remaining balance
PNL
Returns the current cumulative PnL state (not time series). It can be used to get a snapshot of a walletβs financial status including: - Total bought/sold - Current balance - Realized and unrealized gains - Average entry price and latest token price