getTokenTrades test

Returns the latest 100 DEX trades on Ethereum, where block time since 2024-09-22, block time till 2024-10-22 and buy amount in USD is above 0.001: block time, transaction hash, buy buyer, buy currency symbol, buy smart contract, buy decimals, buy currency name and 11 more fields.

By gaurav · saved 23 October 2024 · run 1 time · Bitquery API v2

What it returns

Filters

The query

query getTokenTrades(
  $dataset: dataset_arg_enum!
  $network: evm_network!
  $limit: Int!
  $offset: Int!
  $tokenAddresses: [String!]
  $wallets: [String!]
  $since: DateTime!
  $till: DateTime!
) {
  EVM(dataset: $dataset, network: $network) {
    buyside: DEXTrades(
      limit: { count: $limit, offset: $offset }
      orderBy: { descending: Block_Time }
      where: {
        Trade: { Buy: { AmountInUSD: { gt: "0.001" },
          Currency: { SmartContract: { in: $tokenAddresses } }, 
          Seller: { in: $wallets } } }
        Block: { Time: { since: $since, till: $till } }
      }
    ) {
      Block {
        Time
      }
      Transaction {
        Hash
      }
      Trade {
        Buy {
          Buyer
          Currency {
            Symbol
            SmartContract
            Decimals
            Name
          }
          Seller
          Amount
          AmountInUSD
        }
        Dex {
          Delegated
          DelegatedTo
        }
      }
    }
    sellside: DEXTrades(
      limit: { count: $limit, offset: $offset }
      orderBy: { descending: Block_Time }
      where: {
        Trade: { Sell: { AmountInUSD: { gt: "0.001" }, Currency: { SmartContract: { in: $tokenAddresses } }, Buyer: { in: $wallets } } }
        Block: { Time: { since: $since, till: $till } }
      }
    ) {
      Block {
        Time
      }
      Transaction {
        Hash
      }
      Trade {
        Sell {
          Currency {
            Symbol
            SmartContract
            Decimals
            Name
          }
          Amount
          AmountInUSD
        }
        Dex {
          Delegated
          DelegatedTo
        }
      }
    }
  }
}

Variables

{
  "dataset": "combined",
  "network": "eth",
  "tokenAddress": [
    "0x6B175474E89094C44Da98b954EedeAC495271d0F"
  ],
  "till": "2024-10-22T23:59:59Z",
  "since": "2024-09-22T00:00:00Z",
  "wallets": [],
  "limit": 100,
  "offset": 0
}

Similar queries