ohlc-of-pool

Returns the latest 10 DEX trades by token, where trade buyer is 0xc555…fd46, currency smart contract is 0xc02a…6cc2 and side currency smart contract is 0xdac1…1ec7: block date, sum of trade amount, trade price, currency name, protocol name, smart contract, side currency name and 3 more fields.

By Kshitij Mahajan · saved 17 August 2024 · run 2 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery {
  EVM(dataset: archive) {
    DEXTradeByTokens(
      orderBy: {descendingByField: "Block_datefield"}
      where: {Trade: {Buyer: {is: "0xc555d55279023e732ccd32d812114caf5838fd46"}, Currency: {SmartContract: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}}, Side: {Currency: {SmartContract: {is: "0xdac17f958d2ee523a2206206994597c13d831ec7"}}}, Dex: {SmartContract: {is: "0x4e68ccd3e89f51c3074ca5072bbac773960dfa36"}}}}
      limit: {count: 10}
    ) {
      Block {
        datefield: Date(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)
        Currency {
          Name
        }
        Dex {
          ProtocolName
          SmartContract
        }
        Side {
          Currency {
            Name
            SmartContract
          }
        }
        poolAddress: Buyer
      }
      count
    }
  }
}

Similar queries