Skip to content

Describe the companion's new handlers and checks, and source nine claims - #258

Merged
mikemaccana merged 1 commit into
mainfrom
claude/wonderful-hawking-5gg014-program-followup
Oct 4, 2026
Merged

mikemaccana merged 1 commit into
mainfrom
claude/wonderful-hawking-5gg014-program-followup

Conversation

@mikemaccana

Copy link
Copy Markdown
Collaborator

Off main directly (no stack). Two things in one commit, because the second touches chapters the first also edits.

The book follows quicknode/solana-program-examples#190

The chapters describe each new mechanism at the step where it is used and name the test, with every identifier grepped against the companion at main:

  • Betting Market: Maria's close as a walkthrough step with its own figure; close_outcome() and close_event(), open_bets and open_outcomes, the refusals EventNotFinished, BetsStillOpen, OutcomesStillOpen; the dust now reaches the fee recipient; the State Machines rule is met and each account's closer is named (config stays open); four new tests named.
  • Order Book: pause_market() and resume_market(), what a pause stops (new orders) and never stops (cancels, settlement, fee withdrawal); is_active and MarketPaused back as real; five tests named.
  • Prop AMM, Perpetual Futures: price_feed_program recorded at creation and PriceFeedNotFromOracle first in every oracle read; the perps check list is seven; the funding and first-deposit tests described as they now assert.
  • Lending: the price feed's confidence band, max_confidence_bps per reserve (validated 1 to 10,000), OracleConfidenceTooWide, five tests, and the fifty-round-trip rounding test.
  • Options: the put followed to expiry and reclaim; ConstraintDuplicateMutableAccount as what refuses a writer buying their own option; the zero-fee test's inner-instruction count; the Kani harness proof_collect_fees_pays_only_the_fees_owed for the fees invariant.
  • Offchain Truth: which programs check provenance and confidence.
  • Program boxes in fourteen figures list the new handlers; the market and pool creation figures show price_feed_program.

Nine unsourced claims, now sourced or corrected

From a source check against primary documents (Neodyme's post and SPL PR 1883, Pyth forum OP-PIP-131, the CFTC complaint, Hundred's and CertiK's post-mortems, the World Bank Q3 2025 report, Visa's US interchange schedule, Anza's feature tracker, the Universalis and Kentucky Derby pages and the 1891 law's text, Zeta's and PsyOptions' own posts):

  • Neodyme: try_round_u64() became try_floor_u64() at both conversion sites, not "one word"; $2.6B is value at risk, with the PR linked.
  • Pyth Core: migrated 26 August 2026 under OP-PIP-131; updates signed by Pyth's own five-key multisig, onchain fee zero, data from Pyth Pro. "Free" dropped.
  • Mango: the oracle price went from about four cents to fifty-four, the CFTC's figure.
  • Hundred and Sonne: the loss came from borrowing against inflated collateral; the floored redeem recovered the donation. The chapter said the opposite.
  • Remittances: 6.36% global average (was "near 6.5%"); the Western Union/MoneyGram line is not in the report and is gone.
  • Card fees: a footnote with Visa's 2026 US interchange range and Regulation II, scoped as a US café's all-in cost.
  • Slot time: mainnet was at 250 ms in September 2026; the 200 ms feature was live on testnet and pending on mainnet, per Anza's tracker, with the feature address.
  • Parimutuel: the 1891 law authorized the pari mutuel; bookmakers had been banned the year before. Sources footnoted for all three dates.
  • Zeta wound down 1 May 2025 and its team moved to Bullet, a trading network; PsyOptions launched 22 August 2021 and was first by its own account.

Manifest's URL was confirmed correct and left alone. The lint's "gate" rule now accepts the hyphenated form inside a URL (Feature-Gate-Tracker-Schedule).

Checks

npm run lint clean, node scripts/check-figure-geometry.mjs clean across 115 figures (one stale exception removed, since the arrow it excused now lands cleanly), npm run build-pdf builds (312 pages).

🤖 Generated with Claude Code

https://claude.ai/code/session_01UX53A6YR1Hjr8z6WzJxf2q


Generated by Claude Code

…rce nine claims

The companion repository now closes a betting event, pauses an order
book, checks which program owns a price feed, and bounds a price's
confidence band (quicknode/solana-program-examples#190). The chapters
describe each at the step where it is used and name the tests:

Betting Market: Maria's close as a walkthrough step with its figure,
close_outcome() and close_event(), open_bets and open_outcomes, the
three refusals, and the State Machines rule met with each account's
closer named. Order Book: pause_market() and resume_market(), what a
pause stops and what it never stops, the five tests. Prop AMM and
Perpetual Futures: price_feed_program recorded at creation and
PriceFeedNotFromOracle first in every oracle read; the perps check list
is seven. Lending: the price feed's confidence band, max_confidence_bps
per reserve, OracleConfidenceTooWide, and the fifty-round-trip rounding
test. Options: the put followed to expiry and reclaim, the duplicate
mutable account that refuses a writer buying their own option, the
inner-instruction count behind the zero-fee test, and the Kani harness
for the fees invariant. Offchain Truth lists which programs check
provenance and confidence. Program boxes in fourteen figures list the
new handlers.

Nine claims the audit could not source are corrected or qualified
against their primary sources: the Neodyme fix named by function and
site, Pyth Core's August 2026 migration, Mango's oracle price move as
the CFTC states it, the Hundred and Sonne mechanism (borrowing against
inflated collateral, not a loop of redeems), the World Bank's 6.36%
average, the US card interchange schedule behind the café's fee, the
slot-time stages and the pending mainnet 200 millisecond feature, the
1891 French law's actual provision, Zeta's wind-down and successor, and
PsyOptions' launch date. The lint's "gate" rule now accepts the
hyphenated form inside a URL.

Claude-Session: https://claude.ai/code/session_01UX53A6YR1Hjr8z6WzJxf2q
@mikemaccana
mikemaccana merged commit d54468d into main Oct 4, 2026
1 check passed
@mikemaccana
mikemaccana deleted the claude/wonderful-hawking-5gg014-program-followup branch October 13, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant