jramirez query

Returns the latest 1000 DEX trades on Base, where buy currency smart contract is 0x50c5…b0cb, 0x8335…2913 or 1 more, sell currency smart contract is 0x50c5…b0cb, 0x8335…2913 or 1 more and sell buyer is 0x5dC7…5db2: block time, transaction hash, buy currency symbol, buy smart contract, buy currency name, buy decimals, buy amount and 9 more fields.

By Divyasshree · saved 11 October 2024 · run 2 times · Bitquery API v2

What it returns

Filters

The query

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

Variables

{
  "dataset": "archive",
  "network": "base",
  "tokenAddress": [
    "0x50c5725949a6f0c72e6c4a641f24049a917db0cb",
    "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "0x4200000000000000000000000000000000000006"
  ],
  "since": "2024-04-11T12:00:00Z",
  "till": "2024-10-11T12:00:00Z",
  "wallet": "0x5dC76A02C49d6f15FBdE0506e0d7cc630CEe5db2",
  "limit": 1000
}

Similar queries