/** * Cascade Liquidation Simulation * * Simulates multi-group liquidation cascades for Aave positions backed by * indivisible BTC vaults (UTXOs). Each liquidation event seizes a prefix of * vaults until the target seizure is covered, then debt is reduced and the * cascade continues with remaining vaults. * * Used by the optimizer to score different vault orderings by how much * collateral survives the cascade. */ /** * Minimal vault shape for cascade simulation. * UI layers extend this with display fields (e.g. `name`). */ export interface CascadeVault { id: string; btc: number; } /** 1% tolerance for prefix walk coverage — avoids cliff flip at boundary */ export declare const SEIZURE_TOL = 0.01; /** Circuit breaker for group cascade loop */ export declare const MAX_GROUPS = 20; /** Minimum debt threshold to continue cascade (avoids infinite loop on dust) */ export declare const MIN_DEBT_THRESHOLD = 0.01; /** * Prefix walk: consume vaults front-to-back until target seizure is covered. * Returns the vaults in the first liquidation group. */ export declare function getGroup1FromOrder(order: T[], seizedFraction: number, seizureTol: number): T[]; /** * Simulate full liquidation cascade with debt model. * * PRIMARY score: sumBtcAfterEvents — sum of BTC remaining after every event. * Captures how much collateral survives at each stage. * TIEBREAKER: btcAfterG1 — BTC remaining after the first (most likely) event. */ export declare function simulateCascade(order: T[], totalDebt: number, seizedFraction: number, seizureTol: number, CF: number, THF: number, maxLB: number, expectedHF: number): { sumBtcAfterEvents: number; btcAfterG1: number; }; //# sourceMappingURL=cascadeSimulation.d.ts.map