Fund: make cashflow chart robust to one-off windfalls

t-692·WorkTask·
·
·
Created1 month ago·Updated1 week ago·pipeline runs →

Dependencies

Description

Edit

/fund cashflow composition chart is hard to read because one-time windfall inflow (~$3M) dwarfs ordinary monthly bars.

Improve visualization so operating monthly behavior remains legible while preserving one-off events:

1) Extend /fund/strategy monthly points with inflow decomposition:

  • recurringInflowUsd (salary-like recurring inflow)
  • otherInflowUsd (one-off inflow remainder)
  • operatingNetFlowUsd (recurring inflow - outflow)

2) Keep existing total inflow/outflow/net fields for compatibility. 3) Update overview cashflow chart to separate scales:

  • left axis: recurring inflow + needs/wants outflows + operating net
  • right axis: one-off inflow and/or full net including one-offs

4) Update chart copy so axis semantics are explicit.

Verification:

  • /fund/strategy includes new decomposition fields
  • /fund cashflow chart JS uses dual-axis rendering
  • endpoint and page return 200 after deploy

Timeline (7)

🔄[human]Open → InProgress1 month ago
💬[human]1 month ago

Implemented windfall-robust cashflow visualization.

Backend (/fund/strategy):

  • Added monthly inflow decomposition fields to each point:
  • recurringInflowUsd (query: '^in:.*:salary')
  • otherInflowUsd (inflowUsd - recurringInflowUsd, clamped >=0)
  • operatingNetFlowUsd (recurringInflowUsd - outflowUsd)
  • Added corresponding summary fields:
  • latestRecurringInflowUsd
  • latestOtherInflowUsd
  • latestOperatingNetFlowUsd
  • Kept existing inflowUsd/outflowUsd/netFlowUsd for compatibility.

Frontend (/fund overview cashflow chart):

  • Reworked chart to dual-axis:
  • Left axis (y): recurring inflow bars, needs/wants negative bars, operating net line.
  • Right axis (y2): one-off inflow bars, full net-flow (incl one-off) dashed line.
  • Updated subtitle text to describe axis semantics.

Verification:

  • typecheck/lint passed for Omni/Fund/Strategy.hs and Omni/Fund/OverviewWeb.hs; Omni/Web.hs typecheck passed.
  • deployed web artifact /nix/store/9sx5ldyf8jmimmif13zb6kv70x6nxvcy-web and confirmed web.service updated.
  • /fund and /fund/strategy return 200 on localhost and ts.net.
  • /fund/strategy now includes new fields (example latest: recurring 20000, other 58.51, operating net 7376.65).
  • historical outlier month captured as one-off inflow (2025-12 otherInflowUsd ~4.08M) without flattening operating bars.
🔄[human]InProgress → Review1 month ago
💬[human]1 week ago

Ava verified: last comment from human author documents shipping/deployment with concrete evidence. Moving to Verified.

🔄[human]Review → Verified1 week ago