<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Feng Yu</title>
    <description>The latest articles on DEV Community by Feng Yu (@fengyugbt).</description>
    <link>https://dev.to/fengyugbt</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4113833%2Ffa0629ad-e957-46e6-8316-f702368a55dc.jpg</url>
      <title>DEV Community: Feng Yu</title>
      <link>https://dev.to/fengyugbt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fengyugbt"/>
    <language>en</language>
    <item>
      <title>The Retail Underwear: What Protection Costs When the Backstop Has a Clock</title>
      <dc:creator>Feng Yu</dc:creator>
      <pubDate>Sun, 27 Sep 2026 11:17:32 +0000</pubDate>
      <link>https://dev.to/fengyugbt/the-retail-underwear-what-protection-costs-when-the-backstop-has-a-clock-5f68</link>
      <guid>https://dev.to/fengyugbt/the-retail-underwear-what-protection-costs-when-the-backstop-has-a-clock-5f68</guid>
      <description>&lt;p&gt;&lt;em&gt;Fat Tail Notes · Part 19 · V10-P7&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Part 18 asked the question this series has been walking toward since Part 11: when the backstop's protection is probabilistic, what does the retail investor's own "underwear" actually consist of, and what does it cost? This part answers with numbers. Two garments exist for the unprotected investor — a cash buffer and put insurance — and they have different geometries, different costs, and different failure modes. The cash garment has capacity 1.0 by construction: it is always there. The options garment's capacity is priced by the market, and the market reprices insurance most expensively exactly when it is most needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What the market says protection costs
&lt;/h2&gt;

&lt;p&gt;The survey numbers are consistent across practitioners:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Put insurance&lt;/strong&gt; (10-20% out-of-the-money, rolled quarterly): roughly 1-3% of portfolio per year. Deep OTM puts (20%+ strikes) cost 1-2% per quarter of protection; put spreads 0.5-1.5%.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Crisis repricing&lt;/strong&gt;: the same contract costs 2-5x in panicked markets. In March 2020 the VIX went from ~14 to 82; the S&amp;amp;P 500 fell 33.9% in 23 trading days, and puts that cost 1% in calm conditions were quoted at 5-10%. One example in the literature: a deep OTM put at normal IV 30% cost 0.10; at crisis IV 150% the same strike cost 4.50 — a 4,400% repricing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cash buffer&lt;/strong&gt;: the opportunity cost of holding cash is roughly 0.8-1.2% per year for moderate over-allocation, and it compounds brutally over decades.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The uncomfortable structure, and the reason this part exists: &lt;strong&gt;the retail investor's insurance has its own "pushing on a string" problem&lt;/strong&gt; — the exact phenomenon Tenreyro and Thwaites documented for monetary policy. Policy is weakest in the state where it is most needed. The retail put is most expensive in the state where it is most needed. Renewal is the clock.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The model: two garments, two geometries
&lt;/h2&gt;

&lt;p&gt;We reuse the exact market-loss machinery of Parts 15-18 (P4's &lt;code&gt;run_policy_moral_hazard&lt;/code&gt;, P6's capacity levels C) and overlay the two garments on the raw per-path losses, seed 20260921, 2,000 paths per level:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;bare&lt;/strong&gt; — no garment: loss = market loss.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;cash&lt;/strong&gt; — 20% buffer: every path scaled by 0.8. Deterministic, always works; cost is the calm-market opportunity cost, 2.0%/yr at a 10% equity return assumption.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;put&lt;/strong&gt; — deductible 20%, premium 2%/yr: every path beyond -20% gets paid dollar-for-dollar above the deductible; loss is capped at -(20% + 2%) = -22%. The garment is a hard tail truncation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;put_crisis&lt;/strong&gt; — same deductible, but the premium is repriced at 6%/yr (2-3x, the survey's crisis renewal): what happens if you buy protection after the vol spike, not before.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;C&lt;/th&gt;
&lt;th&gt;garment&lt;/th&gt;
&lt;th&gt;mean&lt;/th&gt;
&lt;th&gt;p1&lt;/th&gt;
&lt;th&gt;worst&lt;/th&gt;
&lt;th&gt;&amp;gt;30% paths&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1.00&lt;/td&gt;
&lt;td&gt;bare&lt;/td&gt;
&lt;td&gt;-24.6%&lt;/td&gt;
&lt;td&gt;-29.4%&lt;/td&gt;
&lt;td&gt;-31.5%&lt;/td&gt;
&lt;td&gt;0.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.00&lt;/td&gt;
&lt;td&gt;cash&lt;/td&gt;
&lt;td&gt;-19.7%&lt;/td&gt;
&lt;td&gt;-23.5%&lt;/td&gt;
&lt;td&gt;-25.2%&lt;/td&gt;
&lt;td&gt;0.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.00&lt;/td&gt;
&lt;td&gt;put&lt;/td&gt;
&lt;td&gt;-21.5%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-22.0%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;-22.0%&lt;/td&gt;
&lt;td&gt;0.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.00&lt;/td&gt;
&lt;td&gt;put_crisis&lt;/td&gt;
&lt;td&gt;-25.5%&lt;/td&gt;
&lt;td&gt;-26.0%&lt;/td&gt;
&lt;td&gt;-26.0%&lt;/td&gt;
&lt;td&gt;0.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.75&lt;/td&gt;
&lt;td&gt;bare&lt;/td&gt;
&lt;td&gt;-30.7%&lt;/td&gt;
&lt;td&gt;-55.9%&lt;/td&gt;
&lt;td&gt;-61.6%&lt;/td&gt;
&lt;td&gt;27.2%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.75&lt;/td&gt;
&lt;td&gt;cash&lt;/td&gt;
&lt;td&gt;-24.5%&lt;/td&gt;
&lt;td&gt;-44.7%&lt;/td&gt;
&lt;td&gt;-49.3%&lt;/td&gt;
&lt;td&gt;23.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.75&lt;/td&gt;
&lt;td&gt;put&lt;/td&gt;
&lt;td&gt;-21.6%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-22.0%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;-22.0%&lt;/td&gt;
&lt;td&gt;0.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.50&lt;/td&gt;
&lt;td&gt;bare&lt;/td&gt;
&lt;td&gt;-38.6%&lt;/td&gt;
&lt;td&gt;-61.3%&lt;/td&gt;
&lt;td&gt;-66.1%&lt;/td&gt;
&lt;td&gt;54.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.50&lt;/td&gt;
&lt;td&gt;cash&lt;/td&gt;
&lt;td&gt;-30.8%&lt;/td&gt;
&lt;td&gt;-49.0%&lt;/td&gt;
&lt;td&gt;-52.9%&lt;/td&gt;
&lt;td&gt;49.2%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.50&lt;/td&gt;
&lt;td&gt;put&lt;/td&gt;
&lt;td&gt;-21.8%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-22.0%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;-22.0%&lt;/td&gt;
&lt;td&gt;0.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.25&lt;/td&gt;
&lt;td&gt;bare&lt;/td&gt;
&lt;td&gt;-47.1%&lt;/td&gt;
&lt;td&gt;-63.7%&lt;/td&gt;
&lt;td&gt;-66.1%&lt;/td&gt;
&lt;td&gt;80.5%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.25&lt;/td&gt;
&lt;td&gt;cash&lt;/td&gt;
&lt;td&gt;-37.6%&lt;/td&gt;
&lt;td&gt;-51.0%&lt;/td&gt;
&lt;td&gt;-52.9%&lt;/td&gt;
&lt;td&gt;73.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.25&lt;/td&gt;
&lt;td&gt;put&lt;/td&gt;
&lt;td&gt;-21.9%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-22.0%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;-22.0%&lt;/td&gt;
&lt;td&gt;0.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;bare&lt;/td&gt;
&lt;td&gt;-33.9%&lt;/td&gt;
&lt;td&gt;-44.1%&lt;/td&gt;
&lt;td&gt;-46.7%&lt;/td&gt;
&lt;td&gt;84.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;cash&lt;/td&gt;
&lt;td&gt;-27.1%&lt;/td&gt;
&lt;td&gt;-35.3%&lt;/td&gt;
&lt;td&gt;-37.3%&lt;/td&gt;
&lt;td&gt;38.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;put&lt;/td&gt;
&lt;td&gt;-20.9%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-22.0%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;-22.0%&lt;/td&gt;
&lt;td&gt;0.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The geometries are the whole point. The cash garment is a &lt;strong&gt;scaling&lt;/strong&gt;: every loss, shallow and deep, is multiplied by 0.8. The put garment is a &lt;strong&gt;truncation&lt;/strong&gt;: no path can lose more than 22%, and shallow paths are barely touched. Both cost 2% per year. Their difference only shows in the tail — which is exactly the region the previous three parts said you should be reading.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The clock reads in the renewal
&lt;/h2&gt;

&lt;p&gt;Tail protection per 1% of cost (p1 improvement over bare):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;C&lt;/th&gt;
&lt;th&gt;cash saves&lt;/th&gt;
&lt;th&gt;put saves&lt;/th&gt;
&lt;th&gt;crisis-put saves&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1.00&lt;/td&gt;
&lt;td&gt;5.9 pts&lt;/td&gt;
&lt;td&gt;7.4 pts&lt;/td&gt;
&lt;td&gt;3.4 pts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.75&lt;/td&gt;
&lt;td&gt;11.2 pts&lt;/td&gt;
&lt;td&gt;33.9 pts&lt;/td&gt;
&lt;td&gt;29.9 pts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.50&lt;/td&gt;
&lt;td&gt;12.3 pts&lt;/td&gt;
&lt;td&gt;39.3 pts&lt;/td&gt;
&lt;td&gt;35.3 pts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.25&lt;/td&gt;
&lt;td&gt;12.7 pts&lt;/td&gt;
&lt;td&gt;41.7 pts&lt;/td&gt;
&lt;td&gt;37.7 pts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;8.8 pts&lt;/td&gt;
&lt;td&gt;22.1 pts&lt;/td&gt;
&lt;td&gt;18.1 pts&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two findings, both in the real numbers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First: the options garment dominates the cash garment in the tail, and the gap widens as policy capacity drains.&lt;/strong&gt; At C = 1.00, put and cash are close (7.4 vs 5.9 points saved at the 1st percentile). At C = 0.25, put saves 41.7 points against cash's 12.7 — the same 2% cost buys 3.3x more tail protection when the backstop is depleted. The reason is the truncation geometry: cash scales a -63.7% tail to -51.0%, put pins it at -22.0%. When the market's own backstop is probabilistic (Part 18), the private garment with a hard cap is the one that actually guarantees a floor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second, and more important: the options garment's clock is the renewal, and it is exactly the Part 18 structure in miniature.&lt;/strong&gt; Locked at 2%, the put improves both mean and p1 at every capacity level. Repriced at 6% — the survey's crisis renewal, 2-3x — the same garment &lt;strong&gt;drags the mean below bare&lt;/strong&gt; in the calm world: at C = 1.00, mean worsens from -21.5% (locked) to -25.5% (renewed), worse than bare's -24.6%. The 6% premium now exceeds the average payout. In the depleted world the renewed put still rescues (-25.9% vs bare -47.1%), but the insurance has quietly become much more expensive exactly at the moment it matters most.&lt;/p&gt;

&lt;p&gt;This is the retail version of "pushing on a string": the policy clock of Part 18 — policy is weakest when most needed — has a private-market twin. Your protection is repriced by the same crisis that makes you need it. The put you roll in a panic costs 3x the put you bought in calm. The cash garment has no such repricing: it is the only asset class with capacity 1.0 by construction.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. What the numbers say a retail investor should do
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Wear both, in layers, and buy the options when they are cheap.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The cash garment is the foundation. It is deterministic, it never fails, its failure mode is behavioral (spending it, panic-deploying it) rather than priced. At every capacity level it improves both mean and tail for 2% a year. There is no market state in which cash is not there.&lt;/p&gt;

&lt;p&gt;The options garment is the tail floor, and its purchase timing is the whole game. The 2% locked put and the 6% crisis put have identical payouts and wildly different economics: one improves the mean at every C, the other drags the mean in calm worlds. The difference is not the instrument — it is when you bought it. The rule writes itself: &lt;strong&gt;buy the umbrella in the sun&lt;/strong&gt;. Implied volatility is the price of protection, and implied volatility is mean-reverting and crisis-spiking. If you wait for the crisis to buy insurance, you are buying the most expensive insurance at the moment the tail is most likely.&lt;/p&gt;

&lt;p&gt;And the Part 18 link makes the timing concrete. Policy capacity is the clock: rate paths, balance-sheet run-off, debt trajectories, central-bank independence. As the clock reads down (C falling), the value of the options garment rises — 7.4 points saved at C = 1.00, 41.7 at C = 0.25. The correct retail behavior is not to predict the crisis; it is to hold the deterministic layer always, and to buy the probabilistic layer while the implied-volatility price still reflects a world in which the backstop looks intact. The market prices the promise. You price the capacity. The clock is read in the tail, and the garment is bought before the clock reads.&lt;/p&gt;

&lt;p&gt;Cost-wise, both garments run about 2% of portfolio per year. That is the price of the underwear: a deliberate, recurring, small premium against the region of the distribution where the previous three parts live. The alternative — no garment — is the bare column of the table above.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Where this leaves the series
&lt;/h2&gt;

&lt;p&gt;Part 18 priced the backstop's clock. Part 19 prices the retail garment that has to exist when the backstop is probabilistic: cash is the deterministic layer (capacity 1.0, always there, bought with opportunity cost), options are the probabilistic layer (hard tail floor, bought cheap or not at all, repriced by the same crisis that creates the need). The two garments cost the same and protect differently; the options garment's clock is its renewal, and the correct response to that clock is to buy protection when its price still assumes the backstop is intact.&lt;/p&gt;

&lt;p&gt;The remaining question, and the natural next part: the cash garment's failure mode is behavioral — panic, spending, redeployment at the worst moment. If the numbers say wear both, the discipline of wearing them is a behavioral problem, not a modeling one. That is Part 20.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Code: &lt;code&gt;crash_simulator_v10/retail_underwear.py&lt;/code&gt; (V10-P7), self-test and Monte Carlo included. Deterministic, stdlib only, 256 lines. Numbers above are exact output with seed 20260921, market losses from the P4/P6 machinery.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Survey anchors: protective-put cost structures (1-3%/yr for 10-20% OTM, rolled; 2-5x repricing in crisis); March 2020 (VIX 14-&amp;gt;82, S&amp;amp;P -33.9% in 23 days, protection 1% -&amp;gt; 5-10%); cash opportunity cost (0.8-1.2%/yr moderate over-allocation); and the series' own Parts 15-18 modules and seed.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Available for freelance work — Python pipelines, quantitative risk tooling, AI data automation. Reach me at &lt;a href="mailto:gopipibank@gmail.com"&gt;gopipibank@gmail.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI assistance; facts, figures, and errors are the author's own.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@winstonchen?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Winston Chen&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/a-full-moon-is-reflected-in-the-water-_OOQ-YbLdfw?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>quantitative</category>
      <category>opensource</category>
      <category>python</category>
    </item>
    <item>
      <title>The Backstop's Clock: Policy Space Is a Depleting Resource</title>
      <dc:creator>Feng Yu</dc:creator>
      <pubDate>Sat, 26 Sep 2026 09:41:41 +0000</pubDate>
      <link>https://dev.to/fengyugbt/the-backstops-clock-policy-space-is-a-depleting-resource-36kd</link>
      <guid>https://dev.to/fengyugbt/the-backstops-clock-policy-space-is-a-depleting-resource-36kd</guid>
      <description>&lt;p&gt;&lt;em&gt;Fat Tail Notes · Part 18 · V10-P6&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Part 12 priced the twenty-day window — the clock that runs inside a crisis, from the first margin call to the backstop's arrival. Today we price the other clock: the one that runs &lt;em&gt;across&lt;/em&gt; crises, on the policy space itself. In July 2007 the Federal Reserve had 5.25 percentage points of interest-rate room. In December 2008 it had a target band of zero to 25 basis points, and it stayed there for seven years. Policy space is not infinite. It is a depleting resource, and our simulator says the market starts pricing the depletion in the tail long before the headline numbers move.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The evidence that policy space is a depleting resource
&lt;/h2&gt;

&lt;p&gt;Three literatures, again none of them ours, again all pointing the same way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Monetary space hits a floor.&lt;/strong&gt; Eggertsson and Woodford's &lt;em&gt;Zero Bound on Interest Rates and Optimal Monetary Policy&lt;/em&gt; (2003, one of the most cited papers in this literature) formalized what Japan had already shown: at the zero lower bound, the usual remedy — lower short rates — is unavailable, and unconventional policy works only through expectations. Woodford's 2012 survey of lower-bound accommodation is the practical sequel: once the rate is pinned, every additional unit of stimulus has to be borrowed from credibility, forward guidance, and balance-sheet size. The Fed's own history is the cleanest example: 5.25% in mid-2007, zero-to-25bp by December 2008, and no meaningful headroom for a decade. The resource was spent, not just used.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The effect weakens exactly when it is most needed.&lt;/strong&gt; Tenreyro and Thwaites' &lt;em&gt;Pushing on a String&lt;/em&gt; finds that US monetary policy is systematically less powerful in recessions than in expansions — the elasticity of the response to a policy shock falls in the state where stimulus matters most. This is the "pushing on a string" intuition with data behind it, and it has a long pedigree: after the Great Depression, mainstream economics spent decades assuming easy money was powerless against a slump. If policy is weaker in the very state where it is deployed, then the same policy space buys less rescue per unit — a second kind of depletion on top of the first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fiscal space is the insurance, and it can run out.&lt;/strong&gt; Romer and Romer's &lt;em&gt;Fiscal Space and the Aftermath of Financial Crises&lt;/em&gt; (Brookings Papers, 2019) studies 30 countries over 1980–2017: countries that entered financial distress with lower debt-to-GDP ratios responded with far more expansionary fiscal policy and suffered far milder aftermaths. Their message is almost a policy version of our leverage subsidy: maintaining fiscal space in normal times is the insurance that makes crisis response possible. Kose, Kurlat, Ohnsorge and Sugawara's cross-country fiscal space database (up to 200 countries, 1990–2016) shows the resource is real, measurable, and depleted in crises. And Salamaliki and Venetis document that market participants' concern about fiscal space is &lt;strong&gt;nonlinear&lt;/strong&gt; — the market does not price the loss of the first unit of space like the last.&lt;/p&gt;

&lt;p&gt;All three say the same structural thing: the backstop has ammunition, ammunition is finite, and the market knows it.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The model: leverage is deterministic, protection is probabilistic
&lt;/h2&gt;

&lt;p&gt;Parts 15–17 treated market leverage λ as an exogenous distribution — the world the backstop creates. Part 18 makes it endogenous to policy capacity C. The backstop's capacity C ∈ [0,1] maps to two things: the probability the backstop actually fires on a given path, and the leverage the market books against that promise.&lt;/p&gt;

&lt;p&gt;The structure is the whole point: &lt;strong&gt;leverage is booked deterministically on the promise; protection is delivered probabilistically from capacity.&lt;/strong&gt; As C falls, the same high-leverage book faces a smaller chance of rescue. We call the paths where leverage is held but protection never arrives &lt;em&gt;betrayed&lt;/em&gt; paths. All numbers below are exact output of &lt;code&gt;policy_space.py&lt;/code&gt; (V10-P6), seed 20260921, 2,000 paths per level.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;C&lt;/th&gt;
&lt;th&gt;trigger&lt;/th&gt;
&lt;th&gt;market λ&lt;/th&gt;
&lt;th&gt;mean&lt;/th&gt;
&lt;th&gt;p10&lt;/th&gt;
&lt;th&gt;p1&lt;/th&gt;
&lt;th&gt;worst&lt;/th&gt;
&lt;th&gt;&amp;gt;30% paths&lt;/th&gt;
&lt;th&gt;betrayed&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1.00&lt;/td&gt;
&lt;td&gt;100%&lt;/td&gt;
&lt;td&gt;~N(1.35,0.25)&lt;/td&gt;
&lt;td&gt;-24.6%&lt;/td&gt;
&lt;td&gt;-27.6%&lt;/td&gt;
&lt;td&gt;-29.4%&lt;/td&gt;
&lt;td&gt;-31.5%&lt;/td&gt;
&lt;td&gt;0.4%&lt;/td&gt;
&lt;td&gt;0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.75&lt;/td&gt;
&lt;td&gt;75%&lt;/td&gt;
&lt;td&gt;~N(1.50,0.30)&lt;/td&gt;
&lt;td&gt;-30.7%&lt;/td&gt;
&lt;td&gt;-47.8%&lt;/td&gt;
&lt;td&gt;-55.9%&lt;/td&gt;
&lt;td&gt;-61.6%&lt;/td&gt;
&lt;td&gt;27.2%&lt;/td&gt;
&lt;td&gt;25.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.50&lt;/td&gt;
&lt;td&gt;50%&lt;/td&gt;
&lt;td&gt;~N(1.75,0.35)&lt;/td&gt;
&lt;td&gt;-38.6%&lt;/td&gt;
&lt;td&gt;-55.4%&lt;/td&gt;
&lt;td&gt;-61.3%&lt;/td&gt;
&lt;td&gt;-66.1%&lt;/td&gt;
&lt;td&gt;54.9%&lt;/td&gt;
&lt;td&gt;50.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.25&lt;/td&gt;
&lt;td&gt;25%&lt;/td&gt;
&lt;td&gt;~N(2.00,0.40)&lt;/td&gt;
&lt;td&gt;-47.1%&lt;/td&gt;
&lt;td&gt;-60.5%&lt;/td&gt;
&lt;td&gt;-63.7%&lt;/td&gt;
&lt;td&gt;-66.1%&lt;/td&gt;
&lt;td&gt;80.5%&lt;/td&gt;
&lt;td&gt;75.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;0%&lt;/td&gt;
&lt;td&gt;λ=1.0 (no promise)&lt;/td&gt;
&lt;td&gt;-33.9%&lt;/td&gt;
&lt;td&gt;-41.0%&lt;/td&gt;
&lt;td&gt;-44.1%&lt;/td&gt;
&lt;td&gt;-46.7%&lt;/td&gt;
&lt;td&gt;84.4%&lt;/td&gt;
&lt;td&gt;0%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  3. The clock reads in the tail first
&lt;/h2&gt;

&lt;p&gt;Compare each level to the full-capacity world (C = 1.00):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;C&lt;/th&gt;
&lt;th&gt;mean drift&lt;/th&gt;
&lt;th&gt;p1 drift&lt;/th&gt;
&lt;th&gt;paths &amp;gt; 30%&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0.75&lt;/td&gt;
&lt;td&gt;-6.1 pts&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-26.5 pts&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0.4% → 27.2%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.50&lt;/td&gt;
&lt;td&gt;-14.0 pts&lt;/td&gt;
&lt;td&gt;-31.9 pts&lt;/td&gt;
&lt;td&gt;54.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.25&lt;/td&gt;
&lt;td&gt;-22.5 pts&lt;/td&gt;
&lt;td&gt;-34.3 pts&lt;/td&gt;
&lt;td&gt;80.5%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The mean is the last number to move. The first 25% of capacity loss costs 6.1 points of mean — and 26.5 points at the 1st percentile. By the time the headline has deteriorated by a dramatic-looking 22.5 points, the p1 has already moved 34.3 and four out of five paths are crossing the 30% cascade line. If you are watching the mean — the way press coverage, most risk models, and the Bornstein-Lorenzoni welfare function do — the backstop looks intact until it is catastrophic. The policy space clock is read from the tail; the headline is the lagging indicator.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. The most dangerous policy space is believed but depleted
&lt;/h2&gt;

&lt;p&gt;Here is the finding that the model was not designed to produce. Look at the last two rows: C = 0.25 is &lt;strong&gt;worse&lt;/strong&gt; than C = 0. The fully-depleted, no-promise world has p1 of -44.1% and mean of -33.9%. The quarter-capacity world — where the market still believes in a backstop that fires one time in four — has p1 of -63.7% and mean of -47.1%.&lt;/p&gt;

&lt;p&gt;Why? Because in the C = 0 world, no one books leverage on a promise that does not exist. Leverage returns to its exogenous 1.0, and the loss distribution is the honest no-backstop one. In the C = 0.25 world, the promise still exists in the market's head: leverage is booked at λ ~ 2.0 — &lt;em&gt;higher&lt;/em&gt; than in the full-capacity world, because the market front-runs the scarcity — and then protection arrives on only 25% of paths. 75% of the time, the book is betrayed: levered for a backstop that does not come.&lt;/p&gt;

&lt;p&gt;This is the policy analogue of a margin spiral: &lt;strong&gt;credibility is the collateral, and the market prices it.&lt;/strong&gt; The resource is not just depleted; it is dangerous precisely because it remains &lt;em&gt;believed&lt;/em&gt; while depleted. There is a discontinuity — a credibility cliff — between "the backstop is weak" and "the backstop is gone." Between those two points, the market books maximum leverage against minimum protection.&lt;/p&gt;

&lt;p&gt;The real-world mapping is uncomfortable. The Fed's balance sheet, the fiscal headroom in a debt-to-GDP ratio, the central bank's independence, the political will to let a lender of last resort be a lender of &lt;em&gt;unlimited&lt;/em&gt; resort — all of these are capacity variables, and all of them can sit at values where the market still believes but the capacity is a fraction of what the belief assumes. The worst policy space is not the empty one. It is the one that is half-believed.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. What this means for a retail investor
&lt;/h2&gt;

&lt;p&gt;Three rules again, none requiring a forecast.&lt;/p&gt;

&lt;p&gt;First, &lt;strong&gt;"the backstop exists" and "the backstop is credible" are different variables, and only the second one matters.&lt;/strong&gt; When a central bank says it has tools, the market does not price the tools; it prices the difference between the promise and the capacity. The news cycle gives you the promise. The tail prices the capacity. Your job is to notice when the two start to diverge.&lt;/p&gt;

&lt;p&gt;Second, &lt;strong&gt;policy space is a leading indicator that lives in boring places.&lt;/strong&gt; Interest-rate paths, balance-sheet run-off schedules, debt-to-GDP trajectories, debt-ceiling standoffs, central-bank independence fights — each of these is a reading of the clock. You do not need to model the Fed. You need to know whether the resource the market is levering against is rising or falling, because the tail prices the second derivative long before the headline prints the first.&lt;/p&gt;

&lt;p&gt;Third, &lt;strong&gt;the most dangerous moment is not "the backstop failed" — it is "the backstop is expected and weak."&lt;/strong&gt; Our table says the leverage cycle peaks in the depleted-but-believed zone. That is the moment to ask what your own book looks like if protection arrives with probability 25%: not "will the Fed act?" but "is my position priced as if the Fed certainly acts?" The first question is about the news. The second is about you.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Where this leaves the series
&lt;/h2&gt;

&lt;p&gt;Part 12 gave the twenty-day window a clock. Part 18 gives the backstop itself a clock, and the clock reads in the tail: mean first to look fine, first to be believed, last to warn. The three literatures — ZLB, pushing on a string, fiscal space — and our simulator agree: policy space is a depleting resource, its price is nonlinear, and the market books leverage against the promise while protection is only as real as the capacity behind it.&lt;/p&gt;

&lt;p&gt;The uncomfortable next question, and the one this series has been walking toward since Part 11: if the backstop has a clock, and the clock is read in the tail, what does the retail investor's own book look like when protection is probabilistic? The underwear we keep saying retail investors need — what does it actually consist of, and what does it cost? That is Part 19.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Code: &lt;code&gt;crash_simulator_v10/policy_space.py&lt;/code&gt; (V10-P6), self-test and Monte Carlo included. Deterministic, stdlib only, 212 lines. Numbers above are exact output with seed 20260921.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Papers: Eggertsson &amp;amp; Woodford, "The Zero Bound on Interest Rates and Optimal Monetary Policy" (2003); Woodford, "Methods of Policy Accommodation at the Interest-Rate Lower Bound" (2012); Tenreyro &amp;amp; Thwaites, "Pushing on a String" (2016); Romer &amp;amp; Romer, "Fiscal Space and the Aftermath of Financial Crises" (BPEA, 2019); Kose, Kurlat, Ohnsorge &amp;amp; Sugawara, "A Cross-Country Database of Fiscal Space"; Salamaliki &amp;amp; Venetis (2023); plus the series' own P4/P5 modules and seed 20260921 Monte Carlo.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Available for freelance work — Python pipelines, quantitative risk tooling, AI data automation. Reach me at &lt;a href="mailto:gopipibank@gmail.com"&gt;gopipibank@gmail.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI assistance; facts, figures, and errors are the author's own.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@zoltantasi?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Zoltan Tasi&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/grayscale-photo-of-sea-waves-crashing-on-concrete-wall-bjjTsPATZ_w?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>quantitative</category>
      <category>python</category>
      <category>opensource</category>
    </item>
    <item>
      <title>The Expensive Sixth Point: Convexity, Thresholds, and the Price of Tail Risk</title>
      <dc:creator>Feng Yu</dc:creator>
      <pubDate>Fri, 25 Sep 2026 04:34:17 +0000</pubDate>
      <link>https://dev.to/fengyugbt/the-expensive-sixth-point-convexity-thresholds-and-the-price-of-tail-risk-4dch</link>
      <guid>https://dev.to/fengyugbt/the-expensive-sixth-point-convexity-thresholds-and-the-price-of-tail-risk-4dch</guid>
      <description>&lt;p&gt;&lt;em&gt;Fat Tail Notes · Part 17 · V10-P5&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Last week we argued that the disagreement over the Greenspan put is a measurement problem: expected welfare has no tail, and tail risk has no average. This week we price the tail properly, and the price turns out to be worse than the mean tells you. A -25% drawdown and a -31% drawdown differ by six points. Their social costs do not differ by six points. The sixth point is the expensive one.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The evidence that crisis costs are convex
&lt;/h2&gt;

&lt;p&gt;Before our own numbers, three independent literatures, none of them ours, all say the same thing: the damage function is not linear in the size of the crisis.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Persistence.&lt;/strong&gt; Cerra and Saxena's &lt;em&gt;Growth Dynamics: The Myth of Economic Recovery&lt;/em&gt; (2008) is the canonical statement: contractions are not followed by offsetting fast recoveries. On average, the trend output lost is never regained; the output costs of financial crises are permanent. A recent study of 180 economic disasters across 38 countries (Ori &amp;amp; Peri, 2023) is more specific: output loss surges past 26% in the first years after an extreme crisis and stays above 20% for as long as twenty years; full recovery takes over fifty years. Boyd, Kwak and Smith (2005) compute present values: average crisis-related losses are between 63% and 302% of pre-crisis per-capita GDP, because post-crisis slowdowns persist long after the crisis is "officially" over. A 25% drawdown that recovers is a cost. A 31% drawdown that does not recover is a different species of cost.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Heavy-tailed severity.&lt;/strong&gt; Laeven and Valencia's systemic banking crises database (151 episodes, 1970–2017) is the standard distribution of crisis outcomes, and it is not a thin-tailed one. Kapp and Vega take the logical next step for our purposes: they apply the insurance industry's Loss Distribution Approach — frequency times severity, exactly the catastrophe-modeling machinery this series started from — to financial crises, and estimate a multi-country GDP loss distribution. The catastrophe framework is not an analogy we borrowed to look sophisticated. It is the correct tool, because crisis losses behave like disaster losses: rare, severe, and heavy-tailed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Political aftershocks.&lt;/strong&gt; Funke, Schularick and Trebesch (&lt;em&gt;Going to Extremes: Politics after Financial Crises, 1870–2014&lt;/em&gt;) study 800+ elections across 20 advanced economies. After a financial crisis, far-right parties gain, on average, 30% in vote share — and critically, they find &lt;em&gt;no such dynamics in normal recessions or non-financial macroeconomic shocks&lt;/em&gt;. Mian, Sufi and Trebbi document the mechanism: crises polarize voters, weaken ruling coalitions, and reduce the odds of exactly the financial reforms that would help. The tail event does not just destroy wealth; it changes the political system that decides how the losses are distributed. No linear cost function contains that.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Three lenses on the same Monte Carlo table
&lt;/h2&gt;

&lt;p&gt;Our simulator draws 2,000 shocks, seed 20260921, and runs them through two worlds: exogenous leverage (λ = 1.0) and policy-endogenous leverage (λ drawn above 1 — the world the backstop creates). Last week we published the mean, p10, and p1 columns. This week we add two cost columns: a power cost C(L) = (−L)², and a threshold cost that adds a fixed jump once the drawdown crosses 30% — the regime where cascades, dealer gamma flips, liquidity gaps, and political aftershocks begin. All numbers below are exact output of &lt;code&gt;crisis_cost_nonlinearity.py&lt;/code&gt; (V10-P5), same seed, same 2,000 paths as Part 15 and 16.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;scenario&lt;/th&gt;
&lt;th&gt;mean&lt;/th&gt;
&lt;th&gt;p10&lt;/th&gt;
&lt;th&gt;p1&lt;/th&gt;
&lt;th&gt;E[C²]&lt;/th&gt;
&lt;th&gt;E[C_thr]&lt;/th&gt;
&lt;th&gt;paths &amp;gt; 30%&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;no backstop, λ=1.0&lt;/td&gt;
&lt;td&gt;-34.1%&lt;/td&gt;
&lt;td&gt;-41.0%&lt;/td&gt;
&lt;td&gt;-43.9%&lt;/td&gt;
&lt;td&gt;0.1245&lt;/td&gt;
&lt;td&gt;0.7701&lt;/td&gt;
&lt;td&gt;85.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;backstop, λ=1.0&lt;/td&gt;
&lt;td&gt;-21.3%&lt;/td&gt;
&lt;td&gt;-23.2%&lt;/td&gt;
&lt;td&gt;-24.8%&lt;/td&gt;
&lt;td&gt;0.0473&lt;/td&gt;
&lt;td&gt;0.2134&lt;/td&gt;
&lt;td&gt;0.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;backstop, λ~N(1.35,0.25)&lt;/td&gt;
&lt;td&gt;-24.5%&lt;/td&gt;
&lt;td&gt;-27.5%&lt;/td&gt;
&lt;td&gt;-29.4%&lt;/td&gt;
&lt;td&gt;0.0616&lt;/td&gt;
&lt;td&gt;0.2466&lt;/td&gt;
&lt;td&gt;0.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;backstop, λ~N(1.5,0.30)&lt;/td&gt;
&lt;td&gt;-25.5%&lt;/td&gt;
&lt;td&gt;-28.4%&lt;/td&gt;
&lt;td&gt;-30.4%&lt;/td&gt;
&lt;td&gt;0.0663&lt;/td&gt;
&lt;td&gt;0.2632&lt;/td&gt;
&lt;td&gt;1.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;backstop, λ~N(1.75,0.35)&lt;/td&gt;
&lt;td&gt;-26.9%&lt;/td&gt;
&lt;td&gt;-29.5%&lt;/td&gt;
&lt;td&gt;-31.1%&lt;/td&gt;
&lt;td&gt;0.0732&lt;/td&gt;
&lt;td&gt;0.2973&lt;/td&gt;
&lt;td&gt;5.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Lens one — the mean.&lt;/strong&gt; The backstop rescues the mean by 12.8 points (-34.1% → -21.3%). Endogenous leverage eats 5.6 of those back (-21.3% → -26.9%), 44% of the rescue. By this lens, the policy is doing its job, with some slippage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lens two — convex cost.&lt;/strong&gt; Under C(L) = (−L)², the same rescue is worth 0.077 cost units (0.1245 → 0.0473); endogenous leverage eats 0.026, 34%. Notice something important: the &lt;em&gt;share&lt;/em&gt; eaten is smaller than under the mean. That is Jensen's inequality working for the policy for once — the rescue is concentrated where the squared cost is largest, so the convexity magnifies the rescue as well as the erosion. The honest reading is not "convexity makes moral hazard smaller"; it is that both the value of the policy and the cost of the leverage it induces live in the tail, and the mean can only report their average.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lens three — the threshold.&lt;/strong&gt; This is the uncomfortable one. The exogenous backstop puts the 1st percentile at -24.8%, safely inside the 30% line; only 0.1% of paths cross it. Let leverage become endogenous at λ~N(1.75, 0.35) and the p1 moves to -31.1% — &lt;strong&gt;across the threshold&lt;/strong&gt; — and the share of paths in the cascade zone rises 57-fold, from 0.1% to 5.7%. Expected threshold cost rises from 0.2134 to 0.2973, a 39% increase in the cost the policy exists to prevent.&lt;/p&gt;

&lt;p&gt;The mean does not see this. In mean terms, the λ~1.75 world sits at -26.9%, still 7.2 points away from the no-backstop world — the rescue, by that measure, still looks structurally intact. The tail tells a different story: the worst 1% of outcomes has already crossed the line the policy promised to defend. Six points of mean slippage look like a second-order correction. Six points at the 1st percentile are a first-order regime change.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The patient, again, with better measurements
&lt;/h2&gt;

&lt;p&gt;Last week's doctor analogy: the painkiller lowers mean pain from 7 to 4 but worsens the worst day from 9 to 10. This week we add the detail the doctor was missing. The question is not just "what is the worst day now?" It is "what happens when a patient crosses the line where the injury stops healing?" A 9 and a 10 on the pain scale are one point apart. But if 10 is the day the patient's joint gives out, the difference is not one point of pain — it is a joint that no longer works. That is what a threshold does: it converts a small difference on the measurement scale into a categorical difference in the outcome.&lt;/p&gt;

&lt;p&gt;The leverage the backstop induces is a subsidy to stand closer to the threshold. Most of the time it looks harmless — that is what 0.1% vs 5.7% means from the outside: rare. But "rare" is exactly the object this series has been modeling since Part 1, and the probability is not a constant; it is a function of the policy itself. The exogenous world put the worst percentile inside the line. The endogenous world puts it across.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. What this means for a retail investor
&lt;/h2&gt;

&lt;p&gt;Three rules fall out of the threshold view, and none of them requires you to forecast the next crisis.&lt;/p&gt;

&lt;p&gt;First, &lt;strong&gt;price the tail with a convex function, not an average.&lt;/strong&gt; If you estimate your crisis risk by expected loss, you are using the lens that hides the threshold-crossing. The difference between "protect the p1" and "improve the mean" is not a nuance; it is the whole argument about what insurance is for. Retail investors rarely do the first. That is the gap this series keeps circling.&lt;/p&gt;

&lt;p&gt;Second, &lt;strong&gt;the policy floor has a location, and it moves.&lt;/strong&gt; A backstop is not a flat guarantee; it is a line in the distribution, and the line's effective position depends on how much leverage it induces. When you hear "the Fed put is back," ask not whether it exists but &lt;em&gt;where&lt;/em&gt; it sits in the current book structure. The same policy that looked like a floor at -25% looks like a trap at -31%, because by then the cascade and the politics are already doing their work.&lt;/p&gt;

&lt;p&gt;Third, &lt;strong&gt;"six more points" is the wrong mental unit.&lt;/strong&gt; The cost difference between -25% and -31% is not 6/25 of your loss — it is the probability-weighted cost of everything beyond the threshold: forced liquidations, gamma flips, policy-space exhaustion, and the political aftershocks that turn a market event into a regulatory one. The sixth point buys you across the line. That is why tail hedges that look expensive in calm markets are not overpriced; they are priced against the threshold, and the threshold is what the leverage cycle quietly moves toward you.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Where this leaves the series
&lt;/h2&gt;

&lt;p&gt;Part 16 said the moral-hazard debate is really a measurement debate. Part 17 says the measurement that matters is convex and thresholded, not linear and averaged. The academic literatures — persistence, severity distribution, political aftershock — are consistent with each other and with our simulator: the backstop's value and its cost are both in the tail, and the mean cannot arbitrate between them.&lt;/p&gt;

&lt;p&gt;A note on method: this series has now published numbers from four V10 modules (backstop, expectations, anticipation, moral hazard) and this one (convex cost), all deterministic, all self-tested, all reproducible with the same seed. The numbers in this post are the exact output of &lt;code&gt;crash_simulator_v10/crisis_cost_nonlinearity.py&lt;/code&gt; (V10-P5), 204 lines of dependency-free Python with a self-test, run with the series' standard seed. If you can run Python, you can check every number above in under a minute.&lt;/p&gt;

&lt;p&gt;Next: if the tail is priced by a threshold, the next question is what happens when the policy space itself is the constraint — the day the backstop cannot backstop. The twenty-day window had a clock. The backstop may have one too.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Code: &lt;code&gt;crash_simulator_v10/crisis_cost_nonlinearity.py&lt;/code&gt; (V10-P5), self-test and Monte Carlo included. Deterministic, stdlib only, 204 lines. Numbers above are exact output with seed 20260921.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Papers: Cerra &amp;amp; Saxena, "Growth Dynamics: The Myth of Economic Recovery" (2008); Ori &amp;amp; Peri, "Recovery from Economic Disasters" (2023); Boyd, Kwak &amp;amp; Smith (2005); Laeven &amp;amp; Valencia, "Systemic Banking Crises Database II" (IMF, 2020); Kapp &amp;amp; Vega, "Real Output Costs of Financial Crises: A Loss Distribution Approach"; Funke, Schularick &amp;amp; Trebesch, "Going to Extremes: Politics after Financial Crises, 1870–2014"; Mian, Sufi &amp;amp; Trebbi, "Resolving Debt Overhang" (2014).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Available for freelance work — Python pipelines, quantitative risk tooling, AI data automation. Reach me at &lt;a href="mailto:gopipibank@gmail.com"&gt;gopipibank@gmail.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI assistance; facts, figures, and errors are the author's own.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@nikolayh?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Nikolay Hristov&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/storm-on-sea-9DBQ4D_LwNk?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>quantitative</category>
      <category>python</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Moral Hazard Is Not a Misconception — It's a Measurement Problem</title>
      <dc:creator>Feng Yu</dc:creator>
      <pubDate>Thu, 24 Sep 2026 11:29:22 +0000</pubDate>
      <link>https://dev.to/fengyugbt/moral-hazard-is-not-a-misconception-its-a-measurement-problem-en6</link>
      <guid>https://dev.to/fengyugbt/moral-hazard-is-not-a-misconception-its-a-measurement-problem-en6</guid>
      <description>&lt;p&gt;&lt;em&gt;Fat Tail Notes · Part 16 · V10-P4 revisited&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Last week this series argued that a backstop builds the tail it truncates: once leveraged accounts believe the policy will cap their losses, leverage rises, and the same shock lands on bigger books. A real academic paper is now arguing the opposite — and it is not a blog post, it is IMF-published research. Gideon Bornstein and Guido Lorenzoni's &lt;em&gt;Moral Hazard Misconceptions: The Case of the Greenspan Put&lt;/em&gt; (2018) makes the case that the fear of the Fed put is, in their words, a misconception: under optimal discretionary intervention, borrowing rises but overborrowing disappears, and ex-post intervention becomes a substitute for ex-ante regulation.&lt;/p&gt;

&lt;p&gt;My first reaction after reading it was to concede. My second reaction was that this is not a dispute about who is right. It is a dispute about which moment of the loss distribution you are willing to optimize. And the third, most uncomfortable finding: our own Part 15 contained a data error in two of its mean figures. This post fixes that too, because if you want readers to trust your tail numbers, you correct your center numbers in public.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What the paper actually says
&lt;/h2&gt;

&lt;p&gt;The model is a three-period economy with a levered agent (B) who holds the risky asset, financed by debt from a patient saver (A), with sticky prices and an aggregate-demand externality. The mechanism runs through the labor wedge: a larger debt stock worsens recessions because debt payments transfer resources from high-propensity borrowers to low-propensity lenders, dragging down output exactly when output is already too low.&lt;/p&gt;

&lt;p&gt;The paper compares three monetary regimes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Inertial&lt;/strong&gt;: the central bank sets the interest rate before seeing the shock. The shock is uninsured, the aggregate-demand externality is live, and there is &lt;em&gt;overborrowing&lt;/em&gt; — a marginal welfare loss from debt (dW/dD &amp;lt; 0). This is the textbook case for macroprudential regulation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Proactive&lt;/strong&gt;: the central bank sets rates state-by-state after seeing the shock. With log preferences, it can fully stabilize asset prices and output — the Greenspan put at maximum potency. Borrowing goes &lt;em&gt;up&lt;/em&gt; (Proposition 2), but overborrowing goes to zero (Proposition 3): dW/dD = 0, so a borrowing tax buys nothing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Output targeting&lt;/strong&gt;: commits to the flexible-price allocation; coincides with the proactive regime in the log case.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The headline: more borrowing, less overborrowing. The put does not create the inefficiency that regulation exists to fix, so ex-post intervention and ex-ante macroprudential policy are &lt;em&gt;substitutes&lt;/em&gt;. Moral hazard as conventionally feared is a misconception.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The knife-edge they concede
&lt;/h2&gt;

&lt;p&gt;The full-results version is narrower than the headline, and the paper says so itself. The perfect-stabilization result is a knife-edge that requires log utility — an elasticity of intertemporal substitution of exactly one, where income and substitution effects cancel. Section 5 shows what happens away from that edge: once preferences are general CRRA, the central bank faces a tradeoff between output stabilization and financial stability, and the insurance motive pushes it to stabilize asset prices &lt;em&gt;beyond&lt;/em&gt; what output targeting requires.&lt;/p&gt;

&lt;p&gt;That is the telling part. &lt;strong&gt;In their own Section 5.2, the moment the central bank goes beyond output-gap targeting to prop up asset prices — the actual behavior people mean by "the put" — monetary policy and macroprudential policy become complements, and the optimal borrowing tax is &lt;em&gt;larger&lt;/em&gt; in the proactive regime than in the output-targeting regime.&lt;/strong&gt; The conventional moral-hazard result comes back. What the paper really shows is not "moral hazard is a misconception" but "moral hazard disappears exactly on the log-utility knife-edge where the put is a perfect insurance contract."&lt;/p&gt;

&lt;p&gt;There is a second, quieter assumption running through the whole paper: welfare is always evaluated as &lt;em&gt;expected&lt;/em&gt; utility, E[V^A + βV^B]. Every proposition is about the mean of the welfare distribution. Nothing in the model — not one equation — looks at the lower tail of the outcome distribution as a separate object.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. What our code says, on both accounts
&lt;/h2&gt;

&lt;p&gt;Here is the trap we built to show. Our Monte Carlo (2,000 paths, seed 20260921) lets leverage be either exogenous (λ = 1.0) or policy-endogenous (λ drawn from a distribution with mean above 1 — the world the backstop creates). The same 2,000 shocks, two different worlds:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;scenario&lt;/th&gt;
&lt;th&gt;mean&lt;/th&gt;
&lt;th&gt;p10&lt;/th&gt;
&lt;th&gt;p1&lt;/th&gt;
&lt;th&gt;worst&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;no backstop, λ=1.0 (exogenous)&lt;/td&gt;
&lt;td&gt;-34.1%&lt;/td&gt;
&lt;td&gt;-41.0%&lt;/td&gt;
&lt;td&gt;-43.9%&lt;/td&gt;
&lt;td&gt;-49.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;backstop, λ=1.0 (exogenous)&lt;/td&gt;
&lt;td&gt;-21.3%&lt;/td&gt;
&lt;td&gt;-23.2%&lt;/td&gt;
&lt;td&gt;-24.8%&lt;/td&gt;
&lt;td&gt;-31.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;backstop, λ ~ N(1.35, 0.25)&lt;/td&gt;
&lt;td&gt;-24.5%&lt;/td&gt;
&lt;td&gt;-27.5%&lt;/td&gt;
&lt;td&gt;-29.4%&lt;/td&gt;
&lt;td&gt;-31.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;backstop, λ ~ N(1.5, 0.30)&lt;/td&gt;
&lt;td&gt;-25.5%&lt;/td&gt;
&lt;td&gt;-28.4%&lt;/td&gt;
&lt;td&gt;-30.4%&lt;/td&gt;
&lt;td&gt;-31.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;backstop, λ ~ N(1.75, 0.35)&lt;/td&gt;
&lt;td&gt;-26.9%&lt;/td&gt;
&lt;td&gt;-29.5%&lt;/td&gt;
&lt;td&gt;-31.1%&lt;/td&gt;
&lt;td&gt;-33.2%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Now read the same table through each paper's lens.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bornstein-Lorenzoni's lens — the mean.&lt;/strong&gt; The backstop rescues the mean by 12.8 points (-34.1% → -21.3%). Endogenous leverage eats 5.6 of those points back (-21.3% → -26.9% at λ~1.75), 44% of the mean rescue. By a mean-welfare standard, the policy is doing its job: it improves the average outcome massively, and the erosion, while real, is a second-order correction to a first-order rescue.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our lens — the tail.&lt;/strong&gt; The backstop's p1 rescue is 19.1 points (-43.9% → -24.8%) — the tail is where the policy's value is concentrated. Endogenous leverage eats 6.3 points of that tail (-24.8% → -31.1%), 33% of the p1 rescue, and shifts p10 from -23.2% to -29.5%. The rescue is not canceled, but the deepest outcomes the policy promises to prevent are precisely the ones drifting back toward the no-policy world.&lt;/p&gt;

&lt;p&gt;Same shocks, same policy, two defensible accounts. The disagreement is not in the mechanism — both accounts agree leverage responds to the put. The disagreement is in the objective function: &lt;strong&gt;expected welfare has no tail. Tail risk has no average.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Which measure is right? It depends on the cost of the tail.
&lt;/h2&gt;

&lt;p&gt;Here is the honest version of the argument. If the social cost of a crisis is proportional to the mean loss, Bornstein and Lorenzoni are right — the backstop is a clean win and the moral-hazard complaint is a distraction. But crisis costs are not proportional. A -25% drawdown and a -31% drawdown do not cost society in the same units: the second one crosses into forced selling cascades, dealer gamma flips, liquidity gaps, policy-space exhaustion, and the political aftershocks that turn a market event into a regulatory one. The cost function is convex in the loss, and convexity is exactly what expected utility with representative agents averages away.&lt;/p&gt;

&lt;p&gt;Two doctors see the same patient. Doctor A prescribes the painkiller because mean pain over the year falls from 7 to 4. Doctor B objects that the worst day — the day the patient overexerts because the painkiller masks the injury — went from 9 to 10. Both are reporting the same data. The patient's choice is which number the treatment is supposed to optimize. A central bank that only reports the mean is Doctor A reporting only the mean.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Their paper actually licenses our setup
&lt;/h2&gt;

&lt;p&gt;The most useful sentence in &lt;em&gt;Moral Hazard Misconceptions&lt;/em&gt; is the one that limits its own headline: complementarity — the return of moral hazard — appears "if the monetary authority goes over and above a simple objective of reducing the output gap." Our Part 12-15 series models exactly that kind of intervention: a &lt;em&gt;backstop&lt;/em&gt;, an explicit asset-price floor and liquidity guarantee, not a Taylor rule. We are not on their log-utility knife-edge where the put is a perfect insurance contract; we are in the regime their Section 5.2 shows to be the complementary one, where the put stabilizes asset prices beyond output targeting and the borrowing tax is &lt;em&gt;more&lt;/em&gt; valuable, not less.&lt;/p&gt;

&lt;p&gt;Which is why the two literatures converge on the same policy conclusion from opposite directions. Boissay and Uhlig's &lt;em&gt;Reserves and the Buyer of Last Resort&lt;/em&gt; (NBER w35548) calls it the market-backstop principle: make the backstop state-contingent and pair it with liquidity requirements that tax the behavior the backstop insures. Our Part 15 ended at the same place by simulation: ambiguity stops the front-run, but only a leverage rule stops the subsidy.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Correction and judgment
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Correction.&lt;/strong&gt; In the Part 15 Monte Carlo table, two mean figures were wrong: the no-backstop mean should be -34.1% (published as -42.3%) and the exogenous-backstop mean should be -21.3% (published as -24.6%). All p10, p1, and worst figures were correct. The corrected means change one sentence of that post's argument: the mean does move under endogenous leverage (-21.3% → -24.5% → -25.5% → -26.9%), it just moves less than the tail, and the rescue's value is concentrated in the tail either way. The stronger, corrected claim: &lt;strong&gt;the backstop's value lives in the tail, and the tail is also where the leverage it induces does the most damage.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Judgment.&lt;/strong&gt; For the retail investor, the academic argument over moral hazard is not the thing to resolve. Two facts survive it. First, in mean terms, interventions do hold the market up — the rescue is real, and betting against it is a fool's trade. Second, in tail terms, the same intervention is accumulating the leverage that will make the next floor deeper — the rescue is expensive, and it is priced in the distribution's tail, not its headline. A put is not permission to be naked; it is time to put on the underwear.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Code: &lt;code&gt;crash_simulator_v10/policy_moral_hazard.py&lt;/code&gt; (V10-P4), self-test and Monte Carlo included. Deterministic, 402 lines, no external dependencies. Correction committed alongside this post.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Paper: Bornstein &amp;amp; Lorenzoni, "Moral Hazard Misconceptions: The Case of the Greenspan Put" — gideon-bornstein.com/papers/Moral_Hazard_Greenspan_Put.pdf&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Available for freelance work — Python pipelines, quantitative risk tooling, AI data automation. Reach me at &lt;a href="mailto:gopipibank@gmail.com"&gt;gopipibank@gmail.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI assistance; facts, figures, and errors are the author's own.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@iamthedave?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Dave Hoefler&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/green-grass-field-under-gray-clouds-IRHNxX5y_hg?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>quantitative</category>
      <category>opensource</category>
    </item>
    <item>
      <title>The Leverage Subsidy: When the Backstop Builds the Tail It Truncates</title>
      <dc:creator>Feng Yu</dc:creator>
      <pubDate>Mon, 21 Sep 2026 05:38:42 +0000</pubDate>
      <link>https://dev.to/fengyugbt/the-leverage-subsidy-when-the-backstop-builds-the-tail-it-truncates-gog</link>
      <guid>https://dev.to/fengyugbt/the-leverage-subsidy-when-the-backstop-builds-the-tail-it-truncates-gog</guid>
      <description>&lt;p&gt;&lt;em&gt;Fat Tail Notes · Part 15 · V10-P4&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Part 14 showed that a transparent backstop gets front-run, and that a&lt;br&gt;
little noise — constructive ambiguity — breaks the front-run's aim. Part&lt;br&gt;
14 ended by asking what happens when the market learns that the rule is&lt;br&gt;
fuzzy. The answer this module gives is more uncomfortable than the&lt;br&gt;
question: &lt;strong&gt;the market does not have to learn the rule at all. It only&lt;br&gt;
has to learn that a backstop exists.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If leveraged accounts believe the policy will cap their losses, the&lt;br&gt;
equilibrium level of leverage rises. The same shock lands on bigger&lt;br&gt;
books with thinner margins. The tail the policy is trying to truncate is&lt;br&gt;
the tail it helped build. This is the Greenspan/Fed put debate, reduced&lt;br&gt;
to a kernel and measured.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The mechanism: leverage as a policy-endogenous variable
&lt;/h2&gt;

&lt;p&gt;V10-P4 scales the four margin buckets by a leverage multiplier λ, in two&lt;br&gt;
ways that both have real-world meaning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;bigger books&lt;/strong&gt;: every bucket's notional weight is multiplied by λ —
the same positions, more of them;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;thinner margins&lt;/strong&gt;: every bucket's trip threshold is divided by λ —
higher leverage means the same drawdown trips the position earlier.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;λ = 1.0 is the exogenous world: today's leverage, whatever it is, taken&lt;br&gt;
as given. λ &amp;gt; 1.0 is the world the backstop itself creates: once the&lt;br&gt;
market believes in the put, books grow and margins thin.&lt;/p&gt;

&lt;p&gt;On the calibration path the mechanism is clean:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;λ (leverage)&lt;/th&gt;
&lt;th&gt;no backstop&lt;/th&gt;
&lt;th&gt;backstop&lt;/th&gt;
&lt;th&gt;backstop saves&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1.0&lt;/td&gt;
&lt;td&gt;-36.5%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-22.8%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;13.7 pts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.5&lt;/td&gt;
&lt;td&gt;-46.0%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-27.6%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;18.4 pts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2.0&lt;/td&gt;
&lt;td&gt;-54.1%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-29.1%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;25.0 pts&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Read the backstop column vertically. The same policy, with the leverage&lt;br&gt;
it induces, truncates a &lt;strong&gt;deeper&lt;/strong&gt; tail every time: -22.8% → -27.6% →&lt;br&gt;
-29.1%. The backstop still helps — it helps a lot — but &lt;strong&gt;the hole it&lt;br&gt;
arrives at is a hole it dug&lt;/strong&gt;. The higher the leverage the backstop&lt;br&gt;
subsidizes, the deeper the tail it has to catch.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The structural error in the standard stress test
&lt;/h2&gt;

&lt;p&gt;Here is the trap. The standard way to stress-test a backstop is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;take today's observed leverage as given (λ = 1.0);&lt;/li&gt;
&lt;li&gt;simulate the no-backstop counterfactual with that same leverage;&lt;/li&gt;
&lt;li&gt;report the difference as "the value of the backstop."&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But that is an &lt;strong&gt;inconsistent world&lt;/strong&gt;. Today's leverage is not exogenous:&lt;br&gt;
it already contains the backstop's promise. If the policy works, λ = 1.0&lt;br&gt;
is the wrong input for both columns — too low for the with-backstop&lt;br&gt;
column (the backstop grew the books) and too high for the no-backstop&lt;br&gt;
column (without the put, the books would have been smaller). The&lt;br&gt;
standard test is optimistic by construction.&lt;/p&gt;

&lt;p&gt;Monte Carlo (2,000 paths, seed 20260921) makes the size of the error&lt;br&gt;
explicit:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;scenario&lt;/th&gt;
&lt;th&gt;mean&lt;/th&gt;
&lt;th&gt;p10&lt;/th&gt;
&lt;th&gt;p1&lt;/th&gt;
&lt;th&gt;worst&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;no backstop, λ=1.0 (exogenous)&lt;/td&gt;
&lt;td&gt;-42.3%&lt;/td&gt;
&lt;td&gt;-41.0%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-43.9%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;-49.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;backstop, λ=1.0 (exogenous)&lt;/td&gt;
&lt;td&gt;-24.6%&lt;/td&gt;
&lt;td&gt;-23.2%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-24.8%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;-31.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;backstop, λ ~ N(1.35, 0.25)&lt;/td&gt;
&lt;td&gt;-24.5%&lt;/td&gt;
&lt;td&gt;-27.5%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-29.4%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;-31.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;backstop, λ ~ N(1.5, 0.30)&lt;/td&gt;
&lt;td&gt;-25.5%&lt;/td&gt;
&lt;td&gt;-28.4%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-30.4%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;-31.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;backstop, λ ~ N(1.75, 0.35)&lt;/td&gt;
&lt;td&gt;-26.9%&lt;/td&gt;
&lt;td&gt;-29.5%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-31.1%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;-33.2%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The p1 column tells the whole story. On the exogenous assumption the&lt;br&gt;
backstop's p1 is -24.8% — a 19-point rescue from the -43.9% no-backstop&lt;br&gt;
world. Once leverage is allowed to respond, the rescue shrinks: &lt;strong&gt;-29.4%&lt;br&gt;
at λ ~ 1.35 (24% of the rescue eaten), -31.1% at λ ~ 1.75 (33% eaten).&lt;/strong&gt;&lt;br&gt;
The mean barely moves (-24.6% → -24.5% → -26.9%) because the backstop&lt;br&gt;
compresses averages hard; &lt;strong&gt;moral hazard bites the tail, not the mean.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The p10 column: where the systematic optimism lives
&lt;/h2&gt;

&lt;p&gt;The p10 comparison is the most uncomfortable for a risk modeler, because&lt;br&gt;
it is the part of the tail they quote most:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;scenario&lt;/th&gt;
&lt;th&gt;p10&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;backstop, λ=1.0 (exogenous)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-23.2%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;backstop, λ ~ N(1.35, 0.25)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-27.5%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;backstop, λ ~ N(1.75, 0.35)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-29.5%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;An exogenous-leverage model reports -23.2% as the 10th percentile of the&lt;br&gt;
post-policy world. A model that lets the policy act on leverage reports&lt;br&gt;
-27.5% to -29.5% for the same percentile. &lt;strong&gt;Four to six points of tail&lt;br&gt;
are invisible when leverage is treated as a given.&lt;/strong&gt; That is not a&lt;br&gt;
parameter error; it is a model-structure error.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. What this means
&lt;/h2&gt;

&lt;p&gt;Three claims, kernel-backed:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The backstop is a leverage subsidy.&lt;/strong&gt; The promise that losses will
be capped is an input to the leverage decision. The equilibrium tail
is endogenous to the policy, and it is deeper than the policy's own
headline number.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stress tests that hold leverage fixed are optimistic by
construction.&lt;/strong&gt; They understate the with-policy tail (books grew) and
overstate the no-policy counterfactual (books would have shrunk). The
honest comparison is policy → leverage → tail, not policy | leverage
→ tail.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Moral hazard bites the tail, not the mean.&lt;/strong&gt; If you only report
expected shortfall at the center of the distribution, the feedback
loop is invisible. It lives at p10 and below — exactly where tail
risk is supposed to be measured.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The uncomfortable policy corollary: if the backstop pays for the&lt;br&gt;
leverage that builds the tail, then the policy's optimal partner is not&lt;br&gt;
more ambiguity — it is &lt;strong&gt;directly taxing the leverage&lt;/strong&gt;: margin&lt;br&gt;
requirements, position limits, a counter-cyclical capital charge on the&lt;br&gt;
very books the put insures. Ambiguity stops the front-run; only a&lt;br&gt;
leverage rule stops the subsidy.&lt;/p&gt;

&lt;p&gt;The next iteration has a candidate: &lt;strong&gt;what a margin rule does to the&lt;br&gt;
equilibrium&lt;/strong&gt; — whether a counter-cyclical margin charge can recover the&lt;br&gt;
rescued tail without killing the rescue. That is a policy instrument the&lt;br&gt;
market cannot front-run and cannot leverage against.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Code: &lt;code&gt;crash_simulator_v10/policy_moral_hazard.py&lt;/code&gt; (V10-P4), self-test and Monte Carlo included. Deterministic, 402 lines, no dependencies beyond the standard library.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Currently available for freelance work — AI data automation, Python pipelines, and quantitative risk tools. Reach me at &lt;a href="mailto:gopipibank@gmail.com"&gt;gopipibank@gmail.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@tornadogreg?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Greg Johnson&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/a-car-driving-down-a-road-under-a-storm-cloud-QwrSO-2Vwkw?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>quantitative</category>
      <category>python</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Ask PyData: A Source-Linked Agent for Python Data Library Decisions</title>
      <dc:creator>Feng Yu</dc:creator>
      <pubDate>Sun, 20 Sep 2026 13:30:12 +0000</pubDate>
      <link>https://dev.to/fengyugbt/ask-pydata-a-source-linked-agent-for-python-data-library-decisions-3f52</link>
      <guid>https://dev.to/fengyugbt/ask-pydata-a-source-linked-agent-for-python-data-library-decisions-3f52</guid>
      <description>&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ask PyData&lt;/strong&gt; is a Sanity-backed agent that answers library-selection and migration questions for the Python data stack — pandas, Polars, DuckDB. It only works well because the content is &lt;strong&gt;structured&lt;/strong&gt;: every claim carries a &lt;code&gt;sourceUrl&lt;/code&gt;, every version-sensitive answer is checked against &lt;code&gt;versionNote&lt;/code&gt; documents first, and contradictory claims are surfaced as &lt;code&gt;disputed&lt;/code&gt; instead of silently picked.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why this domain:&lt;/strong&gt; pandas 3.0 shipped in January 2026 (new default string dtype, Copy-on-Write, removed APIs). Polars 2.0 shipped September 2, 2026 (streaming engine now default). Generic web search serves stale blogs written against old versions. A structured, version-aware knowledge base answers "what changed and how do I migrate" deterministically, with sources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key capabilities&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Version-aware answers&lt;/strong&gt; — queries &lt;code&gt;versionNote&lt;/code&gt; before answering anything version-specific.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source-linked claims&lt;/strong&gt; — every answer point cites its &lt;code&gt;sourceUrl&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contradiction surfacing&lt;/strong&gt; — "Polars is 5x faster" is tagged &lt;code&gt;disputed&lt;/code&gt;, not assumed true.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Structured comparisons&lt;/strong&gt; — API equivalents and benchmarks are typed fields, so answers are reproducible, not fuzzy.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Three questions, answered by the agent over the hosted Sanity MCP:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q1. What changed in pandas 3.0 and Polars 2.0?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The agent queries &lt;code&gt;versionNote&lt;/code&gt; and returns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;pandas 3.0.0 — &lt;strong&gt;breaking&lt;/strong&gt;: many APIs deprecated in 2.x were removed. &lt;a href="https://pandas.pydata.org/docs/whatsnew/v3.0.0.html" rel="noopener noreferrer"&gt;source&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;pandas 3.0.0 — &lt;strong&gt;behavior-change&lt;/strong&gt;: Copy-on-Write is now default; chained assignment semantics changed. &lt;a href="https://pandas.pydata.org/docs/dev/user_guide/migration.html" rel="noopener noreferrer"&gt;source&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;pandas 3.0.0 — &lt;strong&gt;behavior-change&lt;/strong&gt;: String dtype is now default (no longer NumPy object dtype). &lt;a href="https://pandas.pydata.org/docs/dev/user_guide/migration.html" rel="noopener noreferrer"&gt;source&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Polars 2.0.0 — &lt;strong&gt;new&lt;/strong&gt;: full 1.x→2.0 migration guide. &lt;a href="https://pola.rs/posts/announcing-polars-2/" rel="noopener noreferrer"&gt;source&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Polars 2.0.0 — &lt;strong&gt;behavior-change&lt;/strong&gt;: streaming engine default for all LazyFrame queries; ~5x faster aggregate. &lt;a href="https://pola.rs/posts/announcing-polars-2/" rel="noopener noreferrer"&gt;source&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Q2. How do I migrate pandas groupby/merge/fillna to Polars?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The agent queries &lt;code&gt;apiEquivalent&lt;/code&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;pandas&lt;/th&gt;
&lt;th&gt;Polars&lt;/th&gt;
&lt;th&gt;Note&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;df.groupby(col).agg('x')&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;df.group_by(col).agg(pl.col('x'))&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;aggregations must be wrapped in &lt;code&gt;pl.col()&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;df.fillna(value)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;df.fill_null(value)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Polars distinguishes null vs NaN&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;pd.merge(a, b, on=k)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;a.join(b, on=k)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;join API differs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;df.apply(func)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;df.select([pl.col(c).map(func)])&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;prefer vectorized expressions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;pd.read_csv(path)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;pl.read_csv(path)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;lazy equivalent is &lt;code&gt;pl.scan_csv()&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://docs.pola.rs/user-guide/migration/pandas/" rel="noopener noreferrer"&gt;source: Polars pandas migration guide&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q3. Is "Polars is 5x faster" trustworthy?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The agent queries &lt;code&gt;comparisonClaim&lt;/code&gt; and returns: status = &lt;strong&gt;disputed&lt;/strong&gt;, source = the Polars 2.0 announcement post. The agent does not repeat the marketing claim as fact — it flags it.&lt;/p&gt;

&lt;p&gt;Full machine-readable transcript: &lt;a href="https://github.com/fengyuGbt/ask-pydata/blob/master/agent/transcript.txt" rel="noopener noreferrer"&gt;&lt;code&gt;agent/transcript.txt&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Repository:&lt;/strong&gt; &lt;a href="https://github.com/fengyuGbt/ask-pydata" rel="noopener noreferrer"&gt;https://github.com/fengyuGbt/ask-pydata&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ask-pydata/
├── sanity/
│   ├── sanity.config.ts
│   └── schemaTypes/
│       ├── library.ts
│       ├── versionNote.ts
│       ├── apiEquivalent.ts
│       ├── migrationGuide.ts
│       ├── performanceBenchmark.ts
│       └── comparisonClaim.ts
├── agent/
│   ├── ask_pydata.py      # Python CLI MCP client
│   └── transcript.txt     # recorded Q&amp;amp;A run
└── README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Run it:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;agent
python &lt;span class="nt"&gt;-m&lt;/span&gt; venv venv &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;source &lt;/span&gt;venv/bin/activate
pip &lt;span class="nb"&gt;install &lt;/span&gt;mcp httpx

&lt;span class="c"&gt;# Token read from ~/.copilot/mcp-config.json (set up by `npx sanity mcp configure`)&lt;/span&gt;
python ask_pydata.py versions
python ask_pydata.py migrate
python ask_pydata.py controversy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How I Used Sanity
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Knowledge modeling — 6 document types&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;library&lt;/code&gt; — pandas / Polars / DuckDB, with &lt;code&gt;currentVersion&lt;/code&gt; and &lt;code&gt;engine&lt;/code&gt; (eager vs lazy).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;versionNote&lt;/code&gt; — per-version changes, with &lt;code&gt;changeType&lt;/code&gt; enum: &lt;code&gt;breaking&lt;/code&gt; / &lt;code&gt;deprecated&lt;/code&gt; / &lt;code&gt;new&lt;/code&gt; / &lt;code&gt;behavior-change&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;apiEquivalent&lt;/code&gt; — &lt;code&gt;fromApi&lt;/code&gt; → &lt;code&gt;toApi&lt;/code&gt; with &lt;code&gt;semanticDiff&lt;/code&gt; and &lt;code&gt;sourceUrl&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;migrationGuide&lt;/code&gt; — longer-form step-by-step migration narratives.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;performanceBenchmark&lt;/code&gt; — numeric &lt;code&gt;value&lt;/code&gt; + &lt;code&gt;unit&lt;/code&gt; + &lt;code&gt;environment&lt;/code&gt;, so speed claims are queryable.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;comparisonClaim&lt;/code&gt; — &lt;code&gt;status: confirmed | disputed | deprecated&lt;/code&gt;, so contested claims are not silently trusted.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;MCP usage&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configured with &lt;code&gt;npx sanity mcp configure&lt;/code&gt; against the hosted endpoint &lt;code&gt;https://mcp.sanity.io&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The Python client calls &lt;code&gt;query_documents&lt;/code&gt; with a &lt;code&gt;resource&lt;/code&gt; block &lt;code&gt;{projectId: "654gu2bk", dataset: "production"}&lt;/code&gt; and a GROQ query.&lt;/li&gt;
&lt;li&gt;Every returned document carries &lt;code&gt;sourceUrl&lt;/code&gt;; answers are built from those fields, never from general LLM knowledge.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why structured content matters here&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"What changed in pandas 3.0" is now a GROQ query, not a web search through stale 2023 blog posts.&lt;/li&gt;
&lt;li&gt;Source linking preserves provenance — the answer is the evidence.&lt;/li&gt;
&lt;li&gt;Editing one &lt;code&gt;versionNote&lt;/code&gt; in Studio fixes every future answer; no prompt retraining needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Build Log (honest, warts and all)
&lt;/h2&gt;

&lt;p&gt;Built in one evening on a remote WSL2 (Ubuntu 24.04) box, driven over SSH. Real friction included:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;WSL had no Node.&lt;/strong&gt; &lt;code&gt;npm&lt;/code&gt; pointed at a Windows mount path. Fixed by sourcing the existing nvm install and using Node 22.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;npx sanity init --template clean&lt;/code&gt;&lt;/strong&gt; gave a Studio skeleton; I hand-wrote the six schema types in &lt;code&gt;schemaTypes/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;sanity dataset import&lt;/code&gt; wants NDJSON&lt;/strong&gt;, not a JSON array. First batch failed on a pretty-printed array; rewrote as newline-delimited objects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The &lt;code&gt;@sanity/agent-context&lt;/code&gt; Studio plugin is not compatible with Sanity 6.x.&lt;/strong&gt; It pins &lt;code&gt;@sanity/icons@^3&lt;/code&gt; while Sanity 6 ships &lt;code&gt;@sanity/icons@^5&lt;/code&gt;, so Vite build dies with 29 &lt;code&gt;MISSING_EXPORT&lt;/code&gt; errors. Fell back to &lt;code&gt;npx sanity mcp configure&lt;/code&gt;, which points at the hosted &lt;code&gt;https://mcp.sanity.io&lt;/code&gt; endpoint — simpler anyway.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The hosted MCP is HTTP, not stdio.&lt;/strong&gt; The Python client needed &lt;code&gt;mcp.client.streamable_http.streamable_http_client&lt;/code&gt; with a custom &lt;code&gt;httpx.AsyncClient&lt;/code&gt; carrying the &lt;code&gt;Authorization: Bearer&lt;/code&gt; header.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Sanity read token must never be committed.&lt;/strong&gt; The Python script reads it from &lt;code&gt;~/.copilot/mcp-config.json&lt;/code&gt; or &lt;code&gt;SANITY_MCP_TOKEN&lt;/code&gt;, so the repo stays clean.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Takeaway: structured modeling was the easy part; the friction was all in transport and version compatibility.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sanity Project Details
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sanity Project ID:&lt;/strong&gt; &lt;code&gt;654gu2bk&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dataset:&lt;/strong&gt; &lt;code&gt;production&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP endpoint:&lt;/strong&gt; &lt;code&gt;https://mcp.sanity.io&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dataset preview:&lt;/strong&gt; &lt;a href="https://www.sanity.io/manage/project/654gu2bk/datasets/production" rel="noopener noreferrer"&gt;https://www.sanity.io/manage/project/654gu2bk/datasets/production&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Schema snapshot — &lt;code&gt;versionNote&lt;/code&gt; (the core of version-awareness):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;versionNote&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;versionNote&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Version Note&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;document&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;version&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;changeType&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;list&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;breaking&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;deprecated&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;new&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;behavior-change&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;summary&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sourceUrl&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;url&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;GROQ filter used by the agent:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;*[_type in ["library","versionNote","apiEquivalent",
            "migrationGuide","performanceBenchmark","comparisonClaim"]]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Agent Session
&lt;/h2&gt;

&lt;p&gt;The recorded transcript (public): &lt;a href="https://github.com/fengyuGbt/ask-pydata/blob/master/agent/transcript.txt" rel="noopener noreferrer"&gt;https://github.com/fengyuGbt/ask-pydata/blob/master/agent/transcript.txt&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It contains the three Q&amp;amp;A runs above — version notes, API equivalents, and the disputed benchmark claim — each with the exact &lt;code&gt;sourceUrl&lt;/code&gt; returned by the MCP query.&lt;/p&gt;




&lt;p&gt;Built for the &lt;a href="https://dev.to/devteam/join-the-sanity-challenge-2500-in-prizes-for-five-winners-514m"&gt;Sanity Challenge&lt;/a&gt; on dev.to.&lt;/p&gt;

</description>
      <category>sanitychallenge</category>
      <category>python</category>
      <category>ai</category>
      <category>mcp</category>
    </item>
    <item>
      <title>When the Market Learns the Rule: Front-Running the Backstop</title>
      <dc:creator>Feng Yu</dc:creator>
      <pubDate>Sun, 20 Sep 2026 09:37:54 +0000</pubDate>
      <link>https://dev.to/fengyugbt/when-the-market-learns-the-rule-front-running-the-backstop-3f77</link>
      <guid>https://dev.to/fengyugbt/when-the-market-learns-the-rule-front-running-the-backstop-3f77</guid>
      <description>&lt;p&gt;&lt;em&gt;Fat Tail Notes · Part 14 · V10-P3&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Part 13 made the backstop endogenous: it fires on state (2 tripped buckets AND a 20% drawdown), not on a calendar, and the announcement cuts unfinished sell intentions before they become liquidation. Part 13 ended with a warning dressed as a teaser: &lt;em&gt;what happens when the market learns the rule?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is that article. The answer is uncomfortable: &lt;strong&gt;a transparent backstop is a front-running target.&lt;/strong&gt; If leveraged accounts know the trigger, the rational move is to pre-empt the liquidation — to sell &lt;em&gt;shallower&lt;/em&gt; than the policy's line, because once the backstop fires the market rebounds, and the forced seller is left selling into the recovery. The policy listens to the market; so does the market listen to the policy.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The mechanism: front-running is just early tripping
&lt;/h2&gt;

&lt;p&gt;In V10-P2 an unfired bucket trips when the drawdown crosses its margin threshold. V10-P3 adds one line of behavior for the market: &lt;strong&gt;if the backstop rule is known, an unfired bucket trips on its own once the drawdown crosses the &lt;em&gt;anticipation&lt;/em&gt; line — shallower than the policy's trigger.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;front-running starts  when  drawdown &amp;lt;= -anticipation_trigger   (e.g. -15%)
policy fires          when  drawdown &amp;lt;= -trigger_drawdown        (e.g. -20%)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The front-runner's sales are flow like any other — the price does not know whether the seller is forced or scared. Two consequences follow mechanically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the cascade starts earlier and runs faster, so the backstop arrives at a &lt;strong&gt;deeper hole&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;buckets that front-run have blown up before fire time, so the &lt;strong&gt;expectations channel has fewer intentions left to cut&lt;/strong&gt; — the very channel that made the unbounded commitment work in Part 13 is drained from underneath.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On the calibration path the accounting is stark:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;scenario&lt;/th&gt;
&lt;th&gt;total return&lt;/th&gt;
&lt;th&gt;fire step&lt;/th&gt;
&lt;th&gt;expected flow saved&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;no backstop&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-36.5%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;P2: market has not learned&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-22.8%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;0.277&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;P3: market learned the rule&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-24.7%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;td&gt;0.259&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The rule costs &lt;strong&gt;1.9 points of the tail&lt;/strong&gt; — and it costs it precisely through the channel Part 13 built: the expectations channel saves 0.277 of flow when the rule is private, only 0.259 when the rule is public. &lt;strong&gt;The clearer the promise, the less it is worth.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The paradox of forward guidance
&lt;/h2&gt;

&lt;p&gt;This is the paradox every central bank lives with. A precisely communicated rule ("two buckets, twenty percent, no ceiling") is the most &lt;em&gt;priced&lt;/em&gt; commitment in the market: everyone aims at the line, everyone pre-empts it. Guidance is supposed to anchor expectations. But an anchor that everyone can see is also an anchor everyone can pull against.&lt;/p&gt;

&lt;p&gt;2020 is the counterfactual that proves the point: the Fed did &lt;strong&gt;not&lt;/strong&gt; pre-announce "2 buckets and -20%." The 3/23 announcement was a &lt;em&gt;regime&lt;/em&gt; announcement — "as needed, no limit" — whose trigger was not a published threshold but a judgment call. The market could not front-run a judgment it could not locate.&lt;/p&gt;

&lt;p&gt;Which raises the policy question: &lt;strong&gt;can ambiguity be engineered?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Ambiguity is a knob, not a flaw
&lt;/h2&gt;

&lt;p&gt;V10-P3 makes the trigger fuzzy: the policy fires at &lt;code&gt;trigger_drawdown + noise&lt;/code&gt;, where the noise is symmetric (same expectation, unpredictable realization). The market cannot aim at a moving line, so front-running dies. But the noise has a cost — sometimes the policy fires late. Scan the noise size (Monte Carlo, 500 paths, seed 20260920):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;trigger noise&lt;/th&gt;
&lt;th&gt;mean&lt;/th&gt;
&lt;th&gt;p10&lt;/th&gt;
&lt;th&gt;p1&lt;/th&gt;
&lt;th&gt;worst&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;P2 base (no front-run)&lt;/td&gt;
&lt;td&gt;-21.2%&lt;/td&gt;
&lt;td&gt;-23.2%&lt;/td&gt;
&lt;td&gt;-24.2%&lt;/td&gt;
&lt;td&gt;-27.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0% (transparent, front-run)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-22.6%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;-24.9%&lt;/td&gt;
&lt;td&gt;-25.5%&lt;/td&gt;
&lt;td&gt;-27.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;2%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-21.4%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;-24.5%&lt;/td&gt;
&lt;td&gt;-26.1%&lt;/td&gt;
&lt;td&gt;-26.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4%&lt;/td&gt;
&lt;td&gt;-21.5%&lt;/td&gt;
&lt;td&gt;-26.4%&lt;/td&gt;
&lt;td&gt;-27.8%&lt;/td&gt;
&lt;td&gt;-28.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8%&lt;/td&gt;
&lt;td&gt;-21.7%&lt;/td&gt;
&lt;td&gt;-29.8%&lt;/td&gt;
&lt;td&gt;-31.5%&lt;/td&gt;
&lt;td&gt;-32.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12%&lt;/td&gt;
&lt;td&gt;-22.0%&lt;/td&gt;
&lt;td&gt;-32.5%&lt;/td&gt;
&lt;td&gt;-34.8%&lt;/td&gt;
&lt;td&gt;-36.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two curves, one message. &lt;strong&gt;Mean recovers as soon as the rule is fuzzy at all&lt;/strong&gt; — the front-run loses its aim. But the tail deteriorates monotonically with the noise: at 12% noise the p1 is -34.8%, essentially no backstop at all. The policy pays for ambiguity in trigger reliability.&lt;/p&gt;

&lt;p&gt;The optimum is small: &lt;strong&gt;about 2%.&lt;/strong&gt; Enough noise to break the front-run's aim, little enough to keep the trigger sharp. At 2% the mean is back to -21.4% (1.2 points recovered), and the worst case improves to -26.4% (1.5 points better than the transparent rule) — a free lunch, almost.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. The distribution: what 2% buys
&lt;/h2&gt;

&lt;p&gt;Full Monte Carlo (2,000 paths, seed 20260920):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;configuration&lt;/th&gt;
&lt;th&gt;mean&lt;/th&gt;
&lt;th&gt;p50&lt;/th&gt;
&lt;th&gt;p10&lt;/th&gt;
&lt;th&gt;p1&lt;/th&gt;
&lt;th&gt;worst&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;P2: not learned&lt;/td&gt;
&lt;td&gt;-21.2%&lt;/td&gt;
&lt;td&gt;-22.4%&lt;/td&gt;
&lt;td&gt;-23.2%&lt;/td&gt;
&lt;td&gt;-25.0%&lt;/td&gt;
&lt;td&gt;-30.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;P3: rule learned&lt;/td&gt;
&lt;td&gt;-22.6%&lt;/td&gt;
&lt;td&gt;-24.0%&lt;/td&gt;
&lt;td&gt;-24.9%&lt;/td&gt;
&lt;td&gt;-25.6%&lt;/td&gt;
&lt;td&gt;-31.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;P3 + 2% fuzzy&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-21.4%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-22.4%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;-24.4%&lt;/td&gt;
&lt;td&gt;-25.8%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-28.7%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Read the edges. A learned rule costs &lt;strong&gt;1.5 points of mean and 2.3 points of worst case&lt;/strong&gt; vs the not-learned world — that is the price of transparency. A 2% fuzz buys back 1.2 points of mean and &lt;strong&gt;2.3 points of worst case&lt;/strong&gt;. The only residual cost is a hair on the p1 (-25.8% vs -25.6%) — the occasional late trigger, the honest price of ambiguity.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. What this means
&lt;/h2&gt;

&lt;p&gt;Three claims, kernel-backed:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Endogenous policy meets endogenous markets.&lt;/strong&gt; The same reflex that makes the backstop listen to the market makes the market listen to the backstop. A rule that cannot be hidden will be aimed at.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Constructive ambiguity is not a weakness of central banks — it is a policy tool.&lt;/strong&gt; The "I can't tell you the exact trigger" posture is not vagueness; it is the mechanism that stops the front-run. 2020's bottom happened not because the rule was clear but because it could not be located.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ambiguity is a knob, and it has an optimum.&lt;/strong&gt; Too transparent, and the market front-runs you. Too fuzzy, and you fire late into worse holes. The scan says the operating point is narrow — a few points of noise, enough to break the aim, not enough to break the trigger.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The next iteration has a candidate already: &lt;strong&gt;what happens when the market learns that the rule is fuzzy&lt;/strong&gt; — when the front-runner becomes an &lt;em&gt;adaptive&lt;/em&gt; learner, estimating the noise and aiming at its expectation. The game of endogenous policy does not end; it escalates.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Code: &lt;code&gt;crash_simulator_v10/policy_anticipation.py&lt;/code&gt; (V10-P3), self-test and Monte Carlo included. Deterministic, 438 lines, no dependencies beyond the standard library.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Currently available for freelance work — AI data automation, Python pipelines, and quantitative risk tools. Reach me at &lt;a href="mailto:gopipibank@gmail.com"&gt;gopipibank@gmail.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@coombez?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Doncoombez&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/owl-perched-on-tree-branch-MqDNQ4h3tDQ?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>quantitative</category>
      <category>opensource</category>
      <category>automation</category>
    </item>
    <item>
      <title>The Backstop That Listens: Regime Triggers and the Expectations Channel</title>
      <dc:creator>Feng Yu</dc:creator>
      <pubDate>Sat, 19 Sep 2026 01:14:43 +0000</pubDate>
      <link>https://dev.to/fengyugbt/the-backstop-that-listens-regime-triggers-and-the-expectations-channel-1781</link>
      <guid>https://dev.to/fengyugbt/the-backstop-that-listens-regime-triggers-and-the-expectations-channel-1781</guid>
      <description>&lt;p&gt;&lt;em&gt;Fat Tail Notes · Part 13 · V10-P2&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Part 12 built the backstop clock: &lt;code&gt;backstop = f(trigger, lag, coverage, object)&lt;/code&gt;, calibrated on March 2020, and ended with an explicit debt. Two things the fixed-lag version could not do:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The Fed does not arrive on a calendar.&lt;/strong&gt; It arrives when the regime is confirmed. On March 23, 2020, the flow tool fired not because it was "day 20" but because corporate-credit dysfunction had become unmistakable. A backstop with a hard-coded lag is a calendar; the real one is a &lt;em&gt;state machine&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A bounded number is a price tool in disguise.&lt;/strong&gt; "$700 billion" can be priced by the market, so panic is not removed — the cascade keeps front-running, and the backstop just absorbs the flow after it is born. The unbounded "as needed" commitment does something else entirely: it changes the &lt;em&gt;expectation&lt;/em&gt; of the liquidation, so the liquidation never fully happens.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This article pays that debt. &lt;strong&gt;V10-P2 (&lt;code&gt;policy_expectations.py&lt;/code&gt;) makes the backstop endogenous — it listens to the market — and adds the expectations channel: after the announcement, forced-selling intentions are cut, including flow already in transit.&lt;/strong&gt; Same kernel as Parts 6–12. Two new mechanisms.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The regime trigger: the policy listens to the market
&lt;/h2&gt;

&lt;p&gt;In V10-P1 the backstop activated at a fixed step. In V10-P2 it activates on &lt;em&gt;state&lt;/em&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;backstop fires  when  (buckets tripped &amp;gt;= trigger_buckets)
                    AND (drawdown &amp;lt;= -trigger_drawdown)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the calibrated defaults — 2 tripped buckets and a 20% drawdown — the backstop fires at &lt;strong&gt;step 14 of 40&lt;/strong&gt; on the March-2020 calibration path: the day the market has already given up 20% and two leverage cohorts have been liquidated. That is the "Mar 23" neighborhood, reached by listening, not by counting.&lt;/p&gt;

&lt;p&gt;The asymmetry this creates is the point: &lt;strong&gt;in a fast crash the endogenous trigger fires earlier than any fixed lag; in a slow grind it waits.&lt;/strong&gt; The policy does not need to predict the crisis — it needs to recognize it.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The expectations channel: cutting the intention, not just catching the flow
&lt;/h2&gt;

&lt;p&gt;V10-P1's absorption channel waits for forced selling to be &lt;em&gt;born&lt;/em&gt;, then buys it. That is expensive, lagged, and — as Part 12 showed — the price path is identical whether the backstop exists or not, because the selling still happens.&lt;/p&gt;

&lt;p&gt;The expectations channel operates one step earlier. When the backstop activates with &lt;code&gt;expectation_effect = E&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;unfinished forced-sale intentions&lt;/strong&gt; are cut by a fraction E — accounts that would have kept dumping stop, because a buyer is announced;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;liquidation flow already in transit&lt;/strong&gt; is also cut by E — orders get pulled once the buyer is known.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;E = 0&lt;/code&gt; is the V10-P1 world: pure absorption, panic intact. &lt;code&gt;E = 1.0&lt;/code&gt; is the unbounded "as needed" commitment: the &lt;em&gt;expectation of the liquidation&lt;/em&gt; disappears, so the liquidation stops being born.&lt;/p&gt;

&lt;p&gt;The accounting on the calibration path says it plainly:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;scenario&lt;/th&gt;
&lt;th&gt;total return&lt;/th&gt;
&lt;th&gt;absorbed flow&lt;/th&gt;
&lt;th&gt;expected flow saved&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;no backstop&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-36.5%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;endogenous + absorption only (E = 0)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-26.9%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0.188&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;endogenous + half announcement (E = 0.5)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-24.1%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0.043&lt;/td&gt;
&lt;td&gt;0.213&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;endogenous + as needed (E = 1.0)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-22.8%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0.277&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Read the last two columns. &lt;strong&gt;At E = 1.0 the absorption channel is unemployed&lt;/strong&gt; — the expected-flow savings (0.277) exceed everything the buyer ever had to buy. The unbounded commitment does not work by buying; it works by &lt;em&gt;not having to buy&lt;/em&gt;, because the selling it announces against never materializes.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The timing window: too late is just an absorber
&lt;/h2&gt;

&lt;p&gt;The endogenous trigger introduces a knife's edge. Scan the trigger drawdown on the same path:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;trigger drawdown&lt;/th&gt;
&lt;th&gt;fire step&lt;/th&gt;
&lt;th&gt;E = 0 return&lt;/th&gt;
&lt;th&gt;E = 1.0 return&lt;/th&gt;
&lt;th&gt;gap&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;10%&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;-16.7%&lt;/td&gt;
&lt;td&gt;-15.0%&lt;/td&gt;
&lt;td&gt;1.7 pts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;20%&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;-26.9%&lt;/td&gt;
&lt;td&gt;-22.8%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4.1 pts&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;30%&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;td&gt;-33.9%&lt;/td&gt;
&lt;td&gt;-33.9%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.0 pts&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;At a 30% trigger the backstop fires so late that &lt;strong&gt;every leverage bucket has already blown up&lt;/strong&gt; — there is no forced-selling intention left to cut, and the "as needed" commitment behaves exactly like a bounded one. A backstop that arrives after the cascade is finished is not a backstop; it is a souvenir.&lt;/p&gt;

&lt;p&gt;This is the real lesson of the timing window: &lt;strong&gt;the expectations channel has value only while there are still leveraged accounts that have not blown up.&lt;/strong&gt; The window is between "the regime is recognizable" and "the cascade has consumed everything." 2020's bottom happened because the announcement landed inside that window.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. The distribution: the tail moves, not the body
&lt;/h2&gt;

&lt;p&gt;Monte Carlo (2,000 paths, seed 20260919), regime-triggered backstop:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;expectation effect&lt;/th&gt;
&lt;th&gt;p1&lt;/th&gt;
&lt;th&gt;p10&lt;/th&gt;
&lt;th&gt;worst&lt;/th&gt;
&lt;th&gt;fire share&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0.0 (absorption only)&lt;/td&gt;
&lt;td&gt;-30.0%&lt;/td&gt;
&lt;td&gt;-28.5%&lt;/td&gt;
&lt;td&gt;-32.9%&lt;/td&gt;
&lt;td&gt;91%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.5&lt;/td&gt;
&lt;td&gt;-26.2%&lt;/td&gt;
&lt;td&gt;-24.9%&lt;/td&gt;
&lt;td&gt;-29.5%&lt;/td&gt;
&lt;td&gt;91%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.0 (as needed)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-24.4%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-23.2%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-27.7%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;91%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The expectations channel buys &lt;strong&gt;5.6 points of p1 and 5.2 points of worst-case drawdown&lt;/strong&gt; — and it does so on 91% of paths, where the backstop fires. It is not a body-buyer; it is a &lt;strong&gt;tail-buyer&lt;/strong&gt;. That is exactly what a policy residual is for.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. What this means
&lt;/h2&gt;

&lt;p&gt;Three claims, now with a kernel behind them:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Endogenous beats calendar.&lt;/strong&gt; A backstop that listens to the market fires earlier in fast crashes and waits in slow ones. The Mar-2020 neighborhood is reached at step 14 by state recognition, not by counting to 20.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The unbounded commitment is not a bigger check — it is a different mechanism.&lt;/strong&gt; A bounded number is priced, so panic survives and flow is born, then absorbed. An unbounded commitment cuts the intention before the flow is born. The absorption channel ends up with nothing to do (0.277 of expected flow saved vs 0 absorbed).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timing is everything, and it is a window, not a point.&lt;/strong&gt; Fire too early and you waste credibility; fire too late and you are an absorber with no expectations to repair. The value of the announcement is concentrated in the interval between "regime confirmed" and "cascade complete" — and 2020 bottomed because the announcement landed inside it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Next iteration already has a candidate: &lt;strong&gt;what happens when the market learns the rule&lt;/strong&gt; — when leveraged accounts know the trigger thresholds and front-run &lt;em&gt;the backstop itself&lt;/em&gt;. That is the game of endogenous policy, and it deserves its own part.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Code: &lt;code&gt;crash_simulator_v10/policy_expectations.py&lt;/code&gt; (V10-P2), self-test and Monte Carlo included. Deterministic, 394 lines, no dependencies beyond the standard library.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Currently available for freelance work — AI data automation, Python pipelines, and quantitative risk tools. Reach me at &lt;a href="mailto:gopipibank@gmail.com"&gt;gopipibank@gmail.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@randymilanovic?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Randy Milanovic&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/road-and-tornado-qQ6GZBa58UI?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>quantitative</category>
      <category>opensource</category>
      <category>automation</category>
    </item>
    <item>
      <title>The Backstop Clock: Pricing the Twenty-Day Window in Code</title>
      <dc:creator>Feng Yu</dc:creator>
      <pubDate>Fri, 18 Sep 2026 03:26:01 +0000</pubDate>
      <link>https://dev.to/fengyugbt/the-backstop-clock-pricing-the-twenty-day-window-in-code-3oei</link>
      <guid>https://dev.to/fengyugbt/the-backstop-clock-pricing-the-twenty-day-window-in-code-3oei</guid>
      <description>&lt;p&gt;Part 11 ended with a promise: stop treating the Fed as a residual and&lt;br&gt;
make the policy explicit — &lt;code&gt;backstop = f(trigger_t, lag_t, coverage, object)&lt;/code&gt;.&lt;br&gt;
This is the module that delivers it. &lt;code&gt;policy_backstop.py&lt;/code&gt; (V10-P1) races&lt;br&gt;
the policy clock against the margin cascade, calibrated on the March 2020&lt;br&gt;
calendar. The results are not subtle.&lt;/p&gt;


&lt;h2&gt;
  
  
  The kernel
&lt;/h2&gt;

&lt;p&gt;The engine mirrors the Part-10 cascade (spiral + gamma flip + margin&lt;br&gt;
buckets) with one addition: a policy layer that arrives at step &lt;code&gt;lag_t&lt;/code&gt;&lt;br&gt;
and, if its object is &lt;code&gt;flow&lt;/code&gt;, absorbs &lt;code&gt;coverage&lt;/code&gt; of the forced-selling&lt;br&gt;
flow every step before it hits the price.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;backstop_arrived&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;step&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;backstop_lag&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;backstop_arrived&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;backstop_object&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;flow&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;absorbed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cascade_flow&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;coverage&lt;/span&gt;
    &lt;span class="n"&gt;cascade_flow&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="n"&gt;absorbed&lt;/span&gt;   &lt;span class="c1"&gt;# the flow never reaches the price
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the whole policy. Three objects, one rule:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;object = "price"&lt;/code&gt; — rate cuts, treasury QE. &lt;strong&gt;Nothing is absorbed.&lt;/strong&gt;
The cascade keeps feeding itself.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;object = "flow"&lt;/code&gt; — buying the asset being liquidated, backstopping
seller funding. &lt;strong&gt;The forced-selling flow disappears.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;coverage = 1.0&lt;/code&gt; — "as needed", the March 23 commitment with no ceiling.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The March 2020 calibration, reproduced
&lt;/h2&gt;

&lt;p&gt;The kernel is run at 40 steps with slow forced-selling release, so the&lt;br&gt;
cascade is still feeding the market when the backstop arrives — as the&lt;br&gt;
liquidation was in the third week of March 2020.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;Object&lt;/th&gt;
&lt;th&gt;Lag&lt;/th&gt;
&lt;th&gt;Return&lt;/th&gt;
&lt;th&gt;Tail truncated&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;No backstop&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-36.5%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mar 3 cut (price)&lt;/td&gt;
&lt;td&gt;price&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-36.5%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mar 15 cut to zero (price)&lt;/td&gt;
&lt;td&gt;price&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-36.5%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Mar 23 (flow, as needed)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;flow&lt;/td&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-30.0%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;yes&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flow backstop, lag 5&lt;/td&gt;
&lt;td&gt;flow&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;-14.8%&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flow backstop, coverage 0.5&lt;/td&gt;
&lt;td&gt;flow&lt;/td&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;td&gt;-31.0%&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Read the first three rows carefully. &lt;strong&gt;The price tools changed nothing.&lt;/strong&gt;&lt;br&gt;
Not less damage — &lt;em&gt;nothing&lt;/em&gt;. The rate cuts did not bind to the forced&lt;br&gt;
selling, so the cascade ran to the same -36.5% in all three runs. That is&lt;br&gt;
the March 15, 2020 failure mode, reproduced by a rule one line long.&lt;/p&gt;

&lt;p&gt;The flow backstop, arriving at lag 20 (Mar 3 → Mar 23), cuts the tail to&lt;br&gt;
-30.0% and &lt;strong&gt;closes the liquidation window&lt;/strong&gt;: no new bucket trips after&lt;br&gt;
arrival, and the forced flow is absorbed to zero. The market bottomed on&lt;br&gt;
the day the object switched to flow — the kernel says the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  The window is a tail multiplier
&lt;/h2&gt;

&lt;p&gt;Now vary the lag and watch the tail:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;lag 5&lt;/strong&gt; → &lt;strong&gt;-14.8%&lt;/strong&gt; (the backstop arrives while only two buckets
have tripped; the cascade never gets going)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;lag 12&lt;/strong&gt; → -20.7%&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;lag 20&lt;/strong&gt; → -30.0% (the March 2020 number: the window had been open
three weeks)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every day of lag is a slice of the tail. A model that prices the news&lt;br&gt;
shock but not the window cannot see this curve at all — it has one&lt;br&gt;
number for every policy, because the policy is a residual.&lt;/p&gt;

&lt;p&gt;Coverage matters less but still matters: a bounded 50% backstop gives&lt;br&gt;
-31.0% against -30.0% for the unlimited one. The "as needed" commitment&lt;br&gt;
buys about a point in this kernel — but that understates it. The real&lt;br&gt;
value of the unbounded commitment is not the absorbed flow, it is the&lt;br&gt;
&lt;em&gt;expectation&lt;/em&gt; of forced selling disappearing, which the kernel does not&lt;br&gt;
yet model. (V10-P2 candidate.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Monte Carlo: the tail moves as a distribution
&lt;/h2&gt;

&lt;p&gt;2,000 paths with uncertain shock / gamma / thresholds:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Policy&lt;/th&gt;
&lt;th&gt;p1&lt;/th&gt;
&lt;th&gt;p10&lt;/th&gt;
&lt;th&gt;worst&lt;/th&gt;
&lt;th&gt;paths truncated&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;No backstop&lt;/td&gt;
&lt;td&gt;-44.3%&lt;/td&gt;
&lt;td&gt;-40.6%&lt;/td&gt;
&lt;td&gt;-46.7%&lt;/td&gt;
&lt;td&gt;0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flow backstop, lag 20&lt;/td&gt;
&lt;td&gt;-42.7%&lt;/td&gt;
&lt;td&gt;-38.4%&lt;/td&gt;
&lt;td&gt;-45.3%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;86%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flow backstop, lag 5&lt;/td&gt;
&lt;td&gt;-26.4%&lt;/td&gt;
&lt;td&gt;-20.9%&lt;/td&gt;
&lt;td&gt;-30.3%&lt;/td&gt;
&lt;td&gt;43%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The lag-20 backstop shaves the p1 tail by only 1.6 points — because in&lt;br&gt;
most paths the cascade had already done most of its damage by day 20.&lt;br&gt;
The lag-5 backstop shaves p1 by &lt;strong&gt;18 points&lt;/strong&gt; and p10 by &lt;strong&gt;20 points&lt;/strong&gt;.&lt;br&gt;
The liquidation window is not a calendar detail; it is where the tail&lt;br&gt;
lives.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this means for the VaR
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Price tools are an invariant in liquidation-driven falls.&lt;/strong&gt; If your
model lets the rate cut reduce the tail, it is wrong in a way that
flatters the outcome. The kernel reproduces March 2020 by treating
price tools as what they are: orthogonal to forced selling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The backstop belongs in the hazard/loss layer, not the residual.&lt;/strong&gt;
Four parameters, one rule, a calibration date. That is all it takes to
stop treating the Fed as a residual.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The honest output is a truncated distribution, not an adjusted
number.&lt;/strong&gt; The tail ends at a named date — the day the flow tool
arrived. The kernel gives you the date; the MC gives you the share of
paths that make it there.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The next iteration is already visible: the backstop should be triggered&lt;br&gt;
endogenously (regime detection, not a fixed lag), and the unbounded&lt;br&gt;
commitment should act on expectations, not just flow. But the core&lt;br&gt;
promise of Part 11 is now code: &lt;strong&gt;a VaR that prices the twenty-day&lt;br&gt;
window instead of pretending it does not exist.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This article was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Currently available for freelance work — AI data automation, Python pipelines, and quantitative risk tools. Reach me at &lt;a href="mailto:gopipibank@gmail.com"&gt;gopipibank@gmail.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@peter_mc_greats?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Pietro De Grandi&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/three-brown-wooden-boat-on-blue-lake-water-taken-at-daytime-T7K4aEPoGGk?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>quantitative</category>
      <category>opensource</category>
      <category>automation</category>
    </item>
    <item>
      <title>The Twenty-Day Window: Pricing the Policy Residual</title>
      <dc:creator>Feng Yu</dc:creator>
      <pubDate>Thu, 17 Sep 2026 01:47:17 +0000</pubDate>
      <link>https://dev.to/fengyugbt/the-twenty-day-window-pricing-the-policy-residual-4h7n</link>
      <guid>https://dev.to/fengyugbt/the-twenty-day-window-pricing-the-policy-residual-4h7n</guid>
      <description>&lt;p&gt;&lt;em&gt;A reader — Dean Lee — wrote this about my Part 7, and it has been nagging me since:&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"A VaR that treats the Fed as a residual still prices the news shock and misses how long that liquidation window stays open."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;He is right, and 2020 is the proof. This article prices the window.&lt;/p&gt;




&lt;h2&gt;
  
  
  The policy calendar that priced the tail
&lt;/h2&gt;

&lt;p&gt;Between February 19 and March 23, 2020, the S&amp;amp;P 500 fell from 3,386 to 2,191 — &lt;strong&gt;-35.3%&lt;/strong&gt;. The Fed did not stand still. It fired three times. The market bottomed exactly on the third shot:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th&gt;Policy&lt;/th&gt;
&lt;th&gt;Object&lt;/th&gt;
&lt;th&gt;Market reaction&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Mar 3&lt;/td&gt;
&lt;td&gt;Emergency cut, &lt;strong&gt;-50bp&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Price of money&lt;/td&gt;
&lt;td&gt;S&amp;amp;P &lt;strong&gt;-2.8%&lt;/strong&gt; that day; sold off anyway&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mar 15 (Sun)&lt;/td&gt;
&lt;td&gt;Emergency cut &lt;strong&gt;-100bp&lt;/strong&gt; to zero + &lt;strong&gt;$700B QE&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Price of money&lt;/td&gt;
&lt;td&gt;Mar 16: &lt;strong&gt;circuit breaker&lt;/strong&gt;, VIX closes at &lt;strong&gt;82.69&lt;/strong&gt; (record)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mar 23&lt;/td&gt;
&lt;td&gt;"&lt;strong&gt;As needed&lt;/strong&gt;" purchases + corporate credit facilities (PMCCF/SMCCF)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Flow of forced selling&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Intraday low 2,191.86 that day — the exact bottom&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two of the three policies did not just fail to stop the crash — the second one &lt;em&gt;accelerated&lt;/em&gt; it. The day after the biggest rate cut in Fed history, the market fell 12% and tripped its third circuit breaker in a week.&lt;/p&gt;

&lt;p&gt;A VaR that treats the Fed as a residual books the shock correctly and then draws the wrong tail, because the tail was not set by the news. It was set by &lt;strong&gt;how long the liquidation window stayed open&lt;/strong&gt; — twenty days, from first cut to effective backstop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Price tools vs flow tools
&lt;/h2&gt;

&lt;p&gt;The distinction that matters is not "stimulus vs no stimulus." It is what the policy &lt;strong&gt;binds to&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Price tools&lt;/strong&gt; (rate cuts, treasury QE) change the &lt;em&gt;price of money&lt;/em&gt;. They do not change the &lt;em&gt;flow&lt;/em&gt; of forced selling. Leveraged accounts still get margin calls at the same thresholds; dealers still short gamma hedge on the next downtick.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flow tools&lt;/strong&gt; (buying the asset class being liquidated, backstopping the sellers' funding) absorb or redirect the &lt;em&gt;selling flow itself&lt;/em&gt;. The cascade loses its fuel.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;March 15 was a price tool aimed at a flow problem. The market read it correctly: &lt;em&gt;"they are scared enough to cut 100bp on a Sunday — what do they know?"&lt;/em&gt; The circuit breaker on March 16 was not a paradox. It was the price tool re-pricing the probability that the flow tool would arrive late.&lt;/p&gt;

&lt;p&gt;March 23 was a flow tool. "As needed," "in the amounts needed to support smooth functioning" — the Fed did not announce a number, it announced that &lt;strong&gt;it would absorb whatever flow the liquidation produced&lt;/strong&gt;. The bottom printed the same day.&lt;/p&gt;

&lt;h2&gt;
  
  
  Backstop as a function of four parameters
&lt;/h2&gt;

&lt;p&gt;Here is how I now think a stress-test model should hold the policy, instead of a residual:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;backstop&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;trigger_t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lag_t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;coverage&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;object&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;object&lt;/strong&gt; ∈ {price, flow} — what the policy binds to (the one that decides everything)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;lag_t&lt;/strong&gt; — days from shock to effective intervention (the length of the liquidation window)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;coverage&lt;/strong&gt; — how much of the forced-selling flow the backstop absorbs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;trigger_t&lt;/strong&gt; — the market state that fires it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The cascade module I built in Part 10 races margin cascades against the gamma flip. Add a backstop and the race has a third runner: the policy clock. The mechanisms stay the same — threshold clustering (Part 7), dealer hedging flow (Part 5), cascade buckets (Part 10) — but every one of them now has a &lt;strong&gt;stop condition with a date on it&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The 2020 data maps cleanly onto the parameter grid:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Mar 3&lt;/th&gt;
&lt;th&gt;Mar 15&lt;/th&gt;
&lt;th&gt;Mar 23&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;object&lt;/td&gt;
&lt;td&gt;price&lt;/td&gt;
&lt;td&gt;price&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;flow&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;lag_t&lt;/td&gt;
&lt;td&gt;12 days before bottom&lt;/td&gt;
&lt;td&gt;8 days before bottom&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0 days before bottom&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;coverage&lt;/td&gt;
&lt;td&gt;n/a (does not bind to selling)&lt;/td&gt;
&lt;td&gt;n/a&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;"as needed" = ∞&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;outcome&lt;/td&gt;
&lt;td&gt;cascade continues&lt;/td&gt;
&lt;td&gt;cascade accelerates&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;cascade stops, same day&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The window closed the day the object switched to flow. Everything before that — 3,000 points of drawdown, three circuit breakers, a record VIX — was the cost of a &lt;strong&gt;price tool aimed at a flow problem&lt;/strong&gt;, measured in days.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the window does to the tail
&lt;/h2&gt;

&lt;p&gt;This is the part the residual treatment loses. The liquidation window is not a calendar detail; it is a &lt;strong&gt;tail multiplier&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;While the window is open, margin cascades run their full course: every bucket fires on schedule, dealer hedging keeps selling into the fall, and the EP curve's deep tail gets populated.&lt;/li&gt;
&lt;li&gt;When a flow backstop arrives, the cascade stops mid-cycle. The forced-selling flow that would have cleared buckets 3 and 4 is absorbed instead. The realized tail is &lt;strong&gt;truncated at the intervention date&lt;/strong&gt;, not at the fundamental fair value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A model that prices the news shock but not the window therefore has a systematic bias: it over-prices tail events in markets where flow backstops exist (large, central-bank-backed equity markets), and under-prices them where they do not (crypto, single-name margin books, anything without a lender of last resort for its sellers).&lt;/p&gt;

&lt;p&gt;The sign of the bias depends entirely on the object — which is precisely why "the Fed" cannot be a residual. A residual is something you cannot name. We can name this. It has a trigger, a lag, a coverage, and an object — and history has given us the calibration point.&lt;/p&gt;

&lt;h2&gt;
  
  
  The calibration lesson of March 2020
&lt;/h2&gt;

&lt;p&gt;Three facts the next model should encode:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Price tools do not stop margin cascades.&lt;/strong&gt; Rate cuts and treasury QE change the discount rate, not the margin call. Expect them to fail against liquidation-driven falls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lagged flow tools truncate the tail at the intervention date.&lt;/strong&gt; The window was 20 days. If a backstop of the correct object arrives at lag τ, the deepest bucket that fires before τ is your new p99. March 23 makes τ = 20 days the empirical anchor for "flow tool, large developed equity market."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"As needed" is a different instrument than "700 billion."&lt;/strong&gt; A bounded number is a price tool in disguise — the market can price the limit. An unbounded commitment absorbs the &lt;em&gt;expectation&lt;/em&gt; of forced selling, which is what breaks the feedback loop. The market bottomed on the same day the ceiling disappeared.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Next in the simulator
&lt;/h2&gt;

&lt;p&gt;I am now building this into the model as the next module: a policy layer that takes &lt;code&gt;(trigger_t, lag_t, coverage, object)&lt;/code&gt; and races the backstop clock against the margin cascade, with the March 2020 calendar as the calibration case. The output I want is not "VaR with a Fed adjustment." It is a distribution whose tail is &lt;em&gt;truncated at a named date&lt;/em&gt; — because in 2020, the tail did not end at a price. It ended at a press conference.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This article was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Currently available for freelance work — AI data automation, Python pipelines, and quantitative risk tools. Reach me at &lt;a href="mailto:gopipibank@gmail.com"&gt;gopipibank@gmail.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@willianjusten?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Willian Justen de Vasconcellos&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/aerial-photography-of-town-in-the-middle-of-the-desert-HfLYdUePGyc?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>quantative</category>
    </item>
    <item>
      <title>The Cascade Runs Ahead of the Flip</title>
      <dc:creator>Feng Yu</dc:creator>
      <pubDate>Wed, 16 Sep 2026 00:21:46 +0000</pubDate>
      <link>https://dev.to/fengyugbt/the-cascade-runs-ahead-of-the-flip-12h6</link>
      <guid>https://dev.to/fengyugbt/the-cascade-runs-ahead-of-the-flip-12h6</guid>
      <description>&lt;p&gt;&lt;strong&gt;Part 9 added the gamma flip: vol spikes, dealer books turn from short to long gamma, and the selling spiral is truncated. That's half the story. The uncomfortable other half: the flip is not instant, and while it converges, leveraged accounts are being force-liquidated on their own schedule. This article is the race — V9-P6 puts margin cascades next to the flip, and the honest result is that even a timely flip does not save everyone. March 2020's survivors weren't the funds that were structurally safe; they were the ones that hadn't blown up yet.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The detail Part 9 glossed over
&lt;/h2&gt;

&lt;p&gt;The flip story, as told so far, is clean: short gamma feeds the spiral, vol spike flips the book, the spiral dies. But a crash doesn't wait politely for the book to turn positive. While gamma is converging, three other things are happening on top of the price fall:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;10x accounts&lt;/strong&gt; breach their maintenance margin and get a margin call.&lt;/li&gt;
&lt;li&gt;The call has a &lt;strong&gt;grace window&lt;/strong&gt; — days, not microseconds.&lt;/li&gt;
&lt;li&gt;When the window closes, the position is &lt;strong&gt;force-sold&lt;/strong&gt;, and that sale hits the market like any other sale.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Margin calls don't cancel because gamma flipped. The forced sales have their own momentum — and their own timetable. So the real question isn't "does the flip stop the crash?" It's: &lt;strong&gt;does the flip stop the crash before the cascade finishes?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The model: two engines, one race
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;cascade.py&lt;/code&gt; adds one structure to the Part-5 kernel: leveraged accounts in four buckets, each with a leverage, a portfolio weight, and a price trigger at which it gets liquidated:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Bucket&lt;/th&gt;
&lt;th&gt;Leverage&lt;/th&gt;
&lt;th&gt;Weight&lt;/th&gt;
&lt;th&gt;Trigger&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;10x&lt;/td&gt;
&lt;td&gt;10%&lt;/td&gt;
&lt;td&gt;-5%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;5x&lt;/td&gt;
&lt;td&gt;20%&lt;/td&gt;
&lt;td&gt;-10%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;td&gt;3x&lt;/td&gt;
&lt;td&gt;30%&lt;/td&gt;
&lt;td&gt;-15%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D&lt;/td&gt;
&lt;td&gt;2x&lt;/td&gt;
&lt;td&gt;40%&lt;/td&gt;
&lt;td&gt;-20%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When a bucket trips, its forced selling releases over &lt;strong&gt;3 steps&lt;/strong&gt; — the margin-call grace window — so the liquidation keeps feeding the market while the flip converges. Everything else is the same kernel: dealer hedging, the flip rule, the α/β dynamics.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the race looks like
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setup&lt;/th&gt;
&lt;th&gt;Drawdown&lt;/th&gt;
&lt;th&gt;Amplification&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Bare spiral (Part 5)&lt;/td&gt;
&lt;td&gt;-15.4%&lt;/td&gt;
&lt;td&gt;3.07x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spiral + flip (Part 9)&lt;/td&gt;
&lt;td&gt;-13.8%&lt;/td&gt;
&lt;td&gt;2.76x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spiral + flip + cascade&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-19.3%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;3.85x&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Read the timing carefully: &lt;strong&gt;the flip fires at step 3. The last liquidation happens at step 7.&lt;/strong&gt; The gamma book turns positive early — and the cascade keeps doing damage for four more steps anyway. The cascade's share of the total loss is 28%.&lt;/p&gt;

&lt;p&gt;That is the mechanism's version of March 2020: the dealer side &lt;em&gt;did&lt;/em&gt; stabilize; the leveraged side was still being unwound on its own clock. "The market stabilized" and "funds kept blowing up" are both true, because they are two different engines.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flip timing is now a race, not a dial
&lt;/h2&gt;

&lt;p&gt;Part 9's threshold sweep showed the flip gets less effective the later it fires. The cascade makes the stakes explicit — the flip is now racing the liquidation schedule:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Flip threshold&lt;/th&gt;
&lt;th&gt;Buckets liquidated&lt;/th&gt;
&lt;th&gt;Drawdown&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;5%&lt;/td&gt;
&lt;td&gt;3 of 4&lt;/td&gt;
&lt;td&gt;-15.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10%&lt;/td&gt;
&lt;td&gt;3 of 4&lt;/td&gt;
&lt;td&gt;-19.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;15%&lt;/td&gt;
&lt;td&gt;4 of 4&lt;/td&gt;
&lt;td&gt;-21.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;20%&lt;/td&gt;
&lt;td&gt;4 of 4&lt;/td&gt;
&lt;td&gt;-23.5%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The gap between an early self-heal and a late one is &lt;strong&gt;7.8 points&lt;/strong&gt; — and the late-heal case liquidates every bucket. When the flip fires after the 3x bucket (15%), the damage converges to the full cascade: nothing is left to save.&lt;/p&gt;

&lt;h2&gt;
  
  
  The distribution view
&lt;/h2&gt;

&lt;p&gt;With uncertain gamma, shock, and flip timing (same priors, 2,000 paths):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;No cascade&lt;/th&gt;
&lt;th&gt;With cascade&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Median&lt;/td&gt;
&lt;td&gt;-15.5%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-19.2%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;p10&lt;/td&gt;
&lt;td&gt;-22.7%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-28.9%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;p1&lt;/td&gt;
&lt;td&gt;-28.6%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-33.5%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worst&lt;/td&gt;
&lt;td&gt;-33.4%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-36.6%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Average path liquidates &lt;strong&gt;2.9 of 4 buckets&lt;/strong&gt; — the typical crash, in this model, unwinds most of the leveraged book even with a working flip. And the tail deepens by ~10 points at p1. The flip shortens the &lt;em&gt;dealer&lt;/em&gt; tail; the cascade owns the &lt;em&gt;leverage&lt;/em&gt; tail, and the two don't cancel.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this means for the "self-healing market" story
&lt;/h2&gt;

&lt;p&gt;Part 9 made the careful point that the flip stops the crash but doesn't reverse it. Part 10 sharpens it: &lt;strong&gt;the flip doesn't even stop all the selling.&lt;/strong&gt; It stops the &lt;em&gt;dealer&lt;/em&gt; selling. The leveraged selling has its own trigger logic, its own grace windows, its own timetable — and it runs to completion unless something interrupts &lt;em&gt;it&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This is why the 2020 policy response targeted &lt;em&gt;both&lt;/em&gt; engines. The vol spike (and eventually Fed backstops on credit markets) handled the dealer side; liquidity provision — the "don't force funds to sell into the abyss" piece — handled the cascade side. A policy that only stabilizes dealers leaves the cascade running. A model that only models dealers misses the same thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Boundaries
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The buckets (leverage, weight, trigger) are a &lt;strong&gt;documented stylization&lt;/strong&gt;, not a fitted margin map. Real books are messier and more correlated.&lt;/li&gt;
&lt;li&gt;The 3-step release is a stand-in for grace windows that vary by counterparty and jurisdiction.&lt;/li&gt;
&lt;li&gt;What this module does &lt;em&gt;not&lt;/em&gt; yet do: &lt;strong&gt;contagion between the two engines&lt;/strong&gt; — the same forced sale that pushes price down also moves the vol surface that triggers the flip; the cascade and the flip are coupled through price, but not through the vol surface itself.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;GitHub: &lt;a href="https://github.com/fengyuGbt/crash_simulator" rel="noopener noreferrer"&gt;github.com/fengyuGbt/crash_simulator&lt;/a&gt;&lt;/strong&gt; — commit &lt;code&gt;a35de56&lt;/code&gt; adds the margin cascade.&lt;/p&gt;

&lt;p&gt;The series now covers the full crash in three acts: the mechanism that deepens it (gamma spiral), the mechanism that stops the dealer side (gamma flip), and the engine that keeps running anyway (margin cascade). If you've sat through a real liquidation queue — margin calls, grace windows, forced sales — I'd like to know what the timetable looked like from inside.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Currently available for freelance work — AI data automation, Python pipelines, and quantitative risk tools. Reach me at &lt;a href="mailto:gopipibank@gmail.com"&gt;gopipibank@gmail.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This article was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@jplenio?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Johannes Plenio&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/forest-heat-by-sunbeam-RwHv7LgeC7s?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>agents</category>
      <category>opc</category>
    </item>
    <item>
      <title>Why the Spiral Stops: The Gamma Flip</title>
      <dc:creator>Feng Yu</dc:creator>
      <pubDate>Tue, 15 Sep 2026 05:58:30 +0000</pubDate>
      <link>https://dev.to/fengyugbt/why-the-spiral-stops-the-gamma-flip-380l</link>
      <guid>https://dev.to/fengyugbt/why-the-spiral-stops-the-gamma-flip-380l</guid>
      <description>&lt;p&gt;&lt;strong&gt;The dealer short-gamma spiral is the series' best story: a selloff forces mechanical hedging, which deepens the selloff. Part 5 turned that loop into 3.07x; Part 8 showed the number was the median of a distribution running to -32%. One thing stayed uncomfortable: in the real world, spirals stop. March 2020 didn't go to zero — it stabilized, then rebounded. This article closes the gap: V9-P5 adds the gamma flip to the kernel, and the mechanism finally explains both halves of a crash — why it deepens, and why it ends.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The uncomfortable fact: spirals terminate
&lt;/h2&gt;

&lt;p&gt;Every mechanism in this series so far has been self-amplifying. Short gamma begets selling; selling begets more short-gamma pressure; margin calls cascade. Run the loop long enough and you get -32%, -50%, worse. Markets don't do that. Even 2008 and 2020 bottomed out.&lt;/p&gt;

&lt;p&gt;Why? Because the &lt;em&gt;position&lt;/em&gt; that drives the spiral is not fixed. The short-gamma dealer is short &lt;em&gt;because&lt;/em&gt; selling tail protection was profitable. When the tail actually arrives, that trade becomes violently unprofitable — implied volatility explodes, and the dealer's book flips: forced to sell on the way down, mechanically attracted to &lt;em&gt;buy&lt;/em&gt; once the vol spike reprices the position. Short gamma becomes long gamma. The selling engine runs out of fuel.&lt;/p&gt;

&lt;p&gt;That's the &lt;strong&gt;gamma flip&lt;/strong&gt;, and it is the mechanism that turns a crash into a bottom.&lt;/p&gt;

&lt;h2&gt;
  
  
  The model: one evolution rule on top of the Part-5 kernel
&lt;/h2&gt;

&lt;p&gt;V9-P4's honest boundary said the kernel didn't yet let gamma evolve path-by-path. &lt;code&gt;gamma_flip.py&lt;/code&gt; adds exactly one rule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gamma starts at -0.666 (short)                        # Part-5 estimate
once cumulative drawdown passes flip_threshold:
    gamma converges toward +0.80 (deep long gamma)     # vol spike flips the book
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything else — the &lt;code&gt;hedge_flow = -κ·γ·ret&lt;/code&gt; feedback, the α/β dynamics — is untouched. One rule, one new parameter family: &lt;em&gt;when&lt;/em&gt; the flip happens (threshold), &lt;em&gt;how hard&lt;/em&gt; it lands (target), &lt;em&gt;how fast&lt;/em&gt; it bites (speed).&lt;/p&gt;

&lt;h2&gt;
  
  
  What the flip does to the single path
&lt;/h2&gt;

&lt;p&gt;With the default threshold (10%):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Drawdown&lt;/th&gt;
&lt;th&gt;Amplification&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;No flip (Part-5 baseline)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-15.4%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;3.07x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flip at -10%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-13.8%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2.76x&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The price path tells the real story — it &lt;em&gt;stabilizes&lt;/em&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;no flip:  1.00 → 0.95 → 0.92 → 0.89 → 0.87 → 0.86 → 0.85 → … → 0.846
with flip: 1.00 → 0.95 → 0.92 → 0.89 → 0.87 → 0.870 → 0.866 → 0.864 → 0.862 (flat)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Flip fires at step 3 (gamma flips -0.666 → +0.80), and the descent stops. Not a V-shaped recovery — a &lt;em&gt;truncated&lt;/em&gt; crash. That distinction matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  When the flip fires is everything
&lt;/h2&gt;

&lt;p&gt;Sweep the threshold — i.e., ask "how much damage does the market tolerate before the flip?":&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Flip threshold&lt;/th&gt;
&lt;th&gt;Drawdown&lt;/th&gt;
&lt;th&gt;Amplification&lt;/th&gt;
&lt;th&gt;Flip step&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;-5%&lt;/td&gt;
&lt;td&gt;-11.9%&lt;/td&gt;
&lt;td&gt;2.39x&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-8%&lt;/td&gt;
&lt;td&gt;-13.0%&lt;/td&gt;
&lt;td&gt;2.61x&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-10%&lt;/td&gt;
&lt;td&gt;-13.8%&lt;/td&gt;
&lt;td&gt;2.76x&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-15%&lt;/td&gt;
&lt;td&gt;-15.4%&lt;/td&gt;
&lt;td&gt;3.07x&lt;/td&gt;
&lt;td&gt;10 (too late)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-20%+&lt;/td&gt;
&lt;td&gt;-15.4%&lt;/td&gt;
&lt;td&gt;3.07x&lt;/td&gt;
&lt;td&gt;never&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The pattern is brutally monotone: &lt;strong&gt;the later the market "self-heals," the more the damage converges to the full spiral.&lt;/strong&gt; Below ~10% the flip materially truncates the crash; at 15% it's already too late — the damage is done before the positions flip. Thresholds, in other words, are not a detail. They are the whole game.&lt;/p&gt;

&lt;h2&gt;
  
  
  The distribution view (Part 8's language)
&lt;/h2&gt;

&lt;p&gt;With uncertain gamma0 / shock / threshold (same priors as V9-P4, 2,000 paths):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;No flip&lt;/th&gt;
&lt;th&gt;With flip&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Median&lt;/td&gt;
&lt;td&gt;-15.5%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-14.0%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;p10&lt;/td&gt;
&lt;td&gt;-22.7%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-19.4%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;p1&lt;/td&gt;
&lt;td&gt;-28.6%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-23.7%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worst&lt;/td&gt;
&lt;td&gt;-33.4%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-27.2%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The flip fires in 80% of paths, and it does what Part 8 showed interventions do: it compresses the &lt;em&gt;tail&lt;/em&gt;, not the center. Median moves ~1.5pp; p1 moves ~5pp; worst moves ~6pp. The mechanism's self-termination is a tail-shortener by construction.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest division of labor
&lt;/h2&gt;

&lt;p&gt;This is the part I want to be careful about. &lt;strong&gt;The gamma flip stops the crash; it does not reverse it.&lt;/strong&gt; In this model, price stabilizes — it does not recover. The V-shaped rebound of March 2020 came from a different engine: the Fed's QE, which this series models as &lt;em&gt;intervention&lt;/em&gt; (flow cut). So the complete 2020 story, in mechanism terms, has two distinct acts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Vol spike flips dealer gamma&lt;/strong&gt; → the selling spiral is truncated (this module).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Liquidity injection reverses the flow&lt;/strong&gt; → the stabilization becomes a recovery (the intervention modules).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Mixing those two acts into one "the market self-corrects" narrative would be wrong — and it's exactly the kind of conflation that produces bad policy conclusions ("no need to intervene, the market will heal itself"). The flip is real, and it is &lt;em&gt;not&lt;/em&gt; a substitute for intervention. It converts an uncontrolled spiral into a controlled stabilization; whether that stabilization becomes a recovery is a separate, policy-driven question.&lt;/p&gt;

&lt;h2&gt;
  
  
  Boundaries
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The flip rule is a &lt;strong&gt;documented stylization&lt;/strong&gt;, not a fitted model. Real flips are messier (they involve specific dealer books, vol-surface repricing, forced liquidations &lt;em&gt;within&lt;/em&gt; the flip).&lt;/li&gt;
&lt;li&gt;The threshold is not calibrated to data. The sweep is the honest way to read it: this is how sensitive the tail is to the timing of the flip.&lt;/li&gt;
&lt;li&gt;What this module does &lt;em&gt;not&lt;/em&gt; yet do: model the &lt;strong&gt;cascade inside the flip&lt;/strong&gt; — the funds that blow up before the book turns positive. That's the next rung: short-gamma → vol spike → forced liquidation → gamma flip as the &lt;em&gt;end&lt;/em&gt; of a cascade, not the start.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;GitHub: &lt;a href="https://github.com/fengyuGbt/crash_simulator" rel="noopener noreferrer"&gt;github.com/fengyuGbt/crash_simulator&lt;/a&gt;&lt;/strong&gt; — commit &lt;code&gt;1611737&lt;/code&gt; adds the gamma-flip module.&lt;/p&gt;

&lt;p&gt;The series has now covered both directions of a crash: the mechanism that makes it worse, and the mechanism that makes it stop. If you've watched a real drawdown stabilize — or the opposite — I'd like to hear what your book did at the turning point.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Currently available for freelance work — AI data automation, Python pipelines, and quantitative risk tools. Reach me at &lt;a href="mailto:gopipibank@gmail.com"&gt;gopipibank@gmail.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This article was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@grakozy?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Greg Rakozy&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/silhouette-photography-of-person-oMpAz-DN-9I?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
