2

Through the subgraph, preferably, is there a way to get a list of pools with only one token symbol provided?

My workaround so far is a bit tedious: Get id for a given token Perform an OR search in Pools, if the token ID is token0 or token1 - store these in an array

My next step is to search matching pools in say Sushiswap or another exchange then store any matching pools in a separate array/collection.

So my first question is if there is a better way to find matching v3 pools?

Secondly, looking for suggestions on creating a matched filtered list.

1 Answer 1

1

With the Uniswap v3 subgraph:

{
    tokens(where:{symbol:"DAI"}) {
    name
    id
    whitelistPools {
      id
      token0 {
        id
        symbol
      }
      token1 {
        id
        symbol
      }
    }
  }
}

The key here, is whitelistPools:

{
  "data": {
    "tokens": [
      {
        "id": "0x6b175474e89094c44da98b954eedeac495271d0f",
        "name": "Dai Stablecoin",
        "whitelistPools": [
          {
            "id": "0x063332bbf9f8385e4106919b5c6ae2e6a4f72228",
            "token0": {
              "id": "0x111111111117dc0aa78b770fa6a738034120c302",
              "symbol": "1INCH"
            },
            "token1": {
              "id": "0x6b175474e89094c44da98b954eedeac495271d0f",
              "symbol": "DAI"
            }
          },
          {
            "id": "0x091c0158ab410bd73ca1541409d5a22e90146a04",
            "token0": {
              "id": "0x514910771af9ca656af840dff83e8264ecf986ca",
              "symbol": "LINK"
            },
            "token1": {
              "id": "0x6b175474e89094c44da98b954eedeac495271d0f",
              "symbol": "DAI"
            }
          },...

I am disappointed that that asking this on the Uniswap #dev-chat Discord channel rendered no responses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.