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
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
version = 2 # specify which version of Uniswap to use
provider = "https://andromeda.metis.io/?owner=1088" # can also be set through the environment variable PROVIDER
uniswap = Uniswap(address=address, private_key=private_key, version=version, provider=provider)`
Thanks, got rid of this error. But now I have new ones
These are the contracts:
UniswapV3Factory: 0xf5fd18Cd5325904cC7141cB9Daca1F2F964B9927
UniversalRouter 0x749E46034618c6Cbf64938b8DE10092523228235
Permit2: 0x2EE5407017B878774b58c34A8c09CAcC94aDd69B
SwapRouter02: 0x07Da720AD5E434971dbe77C7fC85b7b44d5aC704
QuoterV2: 0x2db8b665CE6928F9D1a7f83F4C6aCEA64Af6a6f6
I added the chainId 1088 to the constants.py _netid_to_name dict.
This solved the error: Exception: Unknown netid: 1088
When I try to call the get_price_input(token1, token2, amount) method I get web3.exceptions.BadFunctionCallOutput: Could not transact with/call contract function, is contract deployed correctly and chain synced?
The get_price_input() uses the _get_token_token_input_price(token0, token1, qty, fee, route) which for my usecase (no routes set, no fee set->default 3000, uniswap version 3) calls :
self.quoter uses the quoter_addr "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6" which does not exist on Metis.
I switched it with QuoterV2 from aboves list, but now I get web3.exceptions.ContractLogicError: execution reverted
Just replace it with a Metis address. Feel free to create PR which fixes mentioned hardcoding - it would be strongly appreciated. Check, as well, if a proper pool (token0, token1, fee) is deployed/has liquidity there.
Activity
liquid-8 commentedon May 13, 2023
Check
constants.pyit has quite a straightforward syntax. Not sure if Uniswap or its fork was deployed there though.1220moritz commentedon May 13, 2023
Thanks, got rid of this error. But now I have new ones
These are the contracts:
UniswapV3Factory: 0xf5fd18Cd5325904cC7141cB9Daca1F2F964B9927
UniversalRouter 0x749E46034618c6Cbf64938b8DE10092523228235
Permit2: 0x2EE5407017B878774b58c34A8c09CAcC94aDd69B
SwapRouter02: 0x07Da720AD5E434971dbe77C7fC85b7b44d5aC704
QuoterV2: 0x2db8b665CE6928F9D1a7f83F4C6aCEA64Af6a6f6
I added the chainId 1088 to the constants.py _netid_to_name dict.
This solved the error:
Exception: Unknown netid: 1088When I try to call the get_price_input(token1, token2, amount) method I get
web3.exceptions.BadFunctionCallOutput: Could not transact with/call contract function, is contract deployed correctly and chain synced?The get_price_input() uses the _get_token_token_input_price(token0, token1, qty, fee, route) which for my usecase (no routes set, no fee set->default 3000, uniswap version 3) calls :
self.quoter uses the quoter_addr "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6" which does not exist on Metis.
I switched it with QuoterV2 from aboves list, but now I get
web3.exceptions.ContractLogicError: execution revertedliquid-8 commentedon May 13, 2023
The quoter contract address is hardcoded here:
https://github.com/uniswap-python/uniswap-python/blob/47ae05d24622d5565fb938b5fb7c3959c07973ab/uniswap/uniswap.py#L178
Just replace it with a Metis address. Feel free to create PR which fixes mentioned hardcoding - it would be strongly appreciated. Check, as well, if a proper pool (token0, token1, fee) is deployed/has liquidity there.