2

How can i check my wallet's share of the uniswap/quickswap liquidity pool using web3py ?

The objective is to check what is my indirect token A and token B position and also if possible the rewards pending for my wallet ? While debank can help, I just want to learn how to query using python directly.

In adding liquidity to the liquidity pool, my wallet sends token A and token B to the smart contract address of the liquidity pool and also interact with the router contract, and my wallet also receives a "uniswap v2 token"

I tried querying my wallet address with the balanceof function of the smart contract address but there was an error ?

TylerH
  • 20,799
  • 66
  • 75
  • 101
Danny D
  • 23
  • 2
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Feb 26 '22 at 08:51

1 Answers1

0

Your share of liquidity pool is:

Your LP token amount / total LP token supply

Here are some library functions Python and Uniswap v2 for working with DeFi. You can use fetch_erc20_details to get the total supply of LP token or a pair contract.

Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435