Skip to content

Order-book figures: vaults are market PDAs, and every account box sits beside its dot - #149

Merged
mikemaccana merged 2 commits into
mainfrom
claude/confident-keller-2i6eks
Sep 22, 2026
Merged

mikemaccana merged 2 commits into
mainfrom
claude/confident-keller-2i6eks

Conversation

@mikemaccana

@mikemaccana mikemaccana commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Seven order-book figures and the token-account Venn figure drew the order book and the three vaults as offcurve dots captioned A CLIENT KEYPAIR. That was wrong twice over. An address made from a key pair is a public key and is never off the curve. And a key pair is not an address: it is a public key and a private key, of which only the first is public.

Merge after quicknode/solana-program-examples#148. That pull request makes the vaults PDAs of the market. This one names its seeds, and the book never names what the companion repository hasn't shipped.

Figures

  • The three vaults are derived-address dots beside their seed captions: "BASE_VAULT" + MARKET ADDRESS, "QUOTE_VAULT" + MARKET ADDRESS and "FEE_VAULT" + MARKET ADDRESS. They sit in the program column where their boxes and arrows already were on main.
  • The order book is the one account the client must create, so its dot stays on the curve. Its box sits above the curve at the top right, beside its dot, where the USDC mint box was.
  • The NVDAx and USDC mint boxes are gone. These figures name the mints only in seeds and fields, and a not-drawn note says so.
  • token-accounts-and-atas.svg: the market's base vault gets its seed caption, and the labels say it is a PDA of the market.
  • token-accounts-off-the-curve.svg: the headline "Token accounts are always off curve" becomes "Derived token accounts sit off the curve", and the legend's on-curve dot takes the public-key radius.

Prose

  • The order-book chapter says the vaults are PDAs of the market and names their seeds.
  • It says the book's address is a public key, drawn on the curve, and that its private key signs once, at creation.

Rules so it cannot recur

  • scripts/lint-manuscript.mjs fails any figure caption naming a key pair, and any prose calling a key pair an address, an account, or on or off the curve.
  • scripts/check-figure-geometry.mjs check 9: an r="6" dot must touch the curve and an r="5.5" dot must sit clear of it.
  • Check 12 (new): every address dot sits within 20 units of an account box, legend keys aside. It fails the named-dot version of these figures this pull request briefly carried.
  • The checker now measures dots after transforms. It previously read raw cx/cy, which is wrong for figures that position whole columns with a translate.
  • WRITING-PLAN.md records the convention. The matching figure and vocabulary rules for the companion plugin are in DIAGRAMS.md, SKILL.md: a key pair is never off the curve, never an address, and its box sits beside its dot solana-finance-claude-plugin#63.

Lint, the geometry check, and the full PDF build all pass. check-figure-bands.mjs (advisory) reports one band in the withdraw-fees figure, left where the order-book box used to sit in the program column.

🤖 Generated with Claude Code

https://claude.ai/code/session_011VUvZT5384GaSBhhgJwFp3

@mikemaccana mikemaccana changed the title Label order-book vault addresses on the Solana curve Order-book figures: the book and its vaults are public keys, so their dots sit on the curve Sep 18, 2026
@mikemaccana
mikemaccana force-pushed the claude/confident-keller-2i6eks branch from 018b86d to c2db4d8 Compare September 22, 2026 22:05
@mikemaccana mikemaccana changed the title Order-book figures: the book and its vaults are public keys, so their dots sit on the curve Order-book figures: vaults are market PDAs, and every account box sits beside its dot Sep 22, 2026
Mike MacCana added 2 commits September 22, 2026 22:28
… dots sit on the curve

Seven order-book figures and the token-account Venn figure drew the order
book and the three vaults, all created from key pairs Maria's client
generates, as offcurve dots captioned "A CLIENT KEYPAIR". That was wrong
twice over: an address made from a key pair is a public key and is never
off the curve, and a key pair is not an address at all, it is a public key
and a private key, of which only the first is public.

Each of the four accounts now has an r=6 dot on the curve, between Maria
and the program, named for its account in the caption face because its box
hangs too far below the program to reach the curve; the boxes carry no dot
and no caption. To make room the USDC mint box moves left, the network
label rises, and the program column drops ten units, with the arrows that
touch it re-aimed. The Venn figure's base vault sits on a piece of curve as
the legends do, and the "always off curve" headline now says derived token
accounts, since the previous figure shows one that is not.

Rules so it cannot recur: check-figure-geometry.mjs fails an r=6 dot clear
of the curve and an r=5.5 dot touching it; lint-manuscript.mjs fails a
caption naming a key pair and prose that calls a key pair an address, an
account, or off the curve; WRITING-PLAN.md records the convention, and the
companion plugin's DIAGRAMS.md and SKILL.md carry the matching rules. The
order-book chapter and the tokens chapter say where these addresses come
from.

Claude-Session: https://claude.ai/code/session_011VUvZT5384GaSBhhgJwFp3
…side its dot

The first fix named the order book's and the vaults' dots on the curve and
left their boxes up to 300 units below, so a reader had to match a label
to a box half a page away. The companion program now makes the three
vaults PDAs of the market (quicknode/solana-program-examples#148), so they
draw like every other program-owned account: an offcurve dot beside a
seed caption, "BASE_VAULT" + MARKET ADDRESS and its siblings, in the
column where their boxes and arrows already were on main.

The order book is the one account the client must create, so its dot
stays on the curve, and its box moves above the curve at the top right,
beside its dot, where the USDC mint box was. The NVDAx and USDC mint
boxes go: these figures name the mints only in seeds and fields, and a
not-drawn note says so. The token-account Venn figure's base vault gets
its seed caption too, and the order-book chapter says the vaults are
market PDAs.

The geometry checker now measures address dots after transforms and
gains check 12: every address dot sits within 20 of an account box,
legend keys aside. It fails the named-dot figures this replaces. The
named-dot wording leaves WRITING-PLAN.md and the lint message.

Claude-Session: https://claude.ai/code/session_011VUvZT5384GaSBhhgJwFp3
@mikemaccana
mikemaccana force-pushed the claude/confident-keller-2i6eks branch from 73610dc to 96baff7 Compare September 22, 2026 22:30
@mikemaccana
mikemaccana merged commit 6755307 into main Sep 22, 2026
1 check passed
@mikemaccana
mikemaccana deleted the claude/confident-keller-2i6eks 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