# Get total swaps for BNB and swaps to a token for a given time period

**URL:** <https://community.bitquery.io/t/get-total-swaps-for-bnb-and-swaps-to-a-token-for-a-given-time-period/251>\
**Category:** GraphQL API\
**Tags:** support, closed\
**Created:** [June 29, 2021, 5:42pm UTC](https://community.bitquery.io/t/get-total-swaps-for-bnb-and-swaps-to-a-token-for-a-given-time-period/251 "2021-06-29T17:42:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FomoTrader](https://avatars.discourse-cdn.com/v4/letter/f/a3d4f5/32.png) [@FomoTrader](https://community.bitquery.io/u/FomoTrader)\
**Post date:** [June 29, 2021, 5:42pm UTC](https://community.bitquery.io/t/get-total-swaps-for-bnb-and-swaps-to-a-token-for-a-given-time-period/251/1 "2021-06-29T17:42:34Z")

</div>

```auto
{
  ethereum(network: bsc) {
    dexTrades(
      sellCurrency: {is: "0x67fa5b3e9f15b793caae1dc2996de029ca45591c"}
      time: {since: "2021-06-29T12:50:00"}
      exchangeName: {in: ["Pancake", "Pancake v2"]}
      options: { desc: "sellAmount" }
    ) {
      buyCurrency {
        name
        symbol
        address
      }
      buyAmount
      sellAmount
    }
  }
}

```

The above query is meant to give me back the number of swaps that have happened for a particular token in BNB. So we can use it to track the volume of buys/sells. This will allows us to spot when private sellers are dumping a token of ours.

The above query returns two values for buys/sells and the amounts are identical and I suspect it’s only the `sell` amount, which is the `swapExactTokensForETH`. I also want to track `SwapETHForTokens` and convert both of those to dollar value.

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)\
**Post date:** [June 30, 2021, 6:58am UTC](https://community.bitquery.io/t/get-total-swaps-for-bnb-and-swaps-to-a-token-for-a-given-time-period/251/2 "2021-06-30T06:58:42Z")

</div>

1 - There is no concept of Buy/sell in AMMs, it’s just Swaps.

2 - If you mention the currency it will give you all the pairs data against that currency is swapped.

3- If you want to track trading volume of a currency check this query.

```auto
{
   ethereum (network: bsc) {
    dexTrades(
      exchangeName: {in: ["Pancake","Pancake v2"] },
      baseCurrency: {is:"0x67fa5b3e9f15b793caae1dc2996de029ca45591c"}
    ) {
      count
      tradeAmount(in:USD)
          
    }
  }
}

```

Is this answer your question.

---

<div class="post-metadata">

**Author:** ![sayon](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sayon](https://community.bitquery.io/u/sayon)\
**Post date:** [July 9, 2021, 7:03am UTC](https://community.bitquery.io/t/get-total-swaps-for-bnb-and-swaps-to-a-token-for-a-given-time-period/251/3 "2021-07-09T07:03:04Z")

</div>



---

<div class="post-metadata">

**Author:** ![sayon](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sayon](https://community.bitquery.io/u/sayon)\
**Post date:** [July 30, 2021, 9:42am UTC](https://community.bitquery.io/t/get-total-swaps-for-bnb-and-swaps-to-a-token-for-a-given-time-period/251/4 "2021-07-30T09:42:55Z")

</div>


