Spaces:
Sleeping
Sleeping
Commit History
-
Fix breakeven: use actual GP report values, remove all fabricated estimatesβ
All breakeven income numbers now come directly from gp_report.get_summary_metrics(): - Conservative = actual total_management_fees + actual setup_fee_payback - Full = actual total_gp_income (mgmt + DB + setup + success fee) For sensitivity across hypothetical fund sizes, actual values are scaled proportionally. No made-up formulas remain in the live code path. Replaced functions: - estimate_gp_income_conservative β get_conservative_income_from_gp_metrics - estimate_gp_income_full β get_full_income_from_gp_metrics - Breakeven solvers now take gp_metrics dict + actual overhead π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>0232117 -
Fix: use actual model-computed success fee instead of made-up estimateβ
The full breakeven scenario now uses the actual success fee calculated by gp_report.calculate_success_fee() (waterfall distribution), not a fabricated formula. For sensitivity across different fund sizes, the actual success fee is scaled proportionally. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1384429 -
Add two-scenario breakeven analysis: conservative + fullβ
Restructure Break-Even tab into two scenarios: - Conservative: management fees + setup fee payback only (worst case, no maturities) - Full: management fees + DB participation + estimated success fees Each scenario gets its own sensitivity table, chart, and breakeven solver. Combined comparison chart shows both income lines vs GP costs. EN + HE translation keys added for all new UI elements. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>2bccf99 -
Fix breakeven chart: use consistent income/cost estimates throughoutβ
The breakeven table was mixing two different income calculations: - Breakeven size from the solver (using rough DB income estimate) - GP Income from the actual model simulation (using real policy data) This made the numbers contradictory β e.g. showing breakeven at $13.9M while income ($2M) already far exceeded costs ($753K). Refactored into shared estimate_gp_income() and estimate_gp_overhead_total() functions used by the breakeven solver, per-fund table, combined view, and sensitivity chart. All numbers now use the same formulas and are internally consistent. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>77351b4 -
Fix HF Space freezing: add result caching and optimize hot loopsβ
- Add internal caching to LPReport/GPReport (get_summary_metrics, get_monthly_cash_flows, get_annual_summary compute once per instance) - Pre-compute expensive results at Run Analysis time and store in session state to avoid recomputation on every Streamlit rerun - Replace .iterrows() with direct numpy array access in GP distribution calculation loops (~100x faster) - Add try/except around scipy breakeven calculations to prevent crashes - Add traceback import at module level π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>a07f944
-
Add Excel export buttons to remaining GP View tablesβ
- GP Annual Summary table - GP Cash Shortfall table (both shortfall and no-shortfall cases) - GP Monthly Cash Flows table - Consolidated GP View tables (monthly and totals) All major data tables now have Excel download buttons instead of relying on Streamlit's built-in CSV export. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>48fa52c -
Fix AttributeError: use selected_policies instead of policiesβ
Fund class has selected_policies attribute, not policies π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>94086ae -
Change GP ownership percentage from slider to number inputβ
- Replaced slider with number input for more precise control - Allows direct typing of percentage values - Step size 0.1% for fine-grained adjustments π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>5b1059f -
Add configurable GP distribution threshold in sidebarβ
- Added number input in sidebar to set GP distribution threshold (default $300K) - Replaced all hardcoded 300_000 threshold values with session state value - Users can now choose any threshold from $0 to $1M in $50K increments - Distributions occur when GP balance exceeds threshold, distributing excess only π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>94837f5 -
Add Excel download buttons to GP Investor tables and fix Operating Costs chartβ
- Added Excel download buttons to GP Investor views (Tab 5 and Tab 11) that were missing proper export functionality - Fixed Monthly Operating Costs chart that was showing empty due to zero values when actual_opex wasn't available - Chart now estimates policy servicing costs based on policy count when fund cash flow data is unavailable π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>201c262
-
Remove debug output after fixing worst case logicβ
- Verified 10/10 test cases pass - Worst case always shows equal or more shortfall than normal mode - Fixed sync issue with Hugging Face (was pushing to GitHub only) π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>e70bd9d -
Add debug output to diagnose worst case issue
08702ea -
Add debug output to GP shortfall calculation
ede1ee1 -
Fix Toggle 3 (Fee on Deployed Capital) calculationβ
The deployed capital toggle was incorrectly using sum(policy_cost Γ survival) instead of the correct formula: fee_base - sum(policy_cost Γ mortality) Correct behavior: - Toggle 1 (Committed/Called): Determines fee_base - Toggle 3 (Deployed): Subtracts capital "returned" via maturities - Deployed = fee_base - sum(policy_cost Γ mortality_probability) - Where fee_base is committed or called capital (per Toggle 1) In worst case mode (no maturities): - mortality = 0, so deployed = fee_base (no subtraction) - Management fees are on full committed/called capital π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>c88cc8c -
Fix worst case mgmt fee calculation to use actual policy costsβ
When deployed capital toggle is ON and worst case mode is enabled, management fees are now calculated based on actual policy costs (NAV + onboarding + cumulative premiums) instead of committed capital. This ensures the worst case scenario properly reflects higher fees when all policies survive (100% survival = all capital stays deployed). π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>80e7bec -
Show cash position table regardless of shortfall + fix worst case mgmt feesβ
1. Consolidated GP cash shortfall now always shows the cumulative cash position and cash reserve table, even when there is no shortfall 2. When "Worst Case Scenario" is toggled ON and "Fee on Deployed Capital Only" is also ON, management fees are now calculated on FULL capital (since survival = 100% means all capital stays deployed) π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1982644
-
Add missing scenario variable in quarterly capital calls functionβ
π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>6c6b1c9 -
Fix Policy attribute names in deployed capital calculationβ
- policy.purchase_price β policy.nav (acquisition cost) - policy.onboarding_fee β policy.total_onboarding π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>af17986 -
Include cumulative premiums in deployed capital calculationβ
Deployed capital now includes: - Purchase price - Onboarding fee - Cumulative gross premiums paid up to the fee payment month Formula: deployed = Ξ£ (purchase + onboarding + cumulative_premiums) Γ survival_prob π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>abdc572 -
Fix deployed capital calculation for management fee toggleβ
Deployed capital is now correctly calculated as: sum of (policy_cost Γ survival_probability) for acquired policies This means: - If a policy has 90% survival probability, 90% of its cost is "deployed" - As policies mature (mortality increases), less capital is considered deployed - Fee shrinks gradually based on probability-weighted capital still at work Previously was incorrectly using cumulative death benefits which could exceed committed capital. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>a3f9175 -
Fix session state persistence when switching between fundsβ
All sidebar widgets now properly preserve their values when switching between funds by using the session state pattern: - Initialize session state from fund_config if key doesn't exist - Don't use value=/index= parameters (let Streamlit manage via key) - Read back from session state to update fund_config π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>26ede00 -
Add management fee on deployed capital and DB fee on terminal sale togglesβ
- Add per-fund toggle for management fee on deployed capital only (fee calculated on called capital minus cumulative death benefits) - Add per-fund toggle for applying DB participation fee to terminal sale - Update config.py, main.py, fund.py with new parameters and logic - Add English and Hebrew translations for new UI elements π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>3b0af69
-
Fix GP Balance double-counting and use net amount in shortfall messagesβ
- Fixed GP Balance calculation in GP_BALANCE_THRESHOLD_MAIN: start at 0 since Net GP Cash Flow already includes GP Investment at month 1 - Fixed GP Balance calculation in GP_BALANCE_THRESHOLD_ENTIRE (consolidated view): same fix to avoid double-counting - Updated consolidated GP cash shortfall section to use NET available amount (after prior period costs) for initial reserve and in all display messages π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>b20c7b8 -
Fix: Apply Prior Period GP Costs to GP Investment column in GP Viewβ
- GP Investment column now shows NET amount (after prior costs) at month 1 - This fixes Net GP Cash Flow and Cumulative calculations in Entire GP view π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>7ea5474 -
Fix: Apply Prior Period GP Costs to Entire GP view sectionsβ
- Added gp_prior_costs to GP_BALANCE_THRESHOLD_MAIN section (single fund) - Added gp_prior_costs to GP_BALANCE_THRESHOLD_ENTIRE section (consolidated) - GP Balance now starts with net available amount after prior costs π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>5ff88f4 -
Add Prior Period GP Costs input for GP Investor cash flowβ
- Added sidebar input for Prior Period GP Costs under GP Investment - GP Investment = full investor cash contribution (used for IRR calculation) - Prior Period Costs are deducted from operational cash available - Net Available = GP Investment - Prior Costs (used for GP Balance) - Applied to all 3 GP Investor sections (GP View, Tab5, GP vs LP tab) π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>ffb26a1 -
Rename "Cash In" to "Cash Invested" in GP Investor viewsβ
- Changed column name from "Cash In" to "Cash Invested" - Updated all metric labels and captions - Also added Distribution/GP Balance to main GP View monthly table π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>7d1a72f -
Add Distribution column to Entire GP (Consolidated GP View)β
- Added Distribution and GP Balance columns to consolidated monthly table - Same $300K threshold logic, no distribution in first 12 months - Shows 100% distribution (entire GP), not scaled by ownership % - Added Total Distributions metric π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>aed21f5 -
Fix GP Investor cash flow logic: full amount as cash in, no distribution in year 1β
- Cash In = full GP Investment amount (not multiplied by ownership %) - No distributions in first 12 months (need cash for operations) - Ownership % only affects distribution share, not cash contribution π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1d97b36 -
Fix GP Investor: GP Investment is TOTAL GP cash, not investor's shareβ
- GP Investment from sidebar = TOTAL GP cash (e.g., $255K) - Investor's Cash In = GP Investment Γ ownership % (e.g., $255K Γ 10% = $25.5K) - Total GP balance starts with GP Investment ($255K), not scaled up - Distribution to investor = total distribution Γ ownership % - Fixed in all 3 locations: GP Investor toggle, Entire GP section, GP vs LP tab π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>21b021e -
Fix GP Investor: single investment at month 1, no additional injectionsβ
- GP Investment from sidebar is the TOTAL cash the investor puts in at month 1 - No additional cash injections - this is all they contribute - Cash In = investment amount in month 1, 0 for all other months - Distribution = investor's share (ownership %) when GP balance > $300K - Terminal distribution at end of last fund (remaining balance) - Fixed in all 3 locations: GP Investor toggle, Entire GP section, GP vs LP tab π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>f6e4a51 -
Fix GP Investor view with proper waterfall distribution logicβ
GP View tab - GP Investor toggle: - Uses GP Investment from sidebar as initial cash injection at month 1 - Starts GP balance with total investment (investor amount / ownership %) - No distribution in month 1 (that's when money comes in) - Distribution only after month 1 when total GP balance > $300K - Terminal distribution at end of last fund - Cash In/Distribution columns show investor's proportionate share - IRR calculated from actual Cash In (negative) and Distribution (positive) GP View tab - Entire GP section: - Same waterfall logic applied - No distribution in month 1 GP vs LP tab: - Same waterfall logic applied - No distribution in month 1 π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>cc21c6c -
Fix GP Investor Cash In calculation in GP View tabβ
- GP Investment from sidebar now used as initial cash injection at month 1 - Balance starts with total GP investment (scaled from investor share) - Month 1 Cash In shows investor's GP Investment + any additional injection - Subsequent months only show additional injections when balance would go negative - Distributions show investor's proportionate share based on ownership % π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>da22757 -
Add GP Investor section to GP View tab with waterfall distributionsβ
- Cash In: investor's proportionate share when GP needs cash injection - Distribution: investor's share when GP balance > $300K or at terminal - IRR calculated from actual investor cash flows - Shows GP Income, Overhead, Net Operating CF, Cash In, Distribution Both GP View and GP vs LP tabs now have consistent GP Investor sections. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1a1670a -
Trigger HuggingFace rebuild
07d4a31 -
Implement GP Investor cash flow waterfall with distributionsβ
- Cash In: Only inject when GP balance would go negative - Distribution: When total GP balance > $300K, distribute excess down to $300K - Terminal: At end of last fund, distribute entire remaining balance - GP IRR: Calculated from actual cash injections and distributions - Table shows: GP Income, Overhead, Net Operating CF, Cash In, Distribution, GP Balance π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>f2c9398 -
Add GP Investor monthly cash flows breakdown tableβ
Shows monthly detail in GP Investor view: - GP Investment (inflow at month 1) - GP Income - GP Overhead - Net Cash Flow - Cumulative position π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>32a46c9 -
Add GP Investment column to GP View and shortfall calculationsβ
- Add GP Investment column to GP View monthly cash flows table - Include GP Investment in annual summary aggregation - Add GP Investment as initial cash reserve in shortfall calculation - Show GP Investment column in shortfall table with proper formatting - Display info message about GP Investment being included in calculations - Remove debug code (st.warning, print statements) - Net GP Cash Flow now calculated as: Income + GP Investment - Overhead π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>b3c4620
-
DEBUG: Add catch_up_mode debug output to diagnose issueβ
π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>4f075a6 -
Fix: Remove index= param from catch_up selectbox to prevent state conflictsβ
The issue was using both index= and key= parameters together in st.selectbox(). This causes Streamlit to have conflicting sources of truth - the index was being re-evaluated on every rerun, resetting the user's selection. Solution: Let Streamlit manage state entirely via key= and use the selectbox return value directly to update fund_config. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>7eacf1a -
Fix catch-up mode sync for all funds before analysisβ
When running analysis, sync catch_up_mode from session state keys to fund_configs for ALL funds. This ensures that even if a fund's expander wasn't open (and its selectbox wasn't rendered), the catch_up_mode value selected earlier is still used during fund creation. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>afdefec -
Fix catch-up mode session state sync for multi-fund configurationsβ
The catch_up_mode selectbox wasn't using the same session state pattern as other fund parameters, causing inconsistent behavior when multiple funds were configured. Now properly syncs with session state like hurdle_rate, db_pct_to_manager, etc. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>de6eda2 -
Fix full catch-up mode waterfall calculationβ
Previously, full catch-up mode incorrectly solved for the fee that gives LP exactly hurdle IRR. The correct waterfall is: 1. Return of capital to LP 2. Preferred return (hurdle) to LP 3. Catch-up: GP takes 100% of profits above hurdle until GP has full carry (carry_pct Γ total profit) 4. After catch-up: remaining profits split 80/20 (LP/GP) Example: 12.1% before carry, 8% hurdle, 20% carry - Excess above hurdle = 4.1% - GP target = 20% Γ 12.1% = 2.42% - Remainder = 4.1% - 2.42% = 1.68% - LP gets 80% of remainder = 1.34% - LP final = 8% + 1.34% = 9.34% (not 8% as before) π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>a778ae9 -
Fix fund selector jumping issue in GP View and Policy Selection tabsβ
Changed from name-based session state (gp_view_fund_name, policy_selection_fund_name) to index-based (selected_fund_tab5, selected_fund_tab2) to match the pattern used in other tabs. This prevents the selectbox from jumping to a different fund on rerender. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>4e427b3 -
Update GP report to use IRR-based success fee calculationβ
Pass cash_flows to calculate_waterfall_distribution in GPReport so it uses the same IRR-based binary search as LPReport. Both LP and GP reports now return consistent success fee values. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>023d365 -
Fix waterfall to use IRR-based success fee calculationβ
The previous dollar-based calculation didn't account for the timing of cash flows in IRR computation. Now uses binary search to solve for the success fee that achieves the target LP IRR: - Full Catch-Up: Solves for fee that gives LP exactly hurdle IRR - No Catch-Up: Solves for fee that gives LP hurdle + 80% of excess Tested with 5.44% IRR before carry, 3% hurdle: - Full Catch-Up: LP gets 3.00% IRR after carry - No Catch-Up: LP gets 4.95% IRR (3% + 80% of 2.44% excess) π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>b5526bd -
Fix waterfall calculation to use dollar-based hurdle amountβ
The profit above hurdle is calculated as: profit_above_hurdle = distributions - hurdle_amount where hurdle_amount = invested * (1 + hurdle_rate)^years Full Catch-Up: GP gets 100% of profit above hurdle until they reach their target carry (20% of total profit), then 80/20 split. No Catch-Up: 80/20 split on all profit above hurdle. Tested scenarios: - 11.55% IRR, 11% hurdle, full catch-up: LP gets exactly 11% - 11.67% IRR, 11% hurdle, no catch-up: LP gets 11.54% π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>922b514 -
Fix waterfall calculation for both catch-up modesβ
- Full Catch-Up: LP gets exactly hurdle rate, GP gets entire excess - No Catch-Up: 80/20 split on profit above hurdle - Use dollar-based calculation when distributions exceed hurdle amount - Fall back to IRR-based proportion when timing benefits cause IRR > hurdle but distributions < hurdle amount Tested: 11.55% IRR, 11% hurdle correctly gives LP 11% in full catch-up π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>05d999b -
Fix: Waterfall calculation now correctly computes success feeβ
The issue was mixing IRR-based hurdle checking with dollar-based compound growth calculations. Now uses IRR-based proportional split: - Preferred return = profit * (hurdle_rate / IRR) - Profit above hurdle = profit - preferred_return Both modes verified working: - No Catch-Up: GP gets carry_pct of profit above hurdle - Full Catch-Up: GP catches up to full carry, then 80/20 split π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1650c1f -
Fix: No catch-up mode correctly calculates success feeβ
Changed no_catch_up mode to use dollar-based calculation: GP gets carry_pct of profits above the hurdle amount. Both modes now follow the 4-stage waterfall methodology: - No Catch-Up: Skip catch-up phase, split 80/20 on excess - Full Catch-Up: 100% to GP until full carry, then 80/20 π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>eb03497