简体   繁体   English

如何使用 web3 检查你的钱包在流动性池中的份额(uniswap 或 quickswap)

[英]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 ?如何使用 web3py 检查我的钱包在 uniswap/quickswap 流动性池中的份额?

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 ?目的是检查我的间接代币 A 和代币 B 的位置,以及如果可能的话,我的钱包的奖励是什么? While debank can help, I just want to learn how to query using python directly.虽然 debank 可以提供帮助,但我只想学习如何直接使用 python 进行查询。

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"在向流动性池添加流动性时,我的钱包将代币 A 和代币 B 发送到流动性池的智能合约地址并与路由器合约进行交互,我的钱包也收到了“uniswap v2 代币”

I tried querying my wallet address with the balanceof function of the smart contract address but there was an error ?我尝试使用智能合约地址的 balanceof 功能查询我的钱包地址,但出现错误?

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 .以下是一些用于处理 DeFi 的库函数 Python 和 Uniswap v2 You can use fetch_erc20_details to get the total supply of LP token or a pair contract.您可以使用fetch_erc20_details获取 LP 代币或配对合约的总供应量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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