Skip to content

Add Account Summary Statistics Dashboard #32

Description

@mbatchelor81

Feature Request

Description of Problem:

When I select a trading account, I want to see a high-level summary of the account's trading activity (total trades, settled vs. pending, buy vs. sell volume) displayed prominently on the dashboard, so I can quickly assess the account's status without manually counting rows in the trade blotter.

Currently the stat cards at the top of the dashboard show basic derived values (e.g. tradeRowData.length). There is no dedicated API endpoint that returns aggregated account statistics, even though the backend already has a get_account_portfolio_summary() function in trade_processor.py that computes this data.

Potential Solutions:

  1. Add a new API endpoint GET /account/{account_id}/summary that returns aggregated trade statistics (total trades, trades by state, buy/sell quantities, net quantity)
  2. The endpoint should leverage the existing get_account_portfolio_summary() function in trade_processor.py rather than duplicating query logic
  3. Create a new React hook (GetAccountSummary) to fetch the summary data
  4. Update the stat cards in the Datatable component to display live data from the summary endpoint — replacing the current static/derived values
  5. Data should refresh when the user switches accounts

Acceptance Criteria:

  • New GET /account/{account_id}/summary endpoint returns trade statistics JSON
  • Stat cards on the dashboard show live data: Total Trades, Settled Trades, Pending Trades, Net Quantity
  • Data refreshes when switching accounts
  • Backend test covers the new endpoint
  • Frontend lints and builds cleanly

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions