getTokenTrades

Returns the latest DEX trade on Base, where buy seller is 0xb4d8…332c, block time since 2024-05-03 and block time till 2024-10-30: block time, transaction hash, sell currency symbol, sell smart contract, sell decimals, sell currency name, sell seller and 12 more fields.

By Jose · saved 30 October 2024 · run 22 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) {
    DEXTrades(
      limit: { count: $limit, offset: $offset }
      orderBy: { descending: Block_Time }
      where: {
        Trade: {
          Buy: {
            Seller: { is: "0xb4d857f275da05982b0ffc7fac19f3fcdb1e332c" }
            Currency: { SmartContract: { in: $tokenAddresses } }
          }
        }
        Block: { Time: { since: $since, till: $till } }
      }
    ) {
      Block {
        Time
      }
      Transaction {
        Hash
      }
      Trade {
        Sell {
          Currency {
            Symbol
            SmartContract
            Decimals
            Name
          }
          Seller
          Buyer
        }
        Buy {
          Currency {
            Symbol
            SmartContract
            Decimals
            Name
          }
          Amount
          AmountInUSD
          PriceInUSD
          Seller
          Buyer
        }
        Dex {
          Delegated
          DelegatedTo
        }
      }
    }
  }
}

Variables

{
  "dataset": "combined",
  "network": "base",
  "tokenAddress": [
    "0x50c5725949a6f0c72e6c4a641f24049a917db0cb"
  ],
  "till": "2024-10-30T09:52:30.948Z",
  "since": "2024-05-03T09:52:30.948Z",
  "wallets": ["0xb4d857f275da05982b0ffc7fac19f3fcdb1e332c"],
  "limit": 1,
  "offset": 0
}

Similar queries