getTokenTrades

Returns the latest DEX trade by token on Ethereum, where currency smart contract is 0xC02a…6Cc2, block time since 2024-10-08 and block time till 2024-10-09: trade amount and amount in USD.

By Jose · saved 9 October 2024 · run 87 times · Bitquery API v2

What it returns

Filters

The query

query getTokenPriceForDate($dataset: dataset_arg_enum!, $network: evm_network!, $tokenAddress: String!, $since: DateTime!, $till: DateTime!) {
  EVM(dataset: $dataset, network: $network) {
  	DEXTradeByTokens(
      limit: { count: 1 }
      orderBy: { descending: Block_Time }
      where: {Trade: {Currency: {SmartContract: {is: $tokenAddress}}}, Block: {Time: {since: $since, till: $till}}}
    ) {
      Trade {
        Amount
        AmountInUSD
      }
    }
  }
}

Variables

{
  "dataset": "combined",
  "network": "eth",
  "tokenAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
  "since": "2024-10-08T19:40:59Z",
  "till": "2024-10-09T19:40:59Z"
}

Similar queries