getCurrentTokenPrice

Returns the latest 10 DEX trades by token on Base, where currency smart contract is 0x50c5…b0cb, block time since 2024-10-11 and block time till 2024-10-11: trade amount and amount in USD.

By Jose · saved 11 October 2024 · Bitquery API v2

What it returns

Filters

The query

query getCurrentTokenPrice(
  $dataset: dataset_arg_enum!,
  $network: evm_network!,
  $tokenAddress: String!,
  $since: DateTime!,
  $till: DateTime!
) {
  EVM(dataset: $dataset, network: $network) {
    DEXTradeByTokens(
      # Get the last 10 trades
      limit: { count: 10 }
      orderBy: { descending: Block_Time }
      where: {Trade: {Currency: {SmartContract: {is: $tokenAddress}}, AmountInUSD: {gt: "0.001"}}, Block: {Time: {since: $since, till: $till}}}
    ) {
      Trade {
        Amount
        AmountInUSD
      }
    }
  }
}

Variables

{
  "dataset": "combined",
  "network": "base",
  "tokenAddress": "0x50c5725949a6f0c72e6c4a641f24049a917db0cb",
  "since": "2024-10-11T00:00:00Z",
  "till": "2024-10-11T12:00:00Z"
}

Similar queries