# How I can calculate the trade volume of a time range from streaming data?

**URL:** <https://community.bitquery.io/t/how-i-can-calculate-the-trade-volume-of-a-time-range-from-streaming-data/1381>\
**Category:** GraphQL API\
**Tags:** support\
**Created:** [February 5, 2023, 4:09pm UTC](https://community.bitquery.io/t/how-i-can-calculate-the-trade-volume-of-a-time-range-from-streaming-data/1381 "2023-02-05T16:09:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![linthertoss](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/linthertoss/32/559_2.png) [@linthertoss](https://community.bitquery.io/u/linthertoss)\
**Post date:** [February 5, 2023, 4:09pm UTC](https://community.bitquery.io/t/how-i-can-calculate-the-trade-volume-of-a-time-range-from-streaming-data/1381/1 "2023-02-05T16:09:45Z")

</div>

From [this query](https://graphql.bitquery.io/ide/dextrades)  
How I can calculate the trade volume of a time range from streaming data?

---

<div class="post-metadata">

**Author:** ![Divya](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@Divya](https://community.bitquery.io/u/Divya)\
**Post date:** [February 6, 2023, 9:24am UTC](https://community.bitquery.io/t/how-i-can-calculate-the-trade-volume-of-a-time-range-from-streaming-data/1381/2 "2023-02-06T09:24:45Z")

</div>

You do not need streaming API for that. A regular dextrade will do, the below query is an example for hourly trades, you can set the same for a different **timeInterval**

```auto
{
  ethereum(network: bsc) {
    dexTrades(
      options: {limit: 24, desc: "timeInterval.hour"}
      date: {since: "2023-01-03"}
      exchangeName: {is: "Pancake v2"}
      baseCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}
      quoteCurrency:{is:"0x55d398326f99059ff775485246999027b3197955"},
    ) {
      count
      tradeAmount(in: USD)
      timeInterval {
        hour(count: 1)
      }
      }
  }
}

```

---

<div class="post-metadata">

**Author:** ![Aleksey](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@Aleksey](https://community.bitquery.io/u/Aleksey)\
**Post date:** [February 7, 2023, 6:24am UTC](https://community.bitquery.io/t/how-i-can-calculate-the-trade-volume-of-a-time-range-from-streaming-data/1381/3 "2023-02-07T06:24:51Z")

</div>

This feature will be in the next reeease of streaming graphql
