🗃️Dex Trader Use Cases

Search For Profitable Tokens

To get the current PnL, take the SUM of all the block_hour_profit and subtract the SUM of block_hour_fees grouped by the token column.

Since block_hour_profit is just the difference between total_profit at 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 total_profit.

Search For Profitable Traders

Same process as above, but grouped by the trader column.

Calculating % P&L

Use the following formula to calculate % P&L.

total_profit/(cumulative cost - refund)

Last updated