Skip to content

FCM cost estimate framework — 2022 bear market#1

Open
0xLisanAlGaib wants to merge 5 commits into
mainfrom
fcm-cost-estimate
Open

FCM cost estimate framework — 2022 bear market#1
0xLisanAlGaib wants to merge 5 commits into
mainfrom
fcm-cost-estimate

Conversation

@0xLisanAlGaib
Copy link
Copy Markdown
Collaborator

Summary

  • Implements the full FCM position maintenance cost estimate for the 2022 bear market year (BTC $46k → $17k, −64%)
  • Adds HC/SR/ER transaction counters and per-event rebalance log to HighTideAgent, using FlowCreditMarket.cdc thresholds (ER trigger 1.5 / SR trigger 1.1 / target HF 1.3)
  • Adds hourly HF history recording across all 8,760 health-check slots
  • Adds three new scripts: simulation runner, visualization figures, and cost table generator
  • Adds COST_ESTIMATE.md documenting the framework, methodology, and results

Results

Transaction Count
HC — health check, no action 8,748
SR — safety rebalance 8
ER — efficiency rebalance 3
Total 8,759

Cost formula: 8,748 × c_hc + 8 × c_sr + 3 × c_er

0 liquidations. 100% survival. Final HF 1.228.

How to run

python3 sim_tests/run_cost_estimate_2022.py
python3 sim_tests/plot_cost_estimate_report.py
python3 sim_tests/generate_cost_table.py

Test plan

  • Run run_cost_estimate_2022.py and verify 0 liquidations, N_total ≤ 8,760
  • Run plot_cost_estimate_report.py and verify both figures generate without error
  • Run generate_cost_table.py and verify CSV and PNG are written to results folder

AlexHentschel and others added 5 commits March 3, 2026 22:25
…High Tide vs AAVE`

• exploration based on `main` commit `ba544b11514139737cfc594eae6ef1113faa43e3`

Simulation edits

• File `sim_tests/archive_tests/balanced_scenario_monte_carlo.py`
   - broken Import stub removed
   - btc_final_price restored from $90_000.0 (broken end value) → 76_342.50 (−23.66%, scenario in primer)
   - simulation order flipped (lines 425–431): makes Aave result deterministic independent of High Tide's internal PRNG usage;  flipped order improves match with primer results. Existing comments indicate that this might have been the intended order anyway.

• File 2: `tidal_protocol_sim/agents/aave_agent.py`: bypass scaling bug in MOET:BTC pool ; Fix: liquidator provides debt repayment directly as in real-world aave

Further reading
• sims-review_commit-da4cbf9/DISCREPANCY-ANALYSIS_balanced_scenario_monte_carlo.md
• sims-review_commit-ba544b1/PRIMER-COMPATIBLE_balanced_scenario_monte_carlo.md
… floating-point shortcut (commit `48a9ff2`) eliminated real AMM friction, making HT rebalancing costs artificially zero
- Add HC/SR/ER transaction counters and per-event rebalance log to HighTideAgent
- Add hourly HF history recording at every health-check slot
- Add FCM operational params to FullYearSimConfig (check frequency, max cycles, disable deleveraging)
- Add run_cost_estimate_2022.py: single-agent 2022 simulation with FlowCreditMarket.cdc thresholds (ER 1.5 / SR 1.1 / target 1.3)
- Add plot_cost_estimate_report.py: two figures (BTC+HF dashboard with continuous HF line and rebalance arrows; event analytics with transition bar chart and broken y-axis HF distribution)
- Add generate_cost_table.py: cost estimate table with symbolic placeholders (c_hc, c_sr, c_er)
- Add COST_ESTIMATE.md: full framework documentation including simulation results (8,748 HC / 8 SR / 3 ER, 0 liquidations)

Results: 8,748 × c_hc + 8 × c_sr + 3 × c_er over 365 days, 100% survival
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants