program: require onramp to exist for deposit and withdraw#648
Merged
2501babe merged 3 commits intosolana-program:mainfrom Apr 24, 2026
Merged
program: require onramp to exist for deposit and withdraw#6482501babe merged 3 commits intosolana-program:mainfrom
2501babe merged 3 commits intosolana-program:mainfrom
Conversation
3f018b6 to
5bcc433
Compare
joncinque
approved these changes
Apr 24, 2026
Contributor
joncinque
left a comment
There was a problem hiding this comment.
Looks great! I always thought you meant it to be "net effective value" 😅
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.
i should have thought of this before but maybe splitting up #580 and #601 made me neglectful. we use onramp lamports for pool value now so we should just hard require it to exist. i considered working around its possible nonexistence but this is pointless. people will want their mev rewards, just make the account
with onramp, the
pool_net_asset_value()change is no different, its just a bit more defensive. without onramp, the current version ofpool_net_asset_value()is wrong, because it subtractsRent::get().minimum_balance(0)from the pool valuerequiring the onramp saves us from having to contemplate stupid edge cases like "what if it doesnt exist and has rent exemption for 0 but not enough for 200, is that pool value? what if it has enough for 200, is that pool value? what about more than that. what if it doesnt exist but they create it after. what if it has some lamports, but not enough for 0, but they add more after." enough
also i have some kind of brain disease that causes me to abbreviate "net asset value" as "nev" for some reason, so i also fix that