🗃️Trader P&L FAQ

Additional documentation on the Dex Trader P&L Table

Basics

  • All profit fields are based on realized P&L. For example, fields such as:

    • total_profit, adjusted_pnl, block_hour_profit

  • Only tokens bought and sold on dexes count toward the P&L

  • The profit for each trade is based on the counterpart token value and price

    • E.g., swapping token A for token B, the value of this trade is based on Token B

  • For now, we only consider the major DEX to avoid data quality issues

  • Multi-path trades are consolidated whenever possible

    • USDC -> ETH, ETH -> UNI is converted into USDC -> UNI

  • Trades for tokens that that have a mint or burn function, combined add/remove LP + swap calls, extra fee logic, or have different or multiple sender / receiver (MEV bots bribing validators) are excluded from the analysis

Profit & Loss Book Keeping

For each valid buy, we create an open balance for that token.

For each valid sale, we deduct from the open balance and calculate the profit and loss for that transaction.

For each token balance change, we multiply -DELTA by the USD$ price.

The P&L at any given time is the total value of the book, minus the initial value of the unsold inventory. Mechanically, we issue a "refund" to deduct from the P&L amount. This results in a $1k profit for ETH and no profit for USDC.

We also deduct transactions fees incurred during these transactions from the final profit and loss amount.

Last updated