Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

How can I query my liquidity position? #83

Open
KhaledYassin opened this issue Sep 23, 2021 · 3 comments
Open

How can I query my liquidity position? #83

KhaledYassin opened this issue Sep 23, 2021 · 3 comments

Comments

@KhaledYassin
Copy link

The Uniswap SDK is not clear about which interface and function to use to query a user's liquidity position such as the one shown by the front-end UI. Attaching a snapshot from the UI showing my liquidity position on the Ropsten network:

Screenshot 2021-09-23 at 17 42 38

@ghost
Copy link

ghost commented May 8, 2022

Hey, Did you figure this out ? Can we query using the graphql endpoint ?

@ernitingarg
Copy link

following..

@Florian-S-A-W
Copy link

Hi @KhaledYassin @liz-george @ernitingarg09

This SDK is not able to query liquidity positions. You can indeed use the V2 and V3 subgraphs for that.
To get all positions for a specific address, just define the user for V2:

{
  liquidityPositions(where: {user: "0x2e0647b90c3823a8c881de287ae2bd400489eea0"}) {
    id
    liquidityTokenBalance
  }
}

and the owner in V3:

{
  positions(where: {owner: "0x50ec05ade8280758e2077fcbc08d878d4aef79c3"}) {
    id
    liquidity
    depositedToken0
    depositedToken1
    token0 {
      name
    }
    token1 {
      name
    }
  }
}

in the where clause.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants