Dex Trader Use Cases
To get the current PnL, take the SUM of all the
block_hour_profitand subtract the SUM of
block_hour_feesgrouped by the token column.
block_hour_profitis just the difference between
total_profitat consecutive trades (but without tx fees), It is equivalent to finding the max
block_hour, which refers to the latest trade for the token, and taking the corresponding
Same process as above, but grouped by the trader column.
Use the following formula to calculate % P&L.
total_profit/(cumulative cost - refund)