Repository navigation
Fundraiser and Perpetual Futures: address Noah Prince's review - #200
Merged
Merged
Conversation
added 8 commits
October 1, 2026 19:35
Fundraiser: remove the per-backer cap section, give the counter-versus- balance section its real reason (the claim and refund must read the same number), and explain why the fundraiser outlives its receipts. Perps: LPs hold the opposite of the traders' net position and earn only net funding; rewrite the production-funding sentence plainly. Glossary: add initial margin. Figures and the margin and price-band sections follow. Claude-Session: https://claude.ai/code/session_019G9tytYrS3Qp42fZ1hBnDu
Every fundraiser box gains claimed and open_contributor_accounts. One set of numbers throughout: Alice 1,000, Bob 800, Carol 500 + 500, eleven receipts to reach 9,000; 3,600 on the failed path. The claim figure no longer closes the fundraiser or vault. Two new figures: the receipts closing after the claim, then close_fundraiser(). Claude-Session: https://claude.ai/code/session_019G9tytYrS3Qp42fZ1hBnDu
The pool's opening threshold is initial_margin_bps (10%), above the 5% maintenance margin; maximum leverage is one over the initial margin. Claude-Session: https://claude.ai/code/session_019G9tytYrS3Qp42fZ1hBnDu
…erage New section on average_price, last_oracle_price and the 20% band: which handlers check it, why liquidations do not, how update_price_average() lets the average catch up, and the tests that run a manipulated read after an idle spell. Failure modes, testing and What You Learnt follow. Claude-Session: https://claude.ai/code/session_019G9tytYrS3Qp42fZ1hBnDu
…fore the LPs Follows the haircut risk model (Percolator) in the companion repository: nothing is reserved at open and profit has no cap; each winner is paid profit x h, never more than liquidity + insurance_fund, and never refused; a profit warm-up; half of each fee to an insurance fund that pays a bankrupt position's deficit before the LPs; an uncollectible liquidation fee is forgiven. Glossary: haircut, profit warm-up; reservation removed. Claude-Session: https://claude.ai/code/session_019G9tytYrS3Qp42fZ1hBnDu
main's review of the Fundraiser chapter kept the per-backer cap and added a Sybil boxout. This branch removes the cap, as the companion program does (quicknode/solana-program-examples#175), so the cap paragraphs and invariant are dropped and the boxout is rewritten for a program with no cap: a count of wallets says nothing about how many people backed a raise. The glossary's Sybil attack entry no longer cites the Fundraiser's cap. Claude-Session: https://claude.ai/code/session_019G9tytYrS3Qp42fZ1hBnDu
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.
Answers each point in Noah Prince's review, and follows the perpetual futures program to the Percolator haircut model. Merge after the companion pull requests the chapters describe, in this order:
Fundraiser
Perpetual Futures
update_price_average().initial_margin_bps(10%) beside the 5% maintenance margin, with the 1:1 link to maximum leverage (10% initial margin = 10x).insurance_fundand the fee split.Glossary: new initial margin, haircut and profit warm-up; insurance fund, auto-deleveraging, leverage, maintenance margin and TWAP updated; reservation removed.
npm run lint,node scripts/check-figure-geometry.mjsandnpm run build-pdfall pass.🤖 Generated with Claude Code
https://claude.ai/code/session_019G9tytYrS3Qp42fZ1hBnDu