Latest OHLC info

Streams the latest 10 DEX trades by token on Polygon as they happen, where currency smart contract is 0x0d50…1270, side currency smart contract is 0xc213…8e8F and DEX smart contract is 0x9B08…d8B7: block date, sum of trade amount, trade price, currency name, protocol name, smart contract, side currency name and 2 more fields.

By Akshat · saved 11 April 2024 · run 3 times · Bitquery API v2

What it returns

Filters

The subscription

subscription {
  EVM(network: matic) {
    DEXTradeByTokens(
      orderBy: {descending: Block_Date}
      where: {Trade: {Currency: {SmartContract: {is: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"}}, Side: {Currency: {SmartContract: {is: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F"}}}, Dex: {SmartContract: {is: "0x9B08288C3Be4F62bbf8d1C20Ac9C5e6f9467d8B7"}}}}
      limit: {count: 10}
    ) {
      Block {
        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
          }
        }
      }
      count
    }
  }
}

Similar queries