getTokenTrades

Returns the latest 100 DEX trades on Ethereum, where buy seller is 0xE58E…9413, sell buyer is 0xE58E…9413 and block time since 2024-09-22: block time, transaction hash, buy currency symbol, buy smart contract, buy decimals, buy currency name, buy amount and 9 more fields.

By Jose · saved 22 October 2024 · run 7 times · 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 {
          Currency {
            Symbol
            SmartContract
            Decimals
            Name
          }
          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": ["0xE58ED128325A33afD08e90187dB0640619819413"],
  "limit": 100,
  "offset": 0
}

Similar queries