I'm trying to compute the balance of a lp address given the address of the token. So I have this function:
web3 = Web3(Web3.HTTPProvider("https://bsc-dataseed.binance.org/"))
def CheckLiquidity(TokenAddress, web3):
LPAddress = GetLiquidityAddress(TokenAddress) #returns the web3.toChecksumAddress()
balance = web3.eth.get_balance(LPAddress)
bnbBalance = web3.fromWei(balance, 'ether)
Only problem that this returns me 0... for every contract I tried. I also manually checked on bsc scan the wbnb balance in the pool and is not 0. Can someone help me please?