A House Divided A House DividedDocumentation
↵
Changelog
Game Design/Economy & Finance

IMF Sovereign Facility

Last updated 2026-10-29
Player wikiIMF Sovereign Facility
Source files

Summary#

The IMF sovereign facility is the "bailout" resolution path for a sovereign debt crisis. When a country enters a crisis (failed bond auctions, unsustainable debt/GDP) and the executive chooses bailout instead of restructure or repudiate, the country's rollover need and deficit are consolidated into a single amortizing loan from the IMF Corp. The facility is repaid over time out of the country's own revenue, capped at a fraction of per-turn income, exactly like the corporate IMF bailout caps payments at a fraction of income, but the sovereign version uses federal revenue instead of corporate operating income, and the borrower is a country's federalBudget row rather than a Corporation document.

Player guide: IMF Sovereign Facility

This is a separate system from the corporate IMF bailout. Both borrow the same IMF Corp entity and the same annuity-with-income-cap math (imfFacilityMath.ts), but they apply to different debtors and are triggered by different subsystems (sovereign default vs. corporate bond default).

Rules#

Constants#

All values live in unless noted.

Constant Value Meaning
IMF_SOVEREIGN_DEFAULT_RATE 0.06 Fixed annual facility rate (6%)
IMF_SOVEREIGN_AMORTIZATION_TURNS 240 Amortization horizon
IMF_SOVEREIGN_INCOME_CAPTURE_MIN / DEFAULT / CAP 0.1 / 0.2 / 0.3 Share of per-turn revenue captured
IMF_BOARD_OVERRIDE_WINDOW_TURNS / _HOURS 12 / 12 Board window (turns first, wall-clock fallback)
IMF_BOARD_RATE_DELTA_BOUND 0.02 Max board rate change, 2 percentage points
IMF_BOARD_CAPTURE_DELTA_BOUND 0.1 Max board capture change, 10 points
IMF_BOARD_PUBLIC_TRUST_DELTA 0.02 Trust shift from endorse or criticize
FAILED_AUCTION_COUNT_FOR_CRISIS 3 Failed annual auctions that trigger the crisis
DEMAND_UNDERSUBSCRIBED_THRESHOLD 0.7 Demand below 70% of offering is a failed auction
EXECUTIVE_DECISION_TURNS 12 Executive window before auto-repudiate
LEGISLATIVE_VOTE_TURNS_PER_CHAMBER 24 Legislative vote window per chamber
MONETIZE_GATE_INFLATION 0.08 Monetize blocked at or above 8% inflation
DEFAULT_MARGIN_PENALTY_BAILOUT -0.045 Sector margin penalty on the bailout path
DEFAULT_MARGIN_FULL_PENALTY_TURNS / DEFAULT_MARGIN_DECAY_TURNS 48 / 24 Full-strength window, then linear decay
RECOVERY_FLOOR_TURNS 48 Minimum turns in recovery
RECOVERY_DISCIPLINE_REQUIRED_STREAK 5 Fiscal-discipline streak needed to exit
RECOVERY_CREDIBILITY_BONUS_TURNS / RECOVERY_CREDIBILITY_RATE_DISCOUNT 100 / 0.5 After a clean exit, the sovereign coupon rate is 0.5 points lower for 100 turns
TURNS_PER_YEAR 48 Annual to per-turn conversion ()

Trigger: sovereign default crisis#

A country enters a sovereign crisis (sovereignCrisisState: "crisisPending") through crisisDetection.ts, driven by debt/GDP penalties on bond demand and a failed-auction counter:

Once in crisisPending, the executive has EXECUTIVE_DECISION_TURNS = 12 turns to choose repudiate, restructure, bailout, or monetize. Monetize is blocked at 8% inflation or above. If no executive decision lands in time, crisisAutoAction.ts automatically selects Repudiate.

A submitted choice does not take effect at once. POST /api/country/[code]/sovereign-resolution opens a legislative ratification on the decision row and the response status is awaitingLegislativeRatification; each chamber has LEGISLATIVE_VOTE_TURNS_PER_CHAMBER = 24 turns. When the final chamber passes, processSovereignLegislativeTurn calls applyBailoutResolution. If the orchestrator refuses (for example the IMF Corp is missing), the legislative turn falls back to Repudiate so the country never sticks in crisisResolving.

Applying the bailout: applyBailoutResolution#

runs when the bailout choice is ratified. It:

  1. Requires a federalBudget row (otherwise no-budget).
  2. Requires sovereignCrisisState to be crisisPending or crisisResolving; otherwise returns not-in-crisisPending.
  3. Requires a seeded IMF Corp (imfInstitution: true on the corporations collection); otherwise returns no-imf-corp.
  4. Computes facility terms via computeSovereignBailoutTerms (see below).
  5. Writes facility state onto the country's federalBudget document and sets sovereignCrisisState: "recovering".
  6. Opens a 12-turn IMF Board override window.
  7. Emits bailout-granted news, applies executive political impact, and emits a civil-unrest event chain for the "bailout" path.

Facility terms: computeSovereignBailoutTerms#

. Pure math, no DB access.

const rollover = Math.max(0, inputs.rolloverFaceValue);
const deficit = Math.max(0, inputs.annualDeficit);
const principal = rollover + deficit;

Per-turn payment: processSovereignImfFacilityPayments#

, run every turn against every federalBudget with imfSovereignBailoutActive: true. Same annuity-with-income-cap kernel as the corporate facility (computeImfFacilityPaymentTurn in ):

  1. Per-turn revenue is approximated as budget.revenue.total / TURNS_PER_YEAR.
  2. The scheduled payment is a level annuity on the outstanding principal at the per-turn rate (annualRatePercent / 100 / TURNS_PER_YEAR) over the remaining amortization turns.
  3. Actual payment = min(scheduledPayment, perTurnRevenue * incomeCaptureFraction).
  4. If the cap binds and doesn't cover full interest, the interest shortfall is capitalized onto principal and the amortization clock does not advance that turn (the country gets more time, but the loan grows).
  5. When principal clears (newPrincipal <= 1e-6), imfSovereignBailoutActive is set back to false.

The payment itself is not deducted from the country's budget metrics: the processor only credits the IMF Corp and decrements the facility principal (the code comment says budget-revenue netting was deferred to later calibration). The facility does reach the budget through two other paths, listed under Connections.

FX conversion#

The country's revenue is in its local currency; the IMF Corp's liquidCapital is in its own liquidCurrencyCode (typically USD). Each turn's payment is converted local currency to anchor (corpCapitalToAnchor) to IMF Corp currency (anchorToCorpLiquidCapital), and the anchor amount is also accumulated into imfSovereignFacilityCumulativePaidAnchor on the budget row in the same write.

IMF Board override window#

POST /api/imf/board/override (). Any character who is a shareholder of the IMF Corp (isImfBoardMember) can act once, within the window opened by applyBailoutResolution (IMF_BOARD_OVERRIDE_WINDOW_TURNS = 12 turns / IMF_BOARD_OVERRIDE_WINDOW_HOURS = 12 as the wall-clock fallback):

Recovery after bailout#

Entering the facility puts the country into sovereignCrisisState: "recovering". The bailout path applies no direct flat GDP penalty in the resolution code (); its cost is the ongoing income capture plus a temporary sector-margin penalty (DEFAULT_MARGIN_PENALTY_BAILOUT = -0.045 in ). The other two resolution paths do apply a direct GDP penalty: REPUDIATE_GDP_PENALTY = 0.12 (12%, over REPUDIATE_GDP_PENALTY_TURNS = 3 turns) and RESTRUCTURE_GDP_PENALTY = 0.06 (6%, over RESTRUCTURE_GDP_PENALTY_TURNS = 2 turns).

Recovery requires RECOVERY_FLOOR_TURNS = 48 turns minimum plus a RECOVERY_DISCIPLINE_REQUIRED_STREAK = 5-turn streak of fiscal discipline. Good standing is a primary surplus: revenue.total >= spending.total - spending.debtInterest (isInGoodFiscalStanding, ). processSovereignRecoveryTurn evaluates it every turn: a good turn adds 1 to the streak, a bad turn resets it to 0. On exit the state returns to normal, the rating resets to BBB, and recoveryCredibilityBonusUntilTurn is stamped at the exit turn plus 100.

The sector-margin penalty is scaled per sector (DEFAULT_MARGIN_SECTOR_MULTIPLIERS): financial 1.5, manufacturing, retail, vehicles, chemicals, real estate and construction 1.3, technology, telecoms, healthcare, media, logistics and defense 1.0, energy, extraction and agriculture 0.7.

Read surfaces#

Data#

All facility state lives on the country's federalBudget row (FederalBudget, ).

Field Meaning Shown to players
imfSovereignBailoutActive Facility is live Badge on the country page
imfSovereignFacilityPrincipalOutstanding Remaining principal (₳) /api/imf/overview
imfSovereignFacilityAnnualRate Annual rate, percent /api/imf/overview
imfSovereignFacilityAmortizationTurnsRemaining Turns left on the amortization clock /api/imf/overview
imfSovereignFacilityIncomeCaptureFraction Fraction of per-turn revenue captured /api/imf/overview
imfSovereignFacilityImfCorporationId IMF Corp receiving payments No
imfSovereignFacilityCumulativePaidAnchor Lifetime anchor (₳) paid into the facility /api/imf/overview
sovereignCrisisState, crisisChoice, crisisChoiceAt, lastDefaultTurn Crisis state machine, set to recovering and bailout Crisis and recovery panels
recoveryStartedAt, recoveryFiscalDisciplineStreak, recoveryCredibilityBonusUntilTurn Recovery progress and the post-exit rate discount Recovery panel
imfBoardOverrideWindowEndAt, imfBoardOverrideAt, imfBoardOverrideBy, imfBoardOverrideKind, imfBoardOverrideRateDelta, imfBoardOverrideCaptureDelta, imfBoardPublicStatement Board window and the one action taken Open windows and the public statement through the overview
crisisAutoActionAt, crisisLegislativeDeadlineAt Cleared when the bailout is applied No

Other stores touched:

Collection Use
corporations (IMF Corp) liquidCapital credited each payment; read to find the board (shareholders)
sovereignCrisisDecisions The executive choice, legislative phases and ratification state; the proposing character is read for the political impact
bonds Read by calculateSovereignRolloverAmount for bonds maturing in the next 12 turns
Characters Executive favorability and infamy hit (-10 and +5, executivePoliticalImpact.ts)
News and unrest events One bailout-granted news item and one civil-unrest event

Configuration#

Setting Default Where set
Facility rate, term, capture default, min, cap 6%, 240 turns, 20%, 10%, 30%
Board window and bounds 12 turns, 2 points, 10 points, trust 0.02 same file
Crisis trigger (3 failed auctions, 70% demand threshold, debt/GDP penalty bands) see Rules same file
Executive window, legislative window per chamber 12 and 24 turns same file
Recovery floor, streak, credibility bonus 48 turns, 5 turns, 0.5 points for 100 turns same file
Margin penalty and sector multipliers -0.045, 48 full turns then 24 decay same file
gameConfig flag, era preset, country override none The facility has no switch; it runs for any federalBudget with the active flag. Whether a country can enter the crisis path at all depends on the crisis-detection gates (for example non-player countries are normally excluded from the failed-auction trigger, see comments in constants.ts)

The system needs a seeded IMF institution corporation (, getImfCorporation).

Timing#

flowchart TD
  A["Crisis pending: executive chooses bailout"] --> B["Legislative ratification, 24 turns per chamber"]
  B --> C["applyBailoutResolution: write facility, open board window"]
  C --> D["Each bond turn: facility payment credited to IMF Corp"]
  D --> E["Recovery check, then crisis auto-actions, then legislative turn"]
  C --> F["Board member acts once within 12 turns"]
  D --> G["Fiscal-year rollover: austerity scaling and 6% rate cap"]
  D --> H["Principal clears: facility closes"]
  H --> I["Recovery continues until 48 turns and 5-turn streak"]

Worked trace#

A country has 480,000 annual revenue, so per-turn revenue is 480,000 / 48 = 10,000. Bonds maturing in 12 turns are 900,000 and the projected annual deficit is 300,000.

Setup. Principal = 900,000 + 300,000 = 1,200,000. Rate 6% gives r = 0.06 / 48 = 0.00125; (1+r)^240 = 1.3496. Stored: rate 6, 240 turns, capture 0.2, state recovering, board window ends at the grant turn plus 12.

Turn 1.

Turn 2. Interest = 1,199,500 * 0.00125 = 1,499.4; the cap is still 2,000, so principal falls to 1,198,999.4 and the clock to 238.

If revenue falls to 240,000 (5,000 per turn). The cap is 1,000. Interest shortfall 500 is capitalized: principal 1,200,500, clock stays 240.

Board action. With the maximum modify-terms nudge of +10 points of capture the fraction is 0.3 and the cap is 3,000; with a -2 point rate nudge the rate is 4%, interest due is 1,000, and a turn-1 payment of 3,000 would be 1,000 interest and 2,000 principal. Only one such action is allowed per grant.

Exit. If good fiscal standing holds on 5 consecutive turns and at least 48 turns have passed since recoveryStartedAt, the state returns to normal and the coupon discount starts. The loan can outlast recovery: the facility clears only when principal reaches zero.

Edge cases and limits#

Invariants#

Invariant Enforced by
Principal is rollover plus deficit, both floored at 0 computeSovereignBailoutTerms;
Payment never exceeds min(scheduled, revenue per turn x capture) computeImfFacilityPaymentTurn;
The clock advances only when interest was fully paid same kernel; imfSovereignFacilityTurn.test.ts ("when income cap binds, does not advance amortization")
Active flag clears when principal reaches about 0 imfSovereignFacilityTurn.test.ts
Only one board action per grant atomic filter in the route; ("409 when concurrent updateOne races")
Board rate and capture deltas stay within their bounds route clamp; same test file ("clamps deltas")
The facility rate cap on debt service is 6% sovereignStockServiceRate, calculateInterestRate;
Resulting capture stays in 10-30% after a board nudge not enforced (holds only because setup starts at 0.2)
Payment is netted from the country's budget not enforced (deferred, see Known issues)

Failure and recovery#

Connections#

Driven by:

Affects:

Contrast with the corporate IMF bailout#

Sovereign facility Corporate bailout
Debtor Country federalBudget row Corporation document
Trigger Failed-auction sovereign crisis, executive chooses bailout Admin-initiated restructuring of a distressed corp
Rate Fixed 6% annual (IMF_SOVEREIGN_DEFAULT_RATE) Design-tunable per corp (imfFacilityAnnualRate)
Amortization 240 turns (IMF_SOVEREIGN_AMORTIZATION_TURNS) Term set at bailout time
Payment cap Income-capture fraction 10-30%, default 20%, of per-turn revenue 45% of per-turn corporate income
Equity None, no ownership dilution IMF receives new shares up to a target ownership percent
Oversight IMF Board 12-turn override window (rate/capture nudge or public statement) Admin-only controls, no board mechanic
Math kernel Shared computeImfFacilityPaymentTurn () Same shared kernel

Key files#

Tests#

Area Test file
Terms
Per-turn payment
Resolution guards and happy path
Shared kernel
Legislative ratification
Board override
Overview and status routes ,
Austerity and fiscal year ,
Debt service cap
Crisis detection and recovery scenarios ,

Gaps: no test for a zero-principal facility clearing, none for the board nudge leaving the 10-30% band, and no test for the crash window between the budget write and the IMF Corp credit.

Known issues and history#

Last checked: 2026-10-29, version 1.18.0

Ask