Fetch block-level PNL across wallets.
Blockchain | Balances Model |
---|---|
EVM-Compatible Blockchains | The crosschain.assets.fungible_pnl_evm model offers a historical record of fungible asset pnls at block-level granularity. Chain-specific tables are available at <chain>.assets.fungible_pnl . |
Solana | The solana.assets.pnl model offers a historical record of SOL and spl tokens (no NFTs) pnls at transaction-level granularity. Refer to here for more details. |
average_cost
: The current weighted average cost per token unit, calculated as cumulative_costs / cumulative_quantities
cumulative_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 pricecumulative_costs
and quantities
are reduced proportionally, keeping the average_cost
unchanged.
Detailed PNL Calculation Methodology and Examples
Getting Daily PNL
Getting Aggregated PNL
chain, address, token_address, unique_id
Column Name | Description |
---|---|
chain | The EVM-compatible blockchain where the assets are held. |
token_type | The type of token (e.g., ‘native’, ‘erc20’). |
address | The wallet address holding the token. |
token_address | The contract address of the token. Native tokens are represented with zero address. |
token_name | The name of the token. |
token_symbol | The symbol of the token. |
balance | The current token balance after this transaction. |
prev_balance | The token balance before this transaction. |
balance_change | The change in token balance from this transaction (balance - prev_balance). Can be negative. |
usd_exchange_rate | The USD exchange rate for the token at the time of the transaction. |
usd_balance | The current token balance converted to USD at transaction time. |
usd_balance_change | The change in USD balance from this transaction. Can be negative. |
usd_exchange_rate_latest | The latest available USD exchange rate for the token. |
usd_balance_latest | The current token balance converted to USD using the latest exchange rate. |
transaction_type | The type of transaction: ‘first_purchase’, ‘purchase’, ‘sale’, or ‘no_change’. |
tokens_purchased | The number of tokens purchased in this transaction (0 for sales). |
tokens_sold | The number of tokens sold in this transaction (0 for purchases). |
average_cost | The current weighted average cost per token unit after this transaction. |
cumulative_costs | The total USD cost basis remaining after accounting for proportional reductions from sales. |
cumulative_quantities | The total token quantity remaining after accounting for sales. |
realized_pnl | The cumulative realized profit/loss from all sales transactions for this token up to this point. |
realized_pnl_this_tx | The realized profit/loss from this specific transaction (null for purchases). |
unrealized_pnl | The unrealized profit/loss based on the token price at the time of this transaction. |
unrealized_pnl_latest | The unrealized profit/loss based on the latest available token price. |
block_timestamp | The timestamp of the block containing this transaction. |
block_number | The block number containing this transaction. |
block_hash | The hash of the block containing this transaction. |
unique_id | A unique identifier for this PNL record. |