exchangeName in dexTrades subscription

voices
Tue, 03 Oct 2023 17:53:49 +0000
GraphQL API

Hey,

I’m looking to create a DEXTrades subscription that’ll get a bunch of objects based on the exchangeName - here’s the query I’m looking to recreate as subscription:

{
  ethereum(network: ethereum) {
    dexTrades(
      options: {desc: ["block.height", "tradeIndex"], limit: 1}
      exchangeName: {in: ["Uniswap"]}
      baseCurrency: {is: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"}
      quoteCurrency: {is: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"}
      date: {after: "2023-04-28"}
    ) {
      transaction {
        hash
      }
      tradeIndex
      smartContract {
        address {
          address
        }
        contractType
        currency {
          name
        }
      }
      tradeIndex
      date {
        date
      }
      block {
        height
      }
      buyAmount
      buyAmountInUsd: buyAmount(in: USD)
      buyCurrency {
        symbol
        address
      }
      sellAmount
      sellAmountInUsd: sellAmount(in: USD)
      sellCurrency {
        symbol
        address
      }
      sellAmountInUsd: sellAmount(in: USD)
      tradeAmount(in: USD)
      transaction {
        gasValue
        gasPrice
        gas
      }
    }
  }
}

unfortunately in subscription it’s not possible to filter by exchangeName. is there any other way of getting the subscription equivalent from the above query?

2 posts - 2 participants