Is it possible to get the price of a pair using graphql for uniswap without knowing its id?

I use this website to try things out: https://thegraph.com/explorer/subgraph/uniswap/uniswap-v2
For example, this query allows me to get 5 pairs and their ids and symbols:

  pairs(first: 5) {
    token0 {
    token1 {

But what if i only have the symbol and want to get the id?

symbol: ETH / WBTC
id: ??

What query do i have to send?

  • 1
    Probably not possible. The symbol is freely chosen when a token is created, so multiple tokens have the same symbol and there is no way to know which one is which by just looking at the symbols Commented Feb 4, 2021 at 11:28
  • Ok thanks, if you write this as an answer i would mark it as correct answer
    – Alexanus
    Commented Feb 4, 2021 at 11:39
  • Well, I don't know if they provide such functionality or not. Anyway, added an answer, but it's not a definitive one. Commented Feb 4, 2021 at 11:59

1 Answer 1


Token symbols are arbitrary strings. They can be chosen freely by the token creator, so multiple tokens may have the same symbols.

Therefore it does not make much sense to search by token symbol. It is also impossible to know which token is which just by looking at the symbols.

Token address is the global unique identifier - never trust anything else.

So even if there was functionality to search by symbol it would only be of limited use.

Your Answer

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

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