forked from hummingbot/deploy
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description
The portfolio overview page is failing with a KeyError: "value" when trying to calculate the total balance. The error occurs in the portfolio_overview function when attempting to access the "value" column from the portfolio DataFrame.
Steps to Reproduce
- Navigate to the portfolio overview page
- Apply any filter combination
- The error occurs when trying to calculate and display the total balance
Error Log
File "/home/dashboard/frontend/pages/orchestration/portfolio/app.py", line 190, in portfolio_overview
total_balance_usd = round(portfolio_df["value"].sum(), 2)
~~~~~~~~~~~~^
KeyError: "value"
Expected Behavior
The portfolio overview should display the total balance by summing up the "value" column from the portfolio data.
Possible Causes
- The
filtered_portfolio_statemight not have the expected structure - The token information dictionaries might be missing the "value" key
- The
portfolio_state_to_dffunction might not be creating the DataFrame with the expected columns
Additional Context
- The error occurs in
pages/orchestration/portfolio/app.py - The
portfolio_state_to_dffunction is responsible for creating the DataFrame - Debugging output has been added to help diagnose the issue
Proposed Solution
- Add proper error handling for missing "value" key
- Validate the input data structure
- Provide meaningful error messages when required data is missing
Environment
- File:
/pages/orchestration/portfolio/app.py - Function:
portfolio_overview() - Line: ~190
Next Steps
- Add validation for input data structure
- Add error handling for missing "value" key
- Add unit tests to catch similar issues
Metadata
Metadata
Assignees
Labels
No labels