From 976129a73eb9a2ceda45c718761f32fe76fd0723 Mon Sep 17 00:00:00 2001 From: djeck1432 Date: Mon, 18 Nov 2024 22:25:04 +0100 Subject: [PATCH] add comments --- apps/dashboard_app/helpers/tools.py | 4 ++-- apps/data_handler/handlers/loan_states/zklend/utils.py | 1 + apps/legacy_app/update_data.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/dashboard_app/helpers/tools.py b/apps/dashboard_app/helpers/tools.py index e576fc69..6afcd13c 100644 --- a/apps/dashboard_app/helpers/tools.py +++ b/apps/dashboard_app/helpers/tools.py @@ -6,14 +6,14 @@ import pandas as pd import requests from google.cloud.storage import Client +from shared.blockchain_call import func_call +from shared.types import TokenParameters from starknet_py.cairo.felt import decode_shortstring from dashboard_app.helpers.settings import ( PAIRS, UNDERLYING_SYMBOLS_TO_UNDERLYING_ADDRESSES, ) -from shared.blockchain_call import func_call -from shared.types import TokenParameters GS_BUCKET_NAME = "derisk-persistent-state/v3" diff --git a/apps/data_handler/handlers/loan_states/zklend/utils.py b/apps/data_handler/handlers/loan_states/zklend/utils.py index 357a47cf..943b24d8 100644 --- a/apps/data_handler/handlers/loan_states/zklend/utils.py +++ b/apps/data_handler/handlers/loan_states/zklend/utils.py @@ -65,6 +65,7 @@ def _set_loan_state_per_user(self, loan_state: ZkLendCollateralDebt) -> None: :param loan_state: The loan state data. """ + # FIXME fetch only result enabled/disabled for the user user_loan_state = self.zklend_state.loan_entities[loan_state.user_id] user_loan_state.collateral_enabled.values = loan_state.collateral_enabled user_loan_state.collateral.values = self._convert_float_to_decimal(loan_state.collateral) diff --git a/apps/legacy_app/update_data.py b/apps/legacy_app/update_data.py index e1d7b6bd..151d5b0e 100644 --- a/apps/legacy_app/update_data.py +++ b/apps/legacy_app/update_data.py @@ -71,7 +71,7 @@ def update_data(zklend_state: src.zklend.ZkLendState): # asyncio.run(hashstack_v0_state.collect_token_parameters()) # asyncio.run(hashstack_v1_state.collect_token_parameters()) logging.info(f"collected token parameters in {time.time() - t2}s") - + # TODO move it to separated function # Get prices of the underlying tokens. t_prices = time.time() states = [ @@ -103,7 +103,7 @@ def update_data(zklend_state: src.zklend.ZkLendState): ) prices = src.helpers.get_prices(token_decimals=underlying_addresses_to_decimals) logging.info(f"prices in {time.time() - t_prices}s") - + # TODO: move it to separated function END t_swap = time.time() swap_amms = src.swap_amm.SwapAmm() asyncio.run(swap_amms.init())