LarzInsure — Parametric Mutual-Aid Insurance, Built in Larzscript
A premium pools permanently into a shared reserve — real insurance, not a refundable deposit. A claim fires the instant your reported value clears the threshold, but a real require checks something no single wallet can see: whether paying it leaves enough behind for every other active policyholder.
What LarzInsure actually does
outstanding_coverage() sums every other still-active, unexpired policy's coverage — an aggregate that changes shape every time a policy is bought, claimed, or expires. require reserve_after >= floor_requirement stands between every claim and its payout, checking the whole pool, not just the claimant.
Every line below is the real output of a fresh run against the actual interpreter — re-run fresh for this page, not copied from documentation. This first pool sold tiny $10 premiums against $200 of coverage each.
insure.claim(flight_pool, alice_policy, 75) # a real, valid, threshold-clearing claim
reserve: $30 outstanding: $600 (across active, unexpired policies) floor required: $180 (30% of outstanding) headroom: $-150 DENIED: paying this out would drop the reserve below what the pool owes its other active policies
Alice's flight really was delayed past the threshold — a genuinely valid claim. But this pool only has $30 in reserve against $600 it owes across three policies, so paying out would leave the other two holding nothing. require refuses it, the same mechanism the course's error-handling lesson covers.
insure.claim(rainfall_pool, carol_policy, 15) # same require, a properly capitalized pool
CLAIM PAID: $60 carol: $100 reserve: $90 (was $150) outstanding: $120 (across active, unexpired policies) floor required: $24 (20% of outstanding) headroom: $66
Same exact require condition, a different pool's numbers: $50 premiums against $60 of coverage leaves plenty of headroom, so carol's threshold-clearing claim pays out in full — and the pool still has $66 of headroom left for the two policies still active after her payout.
Why it matters
Most of this series checks something ONE wallet or ONE record can answer on its own. This is the first project whose require reads EVERY OTHER sibling policy in the pool before deciding — an aggregate solvency check, recomputed fresh at claim time, not a cached number. wallet, pay, and require are the same money-native core the course's Money-Native Basics lesson teaches — composed here into a check that spans an entire pool, not just one claim.