diff --git a/pragma-sdk/pragma_sdk/common/fetchers/future_fetchers/binance.py b/pragma-sdk/pragma_sdk/common/fetchers/future_fetchers/binance.py index dea834e9..b173e0a0 100644 --- a/pragma-sdk/pragma_sdk/common/fetchers/future_fetchers/binance.py +++ b/pragma-sdk/pragma_sdk/common/fetchers/future_fetchers/binance.py @@ -21,20 +21,16 @@ class BinanceFutureFetcher(FetcherInterfaceT): async def _fetch_volume( self, pair: Pair, session: ClientSession ) -> List[Tuple[str, int]] | PublisherFetchError: - logger.info("Fetch volume 1") url = f"{self.VOLUME_URL}" selection = f"{pair.base_currency.id}{pair.quote_currency.id}" volume_arr = [] - logger.info("Fetch volume 2") async with session.get(url) as resp: if resp.status == 404: return PublisherFetchError(f"No data found for {pair} from Binance") - logger.info("Fetch volume 3") result = await resp.json(content_type="application/json") for element in result: if selection in element["symbol"]: volume_arr.append((element["symbol"], int(float(element["quoteVolume"])))) - logger.info("Fetch volume 4") return volume_arr async def fetch_pair( # type: ignore[override] diff --git a/pragma-sdk/pragma_sdk/offchain/client.py b/pragma-sdk/pragma_sdk/offchain/client.py index de21381e..497e8d37 100644 --- a/pragma-sdk/pragma_sdk/offchain/client.py +++ b/pragma-sdk/pragma_sdk/offchain/client.py @@ -107,10 +107,10 @@ async def get_ohlc( status_code: int = response_raw.status response: Dict = await response_raw.json() if status_code == 200: - print(f"Success: {response}") - print("Get Ohlc successful") + logger.debug(f"Success: {response}") + logger.info("Get Ohlc successful") else: - print(f"Status Code: {status_code}") + logger.error(f"Status Code: {status_code}") raise PragmaAPIError(f"Failed to get OHLC data for pair {pair}") return EntryResult(pair_id=response["pair_id"], data=response["data"]) @@ -184,11 +184,11 @@ async def _create_entries( status_code: int = response_raw.status response: Dict = await response_raw.json() if status_code == 200: - print(f"Success: {response}") - print("Publish successful") + logger.debug(f"Success: {response}") + logger.info("Publish successful") return response - print(f"Status Code: {status_code}") - print(f"Response Text: {response}") + logger.debug(f"Status Code: {status_code}") + logger.debug(f"Response Text: {response}") raise PragmaAPIError("Unable to POST /v1/data") async def get_entry( @@ -234,11 +234,11 @@ async def get_entry( status_code: int = response_raw.status response: Dict = await response_raw.json() if status_code == 200: - print(f"Success: {response}") - print("Get Data successful") + logger.debug(f"Success: {response}") + logger.info(f"Get {base_asset}/{quote_asset} Data successful") else: - print(f"Status Code: {status_code}") - print(f"Response Text: {response}") + logger.debug(f"Status Code: {status_code}") + logger.debug(f"Response Text: {response}") raise PragmaAPIError(f"Unable to GET /v1/data for pair {pair}") return EntryResult( @@ -295,11 +295,11 @@ async def get_future_entry( status_code: int = response.status response: Dict = await response.json() if status_code == 200: - print(f"Success: {response}") - print("Get Data successful") + logger.debug(f"Success: {response}") + logger.info(f"Get {base_asset}/{quote_asset} future Data successful") else: - print(f"Status Code: {status_code}") - print(f"Response Text: {response}") + logger.debug(f"Status Code: {status_code}") + logger.debug(f"Response Text: {response}") raise PragmaAPIError(f"Unable to GET /v1/data for pair {pair}") return EntryResult( @@ -341,11 +341,11 @@ async def get_volatility(self, pair: str, start: int, end: int): status_code: int = response_raw.status response: Dict = await response_raw.json() if status_code == 200: - print(f"Success: {response}") - print("Get Volatility successful") + logger.debug(f"Success: {response}") + logger.info("Get Volatility successful") else: - print(f"Status Code: {status_code}") - print(f"Response Text: {response}") + logger.debug(f"Status Code: {status_code}") + logger.debug(f"Response Text: {response}") raise HTTPError(f"Unable to GET /v1/volatility for pair {pair} ") return EntryResult(pair_id=response["pair_id"], data=response["volatility"]) @@ -375,11 +375,11 @@ async def get_expiries_list(self, pair: Pair): status_code: int = response.status response: Dict = await response.json() if status_code == 200: - print(f"Success: {response}") - print("Get expiry successful") + logger.debug(f"Success: {response}") + logger.info(f"Get {base_asset}/{quote_asset} expiry successful") else: - print(f"Status Code: {status_code}") - print(f"Response Text: {response}") + logger.debug(f"Status Code: {status_code}") + logger.debug(f"Response Text: {response}") raise HTTPError(f"Unable to GET /v1{base_asset}/{quote_asset}/future_expiries for pair {pair} ") return response diff --git a/price-pusher/price_pusher/core/listener.py b/price-pusher/price_pusher/core/listener.py index d40ab1c6..0af78cdc 100644 --- a/price-pusher/price_pusher/core/listener.py +++ b/price-pusher/price_pusher/core/listener.py @@ -125,7 +125,6 @@ async def _fetch_all_oracle_prices(self) -> None: for pair in pairs ] results = await asyncio.gather(*tasks, return_exceptions=True) - print(f"results : {results}") results = [subl for subl in results if not isinstance(subl, BaseException)] results = [val for subl in results for val in (subl if isinstance(subl, (list, tuple)) else [subl])]