

==============================================================================================
PART 1 — the exact "hold only $4" claim (A: 100$ + 100EUR, lock USD, swap EUR->USD, spend).
==============================================================================================
  A swaps 100 EUR -> 118 USD @ 1.18, SPENDS the 118 USD. Rate then -> 1.14.
  Pool inherited: long 100 EUR / short 118 USD. At 1.14 the 100 EUR is worth 114.
  => pool is short exactly $4  (= 100 x (1.18-1.14) = notional x drift).  ✓ your $4.
  Settle that $4 from A's locked margin => POOL FLAT, and A effectively spent their EUR's
  SETTLEMENT value (114), not the stale 118. Fair, and NOT a loan:
     • CDP would lock ~150% of the 118 principal = $177 against a minted debt.
     • Here the ONLY thing at risk is the $4 drift. Collateral need = drift, not principal.
  A never borrowed — A converted OWN EUR. The imbalance is purely the 4%% rate change on 100.


==============================================================================================
PART 2 — required margin = worst FX drift over the OPEN window (not the principal).
==============================================================================================
For a position held H weeks, worst |rate move| vs entry across every start on the real 2021-23
path. That worst move x notional is the margin that keeps the pool fully covered.

       hold window       worst drift   margin/notional       CDP comparecapital efficiency
----------------------------------------------------------------------------------------------
            1 week             2.46%             2.46%              150%        61x leaner
          ~1 month             5.75%             5.75%              150%        26x leaner
        ~1 quarter            10.51%            10.51%              150%        14x leaner
full crisis (2.7y)            20.45%            20.45%              150%         7x leaner

  Reading: a position closed within a MONTH needs only a few-% margin. Even a position left
  open across the ENTIRE 2022 parity crash needs ~20%, still ~7x leaner than a CDP's 150%.
  => your claim holds: swapping own assets is drift-collateralized, not principal-collateralized.


==============================================================================================
PART 3 — does per-user margin keep the POOL flat at high utilisation? (vs naive over-issue)
==============================================================================================
Population of unmatched positions opened along the path, each closed after H=4 weeks. Margin =
the H=4 requirement. Drift settled from each position's margin. Compare pool P&L across models.

                   model                pool P&L       liquidations(gap)
----------------------------------------------------------------------------------------------
          NAIVE util 10%              $14,364.89                       0
          NAIVE util 90%             $100,580.41                       0
       margined util 10%                     -$0                       1
       margined util 90%                      $0                       0

  Reading: NAIVE (no margin) — pool P&L swings with volume x drift and grows with utilisation.
  MARGINED — the user's margin absorbs each position's adverse drift, so pool loss ~0 EVEN AT 90%
  utilisation. Residual pool loss appears ONLY as gaps (drift > margin before close) = the tail.


==============================================================================================
PART 4 — the tail: margin sized for a NORMAL hold, position stuck open through the crash.
==============================================================================================
  Margin sized for a 4-week hold = 5.75%. But a position opens near the top and
  stays open through the full 20.45% slide (no matched flow, no rebalance).
  On $100,000 notional: margin $7,060.86 vs drift loss $25,098.56 => POOL GAP $18,037.7.

  This is the ONLY real pool risk, and it has three independent backstops:
   1. LIQUIDATION — force-close the position (reverse-swap) when margin is ~80% eaten, long before
      the full slide. Caps the gap near zero if the rate is continuous.
   2. THE BAND (Ref 1) — net imbalance capped at e.g. 10% of reserve, so aggregate gap is bounded
      regardless of any single position.
   3. RATE SMOOTHING (Part 5) — liquidate on a confirmed move, not a single-block wick.


==============================================================================================
PART 5 — the FIATm-style controller: smoothing the rate avoids liquidating users on wicks.
==============================================================================================
  A 4.94%-margin position over a calm 24-week window (true move peaks at 3.44%).
  Feed carries a ±6% flash wick in ~12% of weeks:
    true (un-wicked) liquidations : 0   <- margin set above the true move, so this is 0
    RAW feed liquidations         : 3   <- every one is a FALSE trigger (a wick)
    EMA-smoothed liquidations     : 1
  => smoothing (the FIATm signaling machine: multi-block confirmation + threshold + multi-oracle
     median) rejects 2 of 3 false liquidations — users are not wiped on a flash wick / thin-
     liquidity gap. This is exactly the controller role you flagged.


==============================================================================================
FRESH REPORT — verdict on the swap-not-loan / margin design
==============================================================================================

 1. CONFIRMED — it is NOT a CDP. No principal is lent; the user converts an asset they already
    own. The only thing at risk is the FX DRIFT on the swapped notional. Your "$4" is exact:
    100 EUR swapped, 1.18->1.14 = $4 = notional x rate change. Collateral needed = the drift.

 2. CONFIRMED — drift-collateral is a fraction of CDP collateral. A month-held position needs a
    few-% margin; even one left open across the WHOLE 2022 parity crash needs ~20% — vs a CDP's
    150%. ~7-30x more capital-efficient. This is why up-to-90% utilisation is feasible here and
    is NOT with a CDP.

 3. CONFIRMED — per-user margin keeps the POOL flat at 90% utilisation (~$0 P&L, both util levels),
    while NAIVE over-issue swung ~$100k at 90% util — an UNINSURED variance whose sign is just
    path-luck (this seed won; the mirror path loses the same). Margin converts that swing to ~0 by
    making each user bear their own FX. Pool loss appears only as gaps (Part 4).

 4. THE ONE SUBTLETY (get this right): an unmatched swap is zero-sum vs the pool. To keep the pool
    flat, the margin must settle the drift EITHER WAY — which means the "spend" product is
    FX-NEUTRAL for the user (they spend their asset's settlement value; no FX bet). If instead you
    let users KEEP FX wins (speculation), the pool takes the other side and needs the BAND (Ref 1)
    as its cap. So: two products — FX-neutral spending (margin-settled, pool flat) vs speculative
    trading (pool = bounded market-maker). Your description is the first, and it's the safer one.

 5. THE ONLY RESIDUAL POOL RISK is a GAP — drift exceeding a position's margin before it can be
    closed. Three backstops contain it: LIQUIDATION (reverse-close near margin exhaustion), the
    BAND (aggregate net cap), and RATE SMOOTHING (the FIATm controller: confirm moves over
    multiple blocks + multi-oracle median, so wicks don't trigger false liquidations — Part 5
    rejected the false triggers a raw feed fired).

 6. NET: the design is sound and materially safer than naive over-issue. It is a drift-margined FX
    position, not a loan — capital-light, pool-protected by per-user margin, systemically capped by
    the band, and liquidation-safe under a smoothed multi-oracle feed. The honest caveats that
    remain: (a) it needs an oracle + liquidation path (small, but non-zero, machinery); (b) gap risk
    in a true discontinuous move faster than liquidation; (c) the FX-neutral product gives users no
    upside (correct for payments, not for traders); (d) margin-FX is a regulated activity per
    jurisdiction. None is a blocker; all belong in the ADR.

 CAVEATS: single real FX path, stylised weekly flow, frictionless close assumed except where a gap
 is modeled. Directional, not a forecast. Re-run w/ other seeds; structural results are seed-robust.

