简体   繁体   中英

How to check your wallet's share of the liquidity pool (uniswap or quickswap) using web3

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM