# Unit of Trade Amount

**URL:** <https://community.bitquery.io/t/unit-of-trade-amount/1989>\
**Category:** GraphQL API\
**Created:** [July 6, 2024, 5:58pm UTC](https://community.bitquery.io/t/unit-of-trade-amount/1989 "2024-07-06T17:58:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmac342352](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@jmac342352](https://community.bitquery.io/u/jmac342352)\
**Post date:** [July 6, 2024, 5:58pm UTC](https://community.bitquery.io/t/unit-of-trade-amount/1989/1 "2024-07-06T17:58:51Z")

</div>

Hi,

I am trying to get the volume traded for a specific token on solana. It appears I should be using `volume: sum(of: Trade_Amount)`. The query works but the volume in the response does not match what I see on dex screener.

I think the issue is just my lack of understanding on what the numbers represent.

On dex screener it says the token traded 241.019k shares during the 15 min candle that started at 17:15. The response from the API says the volume is 538884305.844.

I tried to multiply by the token price in USD and Solana but neither seems to make sense. I tried looking at the docs but could not find a relevant section. I made sure to limit to transactions from raydium so I think it should match the dex screener chart.

This is the query I am using

```auto
query MyQuery {
  Solana {
    DEXTradeByTokens(
      orderBy: {descendingByField: "Block_Timefield"}
      limit: {count: 20}
      where: {Trade: {Currency: {MintAddress: {is: "8hB5Wj9pZrnK58y2xBm6FVcyQ35rTxdavv9fVHgopump"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}, Dex: {ProgramAddress: {is: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"}}}}
    ) {
      Block {
        Timefield: Time(interval: {in: minutes, count: 15})
      }
      volume: sum(of: Trade_Amount)
      Trade {
        high: Price(maximum: Trade_Price)
        low: Price(minimum: Trade_Price)
        open: Price(minimum: Block_Slot)
        close: Price(maximum: Block_Slot)
      }
    }
  }
}

```

 ![Screen Shot 2024-07-06 at 1.38.48 PM](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/1affa6c5ddda1bfbf0944b0f0b1afd3706f735b1.jpeg)  
The CA for this token is: 8hB5Wj9pZrnK58y2xBm6FVcyQ35rTxdavv9fVHgopump

---

<div class="post-metadata">

**Author:** ![akshat.bitquery](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@akshat.bitquery](https://community.bitquery.io/u/akshat.bitquery)\
**Post date:** [July 8, 2024, 7:36am UTC](https://community.bitquery.io/t/unit-of-trade-amount/1989/2 "2024-07-08T07:36:08Z")

</div>

Hi,  
Filter for successful transactions, using filter `Transaction: {Result: {Success: true}}` in `where`. Right now, you are accommodating failed trades also.

One more thing you need to change `volume: sum(of: Trade_Amount)` to `volume: sum(of: Trade_Side_AmountInUSD)` because we don’t have sometimes Trade\_AmountInUSD for some tokens, so you use Trade\_Side\_AmountInUSD. As Trade\_AmountInUSD= Trade\_Side\_AmountInUSD.

Saved query: [ohlc - Blockchain Data API](https://ide.bitquery.io/ohlc_8)

Glossary of Builder terms: [Glossary | Blockchain Data API (V2)](https://docs.bitquery.io/docs/category/glossary/)
