Price wrap and unwrap at the escrow / wrapped supply rate - #694
Open
staccDOTsol wants to merge 1 commit into
Open
staccDOTsol wants to merge 1 commit into
staccDOTsol wants to merge 1 commit into
Conversation
Wrap mints amount * supply / escrow and unwrap pays amount * escrow / supply, both rounded down. While escrow equals supply this is exactly the existing 1:1 behavior. Instructions, accounts and instruction data are unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This branch has not been deployed
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.
Summary
Prices
WrapandUnwrapat the escrow / wrapped supply rate instead of a fixed 1:1.This does not change any wrapped token whatsoever, unless wrapped tokens have been burned (or the wrapped supply has otherwise been reduced), or unwrapped tokens have been donated to the escrow. While escrow balance equals wrapped supply, which is the case for every wrapped mint that has only ever been wrapped and unwrapped, the result is exactly the existing 1:1 behavior.
Why
Today, unwrapped tokens sent directly to an escrow, and the backing of wrapped tokens that were burned directly, are stranded: nobody can ever redeem them. With this change they accrue pro rata to the remaining wrapped token holders.
What changes
Wrapmintsamount * wrapped_supply / escrow, rounded down. An empty wrapped mint still mints 1:1.Unwrappaysamount * escrow / wrapped_supply, rounded down.What does not change
CreateMint,CloseStuckEscrow, metadata sync and the canonical pointer.Tests
🤖 Generated with Claude Code