Repository navigation
feat(launchpad_v7): make meteora liquidity configurable per launch - #509
metapileks wants to merge 8 commits into
Conversation
|
Repository Guard
Repository GuardCargo dependency pinning
Cross-program Anchor/Solana version consistency
Anchor.toml solana_version
Crate minimum age
Yarn package.json pinning
npm minimum age
Workflow toolchain consistency
GitHub Action SHA pinning
Sensitive program / config changes
Overall status: pass Lockfile freshness (Cargo.lock + yarn.lock) is checked by the workflow directly and cannot be bypassed. The sensitive-diff section is a review hint - CODEOWNERS handles the actual merge gate. |
Formal verification: Meteora liquidity maths (Lean 4 + Mathlib)This is a machine-checked proof of the arithmetic Result: the maths is safe for both amounts. For every possible raise, Meteora takes at most the amount minted for it and at most one token less, no What is proved
For a $1M raise, the model gives a pool deposit of 2,999,999,999,780 base units for the 3M option (220 short) and 899,999,999,934 for the 900k option (66 short). Trust boundary
ReproduceSave the file below as
|
…completing or while refunding
Every v0.7 launch mints 900,000 tokens for its single-sided Meteora (DAMM v2) pool. The amount is a program constant, so a launch can't choose a different amount or go without the pool. After this change
initialize_launchtakes the amount and stores it on theLaunch, andcomplete_launchcreates the pool from it; 0 means no Meteora pool. The SDK defaults to 900,000 tokens, so existing callers behave as before.What changed
initialize_launchtakesdamm_v2_liquidity_token_amount, mints that many tokens in place of the fixed 900,000, stores it on theLaunchand reports it inLaunchInitializedEvent. It rejects an amount that isn't a whole number of tokens or is above 4,295,048,016 tokens, past which the pool maths at completion would overflow au128.complete_launchcreates the Meteora pool from the stored amount. At 0 it creates no pool and skips the SOL top-up and the position-NFT check. Its account list is unchanged.Launchaccounts grow by 8 bytes, from 785 to 793.resize_launchnow converts the 785-byte layout and writes 900,000 tokens into the new field, which is what those launches already minted; it no longer converts the 784-byte layout. Every other instruction that takes aLaunchrefuses one that hasn't been resized, because an unresized account can still deserialize, and would then read the new field as 0 and complete without its pool.initializeLaunchIxtakes an optionaldammV2LiquidityTokenAmount, default 900,000 tokens, and the v0.7 types are regenerated in place.initialize_launchgained an argument, so earlier SDK versions can't call it on the upgraded program. The package version moves to0.1.3-alpha.2.scripts/v0.7/resizeLaunches.tsprints theLaunchaccount sizes after its run and fails unless they are all the same.Confidence Score: 5/5


The PR appears safe to merge, with no new actionable issues found.Summary
This PR makes each v0.7 launch choose 900,000 or 3,000,000 tokens for its Meteora pool.
No new actionable issues were found. Tests were inspected, not run.
Reviews (3) · Last reviewed commit: "feat(launchpad_v7): limit meteora liquid..." · Reviewed by Greptile