You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anyone know why the price input and price output of the exact same coins of the same amount don't match? just trying to understand so I don't make an error in my code. Thanks!
from uniswap import Uniswap
address = None # or None if you're not going to make transactions
private_key = None # or None if you're not going to make transactions
version3 = 3
version2 = 2 # specify which version of Uniswap to use
provider = INFURA_API # can also be set through the environment variable `PROVIDER`
uni3 = Uniswap(address=address, private_key=private_key, version=version3, provider=provider)
uni2 = Uniswap(address=address, private_key=private_key, version=version2, provider=provider)
amount = 1
print(token0id) # USDC
print(token1id) # WETH
print(uni3.get_price_input(token1id, token0id, 10^18)/1000000)
print(uni2.get_price_input(token1id, token0id, 10^18)/1000000)
print(uni3.get_price_output(token0id, token1id, amount)/1000000)
print(uni2.get_price_output(token0id, token1id, amount)/1000000)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Anyone know why the price input and price output of the exact same coins of the same amount don't match? just trying to understand so I don't make an error in my code. Thanks!
print result:
0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
1802.351073
1797.193508
1813.226675
1808.107812
Beta Was this translation helpful? Give feedback.
All reactions