dex trade for a currency

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

By gaurav · saved 30 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!], $since: DateTime!, $till: DateTime!) {
  EVM(dataset: $dataset, network: $network) {
    DEXTradeByTokens(
      limit: {count: $limit, offset: $offset}
      orderBy: {descending: Block_Time}
      where: {
        Block:{Time:{since:$since till:$till}}
        Trade: {Buyer: {is: "0xb4d857f275da05982b0ffc7fac19f3fcdb1e332c"},
        Currency: {SmartContract: {in: $tokenAddresses}}}}
    ) {
      Block {
        Time
      }
      Transaction {
        Hash
      }
      Trade {
        Currency {
          Symbol
          SmartContract
          Decimals
          Name
        }
        Seller
        Buyer
        Side {
          Currency {
            Symbol
            SmartContract
            Decimals
            Name
          }
          Amount
          AmountInUSD
          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