diff --git a/src/dexorder/pools.py b/src/dexorder/pools.py index 02a4cad..812a55c 100644 --- a/src/dexorder/pools.py +++ b/src/dexorder/pools.py @@ -29,15 +29,15 @@ async def get_pool(address: str) -> OldPoolDict: else: if result['base'] == ADDRESS_0 or result['quote'] == ADDRESS_0: log.warning(f'Repairing bad pool {address}') - result = address_metadata[address] = await load_pool(address) + result = address_metadata[address] = await load_pool(address, use_db=False) return result -async def load_pool(address: str) -> OldPoolDict: +async def load_pool(address: str, *, use_db=True) -> OldPoolDict: found = None chain_id = current_chain.get().id # todo other exchanges - if db: + if use_db and db: pool = db.session.get(Pool, (chain_id, address)) if pool is not None: return OldPoolDict(type='Pool', chain=chain_id, address=address, exchange=pool.exchange.value,