24H trade volume
Let's build a text chart to show the trading volume of past 24 hours.

1.Choose Transaction data source.
2. Use Filter instruction.
Search all the transactions which contain SellBaseToken(seller, payBase, receiveQuote) or BuyBaseToken(buyer, receiveBase, payQuote) logs. And to be completely accurate, you also want to limit the logs.address
to all the trading pairs on DODO.

3. Using Project instruction to filter out logs which are not SellBaseToken or BuyBaseToken.

What data looks like now:

4. Use Project to sum up all the trade volume in one transaction
The trade volume is in the third parameter of BuyBaseToken log, payQuote
It can be referred as $$this.params.2.value

5. Don't forget to divide it by 1000000 since USDT and USDC are both 6 decimals.

What the data looks like now:

6. Use Group to sum up the value from all the transactions (in the past 24 hours).

7. Plug it in and you are all set!

Last updated
Was this helpful?