Skip to content

Commit

Permalink
fix: uni v3 deploy block check on Base (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Sep 25, 2023
1 parent 6890c16 commit b2481ab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions y/prices/dex/uniswap/v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ async def get_price(
block: Optional[Block] = None,
ignore_pools: Tuple[Pool, ...] = (),
) -> Optional[UsdPrice]:
if block and block < await contract_creation_block_async(UNISWAP_V3_QUOTER, True):

quoter = await self.__quoter__(sync=False)
if block and block < await contract_creation_block_async(quoter, True):
return None

paths = [[token, fee, usdc.address] for fee in self.fee_tiers]
Expand All @@ -128,7 +130,7 @@ async def get_price(
[token, fee, weth.address, self.fee_tiers[0], usdc.address] for fee in self.fee_tiers
]

quoter, amount_in = await asyncio.gather(self.__quoter__(sync=False), ERC20(token, asynchronous=True).scale)
amount_in = await ERC20(token, asynchronous=True).scale

# TODO make this properly async after extending for brownie ContractTx
results = await fetch_multicall(
Expand Down

0 comments on commit b2481ab

Please sign in to comment.