Repository navigation
Replace coined labels with the checks, handlers and fields they stand for - #190
Merged
Merged
Conversation
added 4 commits
September 29, 2026 20:58
… for Sweep the book for words that sound like jargon but are labels the text invented: "gate" for a check, "exit" for a handler that pays out, "promise" for what a program does, "truth" for a recorded field, "proves" for a test, "X-based", "by construction", and "the rule" pointing at a principle instead of stating it. Each now names the handler, field, check or error, or says who gets what money out. The state-machine principle "every state needs an exit" now reads as its content everywhere: every participant must be able to get their money out of every state. Lint the labels that have no legitimate use left: gate (except feature gates), exit, truth (except Offchain Truth), by construction, X-based, a test that proves, and "is an integer comparison". Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
Open and close fees accrue to protocol_fees, which the pool creator sweeps with collect_fees(), and the liquidation fee goes to the liquidator, in all three versions of the program. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
… glossary - "Money" becomes the stake, the collateral, the deposit, the USDC, or assets or amounts. The state-machine principle now reads "every participant must be able to get their assets out of every state" everywhere. Option terms of art and the Arithmetic of Money chapter title stay. - "Guard" becomes check or test. Wormhole's guardians stay. - The glossary's degenerate-value and invariant entries say what K is and link to its entry, instead of assuming the reader has met it. - The betting market's rejected design reads as the naive alternative it is, in the conditional. - The lint rejects "money" and "guard" outside those exceptions. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
added 5 commits
September 30, 2026 16:33
- The companion repository has Kani model checks and tests, and no formal proofs. Every "proves", "Kani proofs", "formally verified" and "machine-checked proofs" now says model-checks or checks, the testing section is "Model Checking Goes Further Than Testing", and one paragraph says what a formal proof is and that the repository has none. It explains that the kani-proofs and proof_* names come from Kani's #[kani::proof] attribute. The conclusion's formal-verification paragraph is gone. - The glossary gains entries for asset (assets on Solana are represented as tokens) and token (SOL is the native token; USDC, NVDAx and the rest are SPL tokens). - The lint rejects the proof wording outside the one distinguishing sentence. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
"Put money on" an outcome is a bet and "get their money back" is a refund, so both are exact. The lint allows them. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
The conclusion's remittance, savings and payday sentences and the escrow chapter's "sent money overseas" describe people, not programs, and read naturally with "money". The lint allows those idioms. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
…them The sweep's "The Draft status is what keeps the list fixed" said the opposite of what happens: add_outcome() works only on a Draft, and the list is fixed when the admin moves the event to Open. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
This was referenced Sep 30, 2026
added 7 commits
September 30, 2026 17:03
"When a losing bet may close" left the reader to guess. The handler requires a settled event (EventNotSettled otherwise) and a bet on a losing outcome (BetWon otherwise), and the test that checks both is now named. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
"Without cancel_offer(), an untaken offer strands the maker's tokens" read as if the program lacked cancel_offer(). The Escrow and Options failure modes and the state-machine example in the Part II intro now say what would happen if the handler didn't exist. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
"His NVDAx is not sold" followed "the borrower", so it read as a gendered pronoun for the role; it is Bob's. The same happened with "every backer" and Alice's token account, and "a put writer" and Carol's. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
added 8 commits
September 30, 2026 18:27
A private key signs; a public key is stored, recorded and checked. Every bare "key" meaning one of them now says which: "the market owner's private key signed it", "her public key is stored as the market's admin", "a single trusted signer". The PDA chapter's key/value store and the order book's critbit keys keep the database meaning. The lint rejects a bare "key", with a per-rule exception for those database uses; lint rules can now carry their own exception. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
It sat in the paragraph about Maria's fee, which gave it the fee's reason. The slippage tolerance bounds how far below the oracle price a deposit's or rebalance's swaps may fill. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
"Each share is worth about $1.07, and nothing needs to happen for that to be true" now says what the vaults hold and how many shares exist. The same kind of sentence elsewhere (nobody has to search, compounds on its own, price-time priority for free) now states the mechanism. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
The managed fund's rounding formulas, the lending market's rounding directions, the fundraiser's three lifecycle tests, and the glossary's address kinds and clusters were lists written as prose. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
… Maria must be two people "The manager is the threat model" overstated it. A footnote says the program sees two public keys, not two people, and points to proof-of-personhood services for keeping the curator and the manager separate. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
Like "the manager is the threat model": the operator acts as the oracle rather than their signature being it, vetting feeds is part of what Victor sells, and a stale price is one way to exploit a program, not the attack. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
"Every resting order's full lock is in a vault" used "lock" as a noun the chapter never defined, and it could be read as a file lock. The order book's invariants, testing list, headings and figures now say the tokens are paid into a vault, held for the order, or credited back. The standard terms "total value locked" and locked minimum liquidity stay. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
set_funding_rate() also requires her signature, and has its own test. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
added 2 commits
September 30, 2026 21:36
Keeps this branch's abandoned-offer sentence and main's degenerate-offers bullet from #191. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
…nt it "Devnet is identical machinery" becomes "runs the same software as mainnet", "the Managed Fund chapter is the machinery" becomes "the Managed Fund chapter builds that program", and so on in the tokens, clusters and conclusion chapters. The linter now rejects "machinery". Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
added 15 commits
September 30, 2026 22:02
…in world The shop owner's investor, the middleman, the friends' pot, the roaster's raise, the supplier's invoice and the licenses between banks and the chain are all everyday money, not a program's holdings. The lint rule's exception names these phrases. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
"Go running" could read as getting excited, and "pot" appeared twice. The sentence now reads "people go for a run when it is their own fifty at stake". Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
"It would strand the maker's tokens the day nobody took the offer" becomes "if nobody took the offer". The same change is made for the betting market's cancelled event, the perps pool that outgrows a transaction, and the price feed that stops publishing. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
…esign It no longer says that designs forget it. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
"One instruction handler per transition" becomes "Give each transition its own instruction handler", "A pause may stop deposits" becomes "Let a pause stop deposits", and so on through the What You Learnt summaries of the concepts and building-blocks chapters. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
…i says proof "A test checks the inputs you thought of" becomes "the values you thought of", since an input can mean the variable itself. The same change is made through the testing section, its summary, the glossary's invariant entry and the escrow chapter. The formal-proof paragraph now opens "Though Kani calls its checks proofs, a model check is not a formal proof." Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
added 5 commits
September 30, 2026 23:05
…night The old wording contrasted "the first tick of day seven" with "the end of the seventh day", which are the same instant when days count from zero. The real trap is a reader taking seven calendar days to mean open until midnight. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows quicknode/solana-book#188, which did this for the Fundraiser chapter. The first commits were pushed to #188's branch after it merged, so they are cherry-picked here onto
main.Wording sweep, every chapter
The book used words that sound like jargon but are labels it had invented. Each now names the handler, field, check or error it stood for, or says who gets what out:
liquidate_position()refuses a healthy position withPositionHealthy"). Solana's "feature gates" and Wormhole's "guardians" stay.Names that follow the companion repository
quicknode/solana-program-examples#171 renamed these identifiers; the chapters and figures now use the shipped names:
protocol_feesprogram_feesaccumulated_protocol_feesaccumulated_program_feescollect_protocol_fees()collect_program_fees()protocol_fees_accrue_and_owner_can_collectprogram_fees_accrue_and_owner_can_collectplace_bid_locks_quote_in_vault,place_ask_locks_base_in_vaultplace_bid_moves_quote_into_vault,place_ask_moves_base_into_vaultModel checks, not formal proofs
The companion repository has Kani model checks and tests, and no formal proofs. The testing section is now "Model Checking Goes Further Than Testing". One paragraph says what a formal proof is and that the repository has none, and explains that the
kani-proofsandproof_*names come from Kani's#[kani::proof]attribute. Every "Kani proofs", "formally verified" and "machine-checked proofs" now says model-checks. The conclusion's formal-verification paragraph is gone. The companion docs were changed to match in quicknode/solana-program-examples#170.Glossary
Factual fixes
program_fees(the pool creator's) and the liquidation fee goes to the liquidator. LPs earn traders' losses and funding.collect_fees()is not Maria's only signed handler:set_funding_rate()also requires her signature.close_losing_bet()works: only on a settled event and only for a bet that lost.Linter
scripts/lint-manuscript.mjsnow rejects:Each rule keeps the exceptions above. The matching style rules are in quicknode/solana-finance-claude-plugin#73, #74 and #75.
npm run lint,node scripts/check-figure-geometry.mjsandnpm run build-pdfall pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn