Repository navigation
Order book: say how the program stops book spam - #170
Merged
Merged
Conversation
The companion program now evicts: when an order would rest on a full side and beats that side's worst price, the worst order is refunded as a cancel would refund it and the new order takes its slot. The book spam failure mode now describes that mechanism, and the errors it names, instead of listing the gates that only reject spam. The invariants, tests, What You Learnt list, state machine figure, and glossary follow. Also corrects the capacity: each side holds 512 orders, not 1,024, because every order after the first takes two of the tree's 1,024 nodes. Depends on quicknode/solana-program-examples#158, which ships eviction and the names this chapter uses. Claude-Session: https://claude.ai/code/session_01RBfNjrQd2J6muoi3thCUin
mikemaccana
added a commit
that referenced
this pull request
Sep 23, 2026
This branch described eviction as something other order books do, in the book spam failure mode and a glossary entry. The companion program now evicts (quicknode/solana-program-examples#158), and #170 describes the program's own eviction in both places. Restore main's book spam bullet and drop the OpenBook footnote and glossary entry here, so the two PRs neither conflict nor contradict each other. Claude-Session: https://claude.ai/code/session_01RBfNjrQd2J6muoi3thCUin
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.
The Order Book Exchange chapter's book spam failure mode listed the gates that reject spam, but it had no answer to a side filled with far-off orders. The companion program now evicts the worst order when a side is full, and this PR describes that.
Merge after quicknode/solana-program-examples#158. That PR ships eviction and every name this chapter now uses:
EvictedAccountMismatchand the five eviction test names. Merging this first would name identifiers that have not shipped.Changes
cancel_order()refunds, and the new order takes its slot. An order that is no better, including an equal price, getsOrderBookFull.PR #119 also touches the book spam bullet and adds an eviction glossary entry, both describing eviction as something other order books do. Those two additions are removed from #119 so the two PRs don't conflict or contradict each other.
Verification
npm run lint: cleannode scripts/check-figure-geometry.mjs: clean across 99 figuresnpm run build-pdf: built🤖 Generated with Claude Code
https://claude.ai/code/session_01RBfNjrQd2J6muoi3thCUin
Generated by Claude Code