diff --git a/src/price_providers/price_feed.py b/src/price_providers/price_feed.py index 342ee28..afed5ee 100644 --- a/src/price_providers/price_feed.py +++ b/src/price_providers/price_feed.py @@ -8,12 +8,15 @@ class PriceFeed: """Class encapsulating the different price providers.""" - def __init__(self): - self.providers = [ - CoingeckoPriceProvider(), - MoralisPriceProvider(), - AuctionPriceProvider(), - ] + def __init__(self, activate: bool): + if activate: + self.providers = [ + CoingeckoPriceProvider(), + MoralisPriceProvider(), + AuctionPriceProvider(), + ] + else: + self.providers = [] def get_price(self, price_params: dict) -> tuple[float, str] | None: """Function iterates over list of price provider objects and attempts to get a price.""" diff --git a/src/transaction_processor.py b/src/transaction_processor.py index 7b879f4..6ffe120 100644 --- a/src/transaction_processor.py +++ b/src/transaction_processor.py @@ -30,7 +30,7 @@ def __init__( self.process_prices = process_prices self.imbalances = RawTokenImbalances(self.blockchain_data.web3, self.chain_name) - self.price_providers = PriceFeed() + self.price_providers = PriceFeed(activate=process_prices) self.log_message: list[str] = [] def get_start_block(self) -> int: