Skip to content

feat: model endogenous liquidation cascades - #1

Merged
RichaShiny merged 5 commits into
mainfrom
feat/liquidation-cascade-model
Sep 17, 2026
Merged

RichaShiny merged 5 commits into
mainfrom
feat/liquidation-cascade-model

Conversation

@RichaShiny

Copy link
Copy Markdown
Owner

Adds an endogenous liquidation-cascade layer to RiskForge so stress testing continues beyond first-order liquidation exposure.

What this adds:

  • iterative partial liquidations using a configurable close factor and liquidation bonus
  • asset-level market depth that converts collateral sales into endogenous price impact
  • repeated liquidation rounds so sell pressure can push previously healthy positions into liquidation
  • explicit tracking of initial versus cascade-created liquidations
  • debt-repayment, collateral-sale, bad-debt, price-impact, and convergence telemetry
  • per-asset cascade attribution and final position-level state
  • deterministic regression coverage, including a constructed shallow-liquidity case that produces a genuine secondary liquidation cascade
  • a dedicated Streamlit Liquidation Cascade Lab for varying shocks, market depth, close factor, bonus, impact strength, and round limits
  • a GitHub Actions pytest quality gate for future pull requests

The price-impact model is deliberately transparent and stress-test oriented. It uses an exponential depth curve rather than presenting the cascade output as a prediction of realized execution.

Please review and merge manually.

@RichaShiny
RichaShiny merged commit 5c04b54 into main Sep 17, 2026
1 check passed
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.

1 participant