diff --git a/y/prices/dex/uniswap/v3.py b/y/prices/dex/uniswap/v3.py index 59bec0e24..b478aba1b 100644 --- a/y/prices/dex/uniswap/v3.py +++ b/y/prices/dex/uniswap/v3.py @@ -134,16 +134,14 @@ async def get_price( # TODO make this properly async after extending for brownie ContractTx results = await fetch_multicall( - *[ - [quoter, 'quoteExactInput', self._encode_path(path), amount_in] - for path in paths - ], + *[[quoter, 'quoteExactInput', self._encode_path(path), amount_in] for path in paths], block=block, sync=False ) + # Quoter v2 uses this weird return struct, we must unpack it to get amount out. outputs = [ - amount / self._undo_fees(path) / 1e6 + (amount if isinstance(amount, int) else amount[0]) / self._undo_fees(path) / 1e6 for amount, path in zip(results, paths) if amount ]