Definitive Logo
APIDocsEDGE TokenTeamBlog
Launch App
← Back to blogguide

How to Track Your Onchain PnL

Apr 2026 · 7 min read

Onchain PnL tracking means calculating your realized and unrealized profit and loss from trades executed on decentralized exchanges, across multiple wallets and chains, with full cost-basis accounting. Definitive's onchain trading terminal includes built-in post-trade reporting and PnL tracking — so your execution and accounting live in one place.

Why Onchain PnL is Harder to Track

Tracking PnL from onchain trading is fundamentally more complex than tracking it on a centralized exchange. Here's why.

No unified order history. On a CEX, every trade lives in a single database attached to your account. Onchain, your trade history is fragmented across multiple chains, wallets, and protocols. Each transaction is a separate onchain event — you have to aggregate and interpret them yourself, or use a tool that does it for you.

Cost basis is ambiguous without tracking. For tax and performance purposes, you need to know what you paid for a token (cost basis) before you can calculate gain or loss on a sale. Onchain, cost basis depends on which specific tokens you received, when, from which swap, and at what price. Accounting methods (FIFO, LIFO, specific identification) produce different results — and most wallets give you none of this.

Fees, gas, and slippage must be included. Your true PnL on a trade isn't just (sell price − buy price) × quantity. You also paid gas fees (or, on Definitive, had them sponsored), protocol fees, and you experienced some slippage. Ignoring these understates your costs and overstates your profits.

Multi-chain complexity compounds the problem. If you're trading across Base, Arbitrum, Ethereum, Solana, and other chains, you're dealing with different block explorers, different fee structures, different native tokens, and often different wallet addresses. Manually reconciling this is error-prone and time-consuming.

Token prices at the time of trade are hard to reconstruct. Historical token prices — especially for long-tail tokens — are often unavailable or unreliable from standard sources. Calculating accurate historical PnL requires either price oracle data at the block level or a tool that captures prices at execution time.

What to Look For in a PnL Tool

Not all PnL tools are created equal. For serious onchain traders, here's what matters:

Real-time execution capture. The best PnL tools capture price and size data at the moment of execution — not reconstructed later from block data. This ensures accuracy, especially for tokens with thin or volatile liquidity.

Multi-chain, multi-wallet support. If you trade on more than one chain or use more than one wallet, a single-chain tool creates blind spots. Look for a tool that aggregates across all your addresses and chains.

Fee and gas inclusion. PnL calculations should include all transaction costs — gas fees, protocol fees, slippage, and any spread embedded in routing. Tools that show "gross" PnL without costs give a misleading picture.

Exportable data. For tax filing, audit trails, or fund reporting, you need to export your trade history in a structured format (CSV, Excel, or API). Locked-in dashboards with no export functionality are a liability for institutional users.

Integration with your custody setup. If you use Fireblocks, Fordefi, Safe, or Squads, your PnL tool should connect to those custody providers directly — not require you to manually input transactions.

Definitive's built-in post-trade reporting covers all of the above. It captures execution data at the time of trade, aggregates across chains, includes all fees, and provides exportable reports. See Onchain PnL Tracking Guide for a deeper overview.

Step-by-Step: Tracking PnL on Definitive

Step 1: Connect your wallet(s) Log in to definitive.fi and connect your primary wallet. Definitive supports EOA wallets and institutional custody: Fireblocks, Fordefi, Safe, and Squads. If you trade from multiple addresses, connect each one — PnL is aggregated across all connected wallets.

Step 2: Navigate to the reporting dashboard From the main interface, access the post-trade reporting section. This shows a summary view of all trades executed through Definitive: token pairs, timestamps, fill prices, sizes, fees, and chains.

Step 3: Review realized PnL by position Definitive tracks your cost basis per token and calculates realized PnL when you exit a position. The dashboard shows:

  • Entry price and timestamp
  • Exit price and timestamp
  • Total fees (including any protocol fees; gas is sponsored)
  • Net PnL in USD and as a percentage

Step 4: Review unrealized PnL for open positions For tokens you still hold, Definitive shows unrealized PnL calculated against current market price. This gives you a real-time view of where your book stands.

Step 5: Filter by chain, token, or time period Use the filtering options to isolate specific positions. Filter by:

  • Chain (Ethereum, Base, Arbitrum, Solana, etc.)
  • Token pair
  • Date range
  • Order type (TWAP, limit, stop, market)

This is particularly useful for reviewing performance on specific strategies or during specific market periods.

Step 6: Drill into individual trades Click any trade to see the full execution breakdown: which DEXs were used, how the order was routed, per-slice fill prices (for TWAP orders), and onchain transaction hashes for verification.

Step 7: Export your data Use the export function to download your trade history as a CSV or structured report. This is formatted for use in accounting software, tax tools, or fund reporting systems.

Exporting and Reporting

Onchain PnL data has multiple use cases beyond personal tracking. Here's how to make the most of Definitive's export capabilities.

Tax reporting. Export your full trade history with cost basis, proceeds, and net gain/loss per trade. This is the data your accountant or tax software needs. Definitive captures execution prices at the block level, giving you defensible historical prices — not reconstructed estimates.

Fund and investor reporting. If you manage capital for others — a DeFi hedge fund, family office, or DAO treasury — you need periodic performance reports. Definitive's export gives you the raw data to build those reports, including attribution by strategy, chain, or time period.

Audit trails. For institutions using Fireblocks or Fordefi, every trade on Definitive is linked to the relevant policy approval workflow. The audit trail from order creation through execution and reporting is complete and exportable.

Multi-wallet consolidation. If you trade from Definitive Performer Addresses (Definitive's privacy proxy addresses) or multiple wallets, all activity is consolidated under your account. You don't need to manually aggregate across addresses.

Integration with third-party tools. Definitive's structured CSV exports are compatible with major portfolio tracking and accounting tools. API access is available for institutional users who want to pull data programmatically into their own systems.

Frequently Asked Questions

What is onchain PnL and why is it different from CEX PnL?

Onchain PnL refers to profit and loss from trades executed on decentralized exchanges, settled directly on the blockchain. Unlike CEX PnL — which is tracked automatically in a single account — onchain PnL requires aggregating data from multiple transactions, chains, and wallets. Cost basis, fees, and slippage all need to be accounted for separately.

Does Definitive track PnL across all supported chains?

Yes. Definitive aggregates trade history across all supported chains: Base, Arbitrum, Ethereum, Optimism, Polygon, Avalanche, BNB, HyperEVM, and Solana. If you connect multiple wallets or use Performer Addresses for privacy, all activity is consolidated in the reporting dashboard.

Can I use Definitive's PnL data for tax filing?

Definitive's post-trade reports include all the data fields needed for tax filing: trade date and time, token pair, cost basis, proceeds, fees, and net gain/loss. For complex situations (DeFi income, airdrops, liquidity mining), you may need additional categorization, but Definitive's export provides the foundational trade data. Consult a crypto-specialized accountant for specific tax guidance.

How does Definitive handle cost basis for TWAP orders?

For TWAP orders, each individual slice is recorded as a separate execution with its own price, timestamp, and fee. Definitive calculates your average cost basis across all slices automatically, and shows both the per-slice and blended average in your trade history.

What if I also trade on platforms other than Definitive?

Definitive's PnL tracking covers only trades executed through Definitive. For trades on other platforms, you'll need to import that data separately or use a dedicated portfolio aggregator. For comprehensive cross-platform tracking, tools like Rotki, Koinly, or Nansen can supplement Definitive's native reporting.

Ready to trade onchain with institutional-grade execution? Try Definitive — gasless, multichain, and built for serious traders.




Definitive Logo

©2025 All Rights Reserved