Query price chart for token page

Returns DEX trades by token on Polygon, where currency smart contract is 0x53e0…ad39, block date since 2024-04-01 and trade price in USD is above 0, sorted by block time: block time and average of trade price in USD.

By Aleksey · saved 17 May 2024 · run 2 times · Bitquery API v2

What it returns

Filters

The query

query(
  $network: evm_network 
	$currency: String
) {
  EVM(network: $network dataset: combined) {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      
    
      where: {
        Block: {
          Date: {
            since: "2024-04-01"
          }
        }
        Trade: {
          PriceInUSD: {
            gt: 0
          }
          Currency: {
            SmartContract: {
              is: $currency
            }
          }
        }
        
      }
    
    ) {
      
      Block {
        Time(interval: {count: 10 in: minutes})
      }
      
      average(of: Trade_PriceInUSD)
      
    
      
    }
  }
}

Variables

{
  "network": "matic",
  "currency": "0x53e0bca35ec356bd5dddfebbd1fc0fd03fabad39"
}

Similar queries