我正在使用来获取实时令牌价格。我正在使用内置函数的所有变化。然而,它并没有给我正确的价值。
address = "0x0000000000000000000000000000000000000000"
private_key = None
uniswap_wrapper = Uniswap(address, private_key,infura_url,version=2)
dai = "0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359"
print(uniswap_wrapper.get_eth_token_input_price(dai, 5*10**18))
print(uniswap_wrapper.get_token_eth_input_price(dai, 5*10**18))
print(uniswap_wrapper.get_eth_token_output_price(dai, 5*10**18))
print(uniswap_wrapper.get_token_eth_output_price(dai, 5*10**18))这是我的研究结果,
609629848330146249678
24997277527023953
25306950626771242
2676124437498249933489我不想使用coingecko或coinmarketcaps,因为它们不会立即列出新发布的令牌价格。
我尝试了以太扫描,以获得象征性的价格,但它没有内置的功能。有没有人对如何解决这个问题有任何建议,或者你知道其他的方法吗?
发布于 2021-03-03 12:58:52
from decimal import Decimal
web3.fromWei(3841357360894980500000001, 'ether')
Decimal('3841357.360894980500000001')https://ethereum.stackexchange.com/questions/92082
复制相似问题