-
Notifications
You must be signed in to change notification settings - Fork 146
Open
Description
Guideline
- Carefully read the issue description before applying to ensure you have all the necessary information to start working on it.
- Write a brief description of how you will approach the task (without using ChatGPT).
- Add your Telegram handler in your application (e.g., in OnlyDust or similar)
- Write ETA in your application
What should I do if I have a problem
- Try to google it before asking. Googling is taking major part of dev work
- If you couldn't find answer your question with Google, text your question to dev group with your question.
- Do not send DM to maintainer, it would be better and faster to ask other contributors in chat
How to prepare PR
- Check if your code smell good
- Add close # to link your issue with your PR
- Do not commit changes which is not related to your task
- Check after you created PR, if you committed everything.
Task description
- Search for
def compute_liquidable_debt_at_price - Also explore
apps/dashboard_app/helpers/tools.py
data["liquidable_debt"] = data["collateral_token_price"].apply(
lambda x: state.compute_liquidable_debt_at_price(
prices=prices,
collateral_token_underlying_address=collateral_token_underlying_address,
collateral_token_price=x,
debt_token_underlying_address=debt_token_underlying_address,
)
)- This function runs for a long time (about 20s) and blocks the streamlit app. The task is to move this computation to the
data_handler - The
data_handlermust continuously compute the results and store them in Redis. Thedashboard_app(streamlit) must only read the results from Redis and display them. - To understand the logic, explore this
apps/shared/redis_client.pyand usages. - Since the
dashboard_appand the datahandler_appmay run separately, run thedata_handlerthen create a snapshot of the computation results, and fill them in the test environment in thedashboard_app(for example, search fordef streamlit_dev_fill_with_test_data():)
PS:
In apps/dashboard_app/dashboard.py change:
REFRESH_TIME = ONE_MINUTE_IN_MILISECONDS * int(CRONTAB_TIME)
to
REFRESH_TIME = ONE_MINUTE_IN_MILISECONDS * int(CRONTAB_TIME)*10
To avoid frequent auto-refresh
Metadata
Metadata
Assignees
Labels
No labels