diff --git a/fastlane_bot/pool_finder.py b/fastlane_bot/pool_finder.py index 15ff0584f..f61b5c660 100644 --- a/fastlane_bot/pool_finder.py +++ b/fastlane_bot/pool_finder.py @@ -10,6 +10,7 @@ from typing import List, Tuple, Dict, Any +from fastlane_bot.config import Config from fastlane_bot.config.constants import ZERO_ADDRESS, UNISWAP_V2_NAME, UNISWAP_V3_NAME, SOLIDLY_V2_NAME from fastlane_bot.config.multicaller import MultiCaller from fastlane_bot.events.exchanges.base import Exchange @@ -51,7 +52,7 @@ def extract_univ3_fee_tiers(self, pools: List[Dict[str, Any]]): self._uni_v3_fee_tiers[pool["exchange_name"]].add(int(pool["fee"])) - def get_pools_for_unsupported_pairs(self, pools: List[Dict[str, Any]], arb_mode: str): + def get_pools_for_unsupported_pairs(self, config: Config, pools: List[Dict[str, Any]], arb_mode: str): """ Main flow for Poolfinder. @@ -73,6 +74,9 @@ def get_pools_for_unsupported_pairs(self, pools: List[Dict[str, Any]], arb_mode: unsupported_pairs = PoolFinder._find_unsupported_triangles(self._flashloan_tokens, carbon_pairs=carbon_pairs, external_pairs=other_pairs) else: unsupported_pairs = PoolFinder._find_unsupported_pairs(self._flashloan_tokens, carbon_pairs=carbon_pairs, external_pairs=other_pairs) + config.logger.info(f"Searching pools to support the following carbon pairs:") + for pair in unsupported_pairs: + config.logger.info(pair) pairs = [(tkn, token) for pair in unsupported_pairs for tkn in pair for token in self._flashloan_tokens] chunk_size = 400 diff --git a/main.py b/main.py index 13bbfd4d2..15f4b3d05 100644 --- a/main.py +++ b/main.py @@ -531,9 +531,10 @@ def run(mgr, args, tenderly_uri=None) -> None: mgr.solidly_v2_event_mappings = dict( solidly_v2_event_mappings[["address", "exchange"]].values ) + if args.pool_finder_period > 0 and (loop_idx - 1) % args.pool_finder_period == 0: mgr.cfg.logger.info(f"Searching for unsupported Carbon pairs.") - uni_v2, uni_v3, solidly_v2 = pool_finder.get_pools_for_unsupported_pairs(mgr.pool_data, arb_mode=args.arb_mode) + uni_v2, uni_v3, solidly_v2 = pool_finder.get_pools_for_unsupported_pairs(mgr.cfg, mgr.pool_data, arb_mode=args.arb_mode) process_new_events(uni_v2, mgr.uniswap_v2_event_mappings, f"fastlane_bot/data/blockchain_data/{args.blockchain}/uniswap_v2_event_mappings.csv", args.read_only) process_new_events(uni_v3, mgr.uniswap_v3_event_mappings, f"fastlane_bot/data/blockchain_data/{args.blockchain}/uniswap_v3_event_mappings.csv", args.read_only) process_new_events(solidly_v2, mgr.solidly_v2_event_mappings, f"fastlane_bot/data/blockchain_data/{args.blockchain}/solidly_v2_event_mappings.csv", args.read_only)