Repository navigation
The constant-product pool opens with its first deposit - #259
Merged
Merged
Conversation
The companion's initialize_pool() now takes the first deposit in the same instruction, so Maria's walkthrough opens the pool with her 400 ACME and 900 USDC in one step, the first-deposit arithmetic is attributed to initialize_pool() and initial_lp_amount(), the invariants gain "both effective reserves are positive from creation on", and the failure mode that said anyone can be first now describes the defense and names test_pool_creation_cannot_be_front_run. The first-deposit figure becomes initialize_pool()'s, with the accounts it creates badged NEW. No walkthrough number changes. Claude-Session: https://claude.ai/code/session_01UX53A6YR1Hjr8z6WzJxf2q
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.
Merge after quicknode/solana-program-examples#192, which it describes: the book never describes a defense that has not shipped.
The companion's
initialize_pool()now takes the first deposit in the same instruction, so pool creation cannot be front-run. In the chapter:initialize_pool()step; the separate seeding call is gone. No walkthrough number changes.initialize_pool(),initial_lp_amount()andinteger_sqrt(), withdeposit_and_mint_lp_tokens()named as the shared transfers-plus-mint.test_pool_creation_cannot_be_front_run, with its numbers (a 400 ACME against 100 USDC deposit right after creation is clamped to 44.44 ACME, and the pool still prices at $2.25).amm-first-deposit.svgbecomesinitialize_pool()'s figure, with the pool config, vaults and LP mint it creates badged NEW.Every identifier grepped against the companion branch.
npm run lintclean, geometry clean across 115 figures, PDF builds (312 pages).🤖 Generated with Claude Code
https://claude.ai/code/session_01UX53A6YR1Hjr8z6WzJxf2q
Generated by Claude Code