unite

Returns the latest 90 DEX trades by token and token holders, where side currency smart contract is 0xdAC1…1ec7, currency smart contract is 0xaaeE…1C7a and balance amount is at least 0: block time, sum of trade amount, trade price, count and median of balance amount.

By Miroshnichenko Vlad · saved 21 August 2024 · run 4 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery {
EVM(dataset: archive) {
    DEXTradeByTokens(
      orderBy: {descendingByField: "Block_Time"}
      where: {Trade: {Side: {Currency: {SmartContract: {is: "0xdAC17F958D2ee523a2206206994597C13D831ec7"}}},
      Currency: {SmartContract: {is:  "0xaaeE1A9723aaDB7afA2810263653A34bA2C21C7a"}}}}
      limit: {count: 90}
    ) {
      Block {
        Time(interval: {in: days, count: 1})
      }
      volume: sum(of: Trade_Amount)
      Trade {
        high: Price(maximum: Trade_Price)
        low: Price(minimum: Trade_Price)
        open: Price(minimum: Block_Number)
        close: Price(maximum: Block_Number)
      }
      count
    }
    TokenHolders(
      date: "2024-06-20"
      tokenSmartContract: "0xaaeE1A9723aaDB7afA2810263653A34bA2C21C7a"
      where: { Balance: { Amount: { ge: "0" } } }
    ) {
      median(of: Balance_Amount)
    }
  }
  
}

Similar queries