bp

Returns one DEX trade by token on Ethereum, where currency smart contract is <TOKEN> and block time before <BLOCKTIME>, sorted by USD, highest first: smart contract, currency name, trade amount, amount in USD, sum of trade amount in USD, sum of trade side amount in USD, unique of trade buyer and 2 more fields.

By HOD · saved 12 March 2025 · run 4 times · Bitquery API v2

What it returns

Filters

The query

{
  EVM(network: eth, dataset: combined) {
    DEXTradeByTokens(
      where: {Trade: {Currency: {SmartContract: 
        {is: "<TOKEN>"}}}, 
        Block: {Time: {before: "<BLOCKTIME>"}}}
      orderBy: {descendingByField: "usd"}
      limit: {count: 1}
    ) {
      Trade {
        Currency {
          SmartContract
          Name
        }
        Amount(maximum: Block_Number)
        AmountInUSD(maximum: Block_Number)
      }
      usd: sum(of: Trade_AmountInUSD)
      usd2: sum(of: Trade_Side_AmountInUSD)
      buyers: uniq(of: Trade_Buyer)
      sellers: uniq(of: Trade_Sender)
      count
    }
  }
}

Variables

{
  "network": "bsc"
}

Similar queries