3

I am trying to return the latest 1000 transactions for a specific pair in Uniswap V2 using The Graph playground.

The pair I am using is for USDC/WETH and its id is: 0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc

The query I wrote is:

query {
  transactions(
    orderBy: timestamp,
    orderDirection: desc,
    first: 1000,
    where: {
     swaps_not: [""],
     mints_not: [""],
     burns_not: [""]
    }
  )
  {
    swaps(where: {
      pair: "0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc"
    }) {
        transaction{
         id
      }
    }
    mints(where: { pair: "0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc"}) {
        transaction{
         id
      }
    }
    burns(where: { pair: "0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc"}) {
        transaction{
         id
      }
    }
  }
}

HOWEVER

It still returns some swaps or mints or burns which are empty and thus without transaction. How to I return only the transactions of swaps/mints/burns which are not empty? enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.