Unit of Trade Amount

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

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)
      }
    }
  }
}


The CA for this token is: 8hB5Wj9pZrnK58y2xBm6FVcyQ35rTxdavv9fVHgopump

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

Glossary of Builder terms: Glossary | Blockchain Data API (V2)