- Notifications
You must be signed in to change notification settings - Fork386
Description
Describe the bug
A pool exists for EUROC/EURC and USDC on Eth newtwork
https://info.uniswap.org/#/pools/0x95dbb3c7546f22bce375900abfdd64a4e5bd73d6
I can call USDC to ETH but for rate = uniswap.get_price_input on EUROC I get the below error
address used is
"0x1abaea1f7c830bd89acc67ec4af516284b1bc33c"
To Reproduce
from uniswap import Uniswapfrom web3 import Web3# EUROC==> USDCdef rates1(): uniswap = Uniswap( version=2, provider="https://mainnet.infura.io/v3/xxxxx", address=None, private_key=None, ) exchange_fee = Decimal(from_wei(250000 * uniswap.w3.eth.gas_price, 18)) amount = to_wei(1, 6) rate = uniswap.get_price_input( Web3.to_checksum_address( "0x1abaea1f7c830bd89acc67ec4af516284b1bc33c" ), # EUROC Add Web3.to_checksum_address( "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" ), # USDC Add amount, ) rate = Decimal(from_wei(rate, 6)) print("Fee: ", exchange_fee) print("Rate: ", rate)def to_wei(amount, decimal_places): return amount * 10**decimal_placesdef from_wei(amount, decimal_places): return amount / 10**decimal_places ```Steps to reproduce the behavior. Ideally, you can provide a code example demonstrating the issue (including the Uniswap version, tokens/route, and network used).**Expected behavior**expect to get the price**Additional context**Add any other context about the problem here, such as a transaction ID demonstrating the problem.full stack trace is below
0|lightecho | [2023-10-27 09:30:31,775 api.py:458 ERROR] Exception raised by task: <coroutine object as_completed.._wait_for_one at 0x7f60b6712b20>
0|lightecho | Traceback (most recent call last):
0|lightecho | File "/home/lightecho/lightecho/./api/api.py", line 456, in ws_rates
0|lightecho | result = await task
0|lightecho | File "/usr/lib/python3.10/asyncio/tasks.py", line 571, in _wait_for_one
0|lightecho | return f.result() # May raise f.exception().
0|lightecho | File "/home/lightecho/lightecho/./api/api.py", line 167, in cached_rates
0|lightecho | result = await mod.rates(
0|lightecho | File "/home/lightecho/lightecho/api/integrations/uniswap_v3.py", line 118, in rates
0|lightecho | rate = await get_rate(
0|lightecho | File "/home/lightecho/lightecho/api/integrations/uniswap_v3.py", line 165, in get_rate
0|lightecho | rate = uniswap.get_price_input(
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/uniswap/uniswap.py", line 247, in get_price_input
0|lightecho | return self._get_token_token_input_price(token0, token1, qty, fee, route)
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/uniswap/uniswap.py", line 351, in _get_token_token_input_price
0|lightecho | ).call()
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/contract/contract.py", line 305, in call
0|lightecho | return call_contract_function(
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/contract/utils.py", line 96, in call_contract_function
0|lightecho | return_data = w3.eth.call(
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/eth/eth.py", line 256, in call
0|lightecho | return self._durin_call(transaction, block_identifier, state_override)
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/eth/eth.py", line 275, in _durin_call
0|lightecho | return self._call(transaction, block_identifier, state_override)
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/module.py", line 75, in caller
0|lightecho | result = w3.manager.request_blocking(
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/manager.py", line 321, in request_blocking
0|lightecho | return self.formatted_response(
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/manager.py", line 282, in formatted_response
0|lightecho | apply_error_formatters(error_formatters, response)
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/manager.py", line 99, in apply_error_formatters
0|lightecho | formatted_resp = pipe(response, error_formatters)
0|lightecho | File "cytoolz/functoolz.pyx", line 666, in cytoolz.functoolz.pipe
0|lightecho | File "cytoolz/functoolz.pyx", line 641, in cytoolz.functoolz.c_pipe
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/_utils/contract_error_handling.py", line 161, in raise_contract_logic_error_on_revert
0|lightecho | raise ContractLogicError(message, data=data)
0|lightecho | web3.exceptions.ContractLogicError: execution reverted: Unexpected error