Skip to content

Let each market's state account own its vaults - #107

Merged
mikemaccana merged 1 commit into
mainfrom
claude/vault-ownership-book-iq6e8m
Sep 10, 2026
Merged

mikemaccana merged 1 commit into
mainfrom
claude/vault-ownership-book-iq6e8m

Conversation

@mikemaccana

Copy link
Copy Markdown
Collaborator

Summary

Merge quicknode/solana-program-examples#145 first. This PR describes the companion repository after that change lands.

The token swap, prop AMM, perpetual futures, and options venues each had a dataless "authority" PDA beside their state account, existing only to own the vaults and sign for them. A program-owned data account signs with its own seeds just as well, as the escrow's offer account already did, and the seeds never change however the account's data does, so the extra account bought nothing but one more account per instruction. The companion repository now has the pool config, market, or pool own its vaults and mints directly and sign with its own seeds.

Here, the four chapters and their sixteen figures follow:

  • The authority box is gone from every account map and lifecycle figure: three constant-product AMM figures, the prop AMM account map, three perpetual futures figures, and all nine options lifecycle figures. Each vault's and mint's owner label names the state account ("authority: the pool config", "the market", "the pool"), the token swap's reserve seeds read as associated token accounts of the pool config, and the columns reflow to close the gap the deletion left.
  • The prose in the four chapters says the state account owns the vaults and, being a PDA, signs for them. The perpetual futures chapter's "pool authority" where it meant the operator now says "pool operator".

One commit. Authored under the book author's own email with no assistant co-author trailer, per CLAUDE.md. Independent of #106, which carries the Options chapter's wording edits; the two touch different sentences of options.md.

Verified

npm run lint and node scripts/check-figure-geometry.mjs are clean across all 91 figures, node scripts/check-figure-bands.mjs reports no new dead space in the changed figures, and npm run build-pdf produces 276 pages with the title page on page 3 and every part and chapter opening on a right-hand page.

🤖 Generated with Claude Code

https://claude.ai/code/session_014RdEWCoCChaoKPhvcftHVG


Generated by Claude Code

The token swap, prop AMM, perpetual futures, and options venues each had
a dataless "authority" PDA beside their state account, existing only to
own the vaults and sign for them. A program-owned data account signs
with its own seeds just as well, as the escrow's offer account already
did, and the seeds never change however the account's data does, so the
extra account bought nothing but one more account per instruction. The
companion repository now has the pool config, market, or pool own its
vaults and mints directly, and the four chapters and their sixteen
figures follow: the authority box is gone from every account map and
lifecycle figure, each vault's owner label names the state account, and
the prose says the state account signs.

Claude-Session: https://claude.ai/code/session_014RdEWCoCChaoKPhvcftHVG
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