feat(xc-admin-cli): propose integrity-pool reward withdraw#3922
Merged
Conversation
Add a withdraw-integrity-pool-rewards multisig command that proposes the integrity-pool withdraw instruction through the Squads vault. When no amount is given it withdraws the full reward-custody balance, and it simulates the built instruction before proposing so a failing withdraw is never queued.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 7 Skipped Deployments
|
The withdraw command read pythTokenMint off the result of integrityPoolProgram.account.poolConfig?.fetch(), which the generic Idl-typed Program exposes as possibly-undefined with unknown fields, breaking the tsc build (TS18048 / TS2345). Cast the fetched account to its known shape so the mint can be passed to PublicKey.
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.
Adds a
withdraw-integrity-pool-rewardsmultisig command to xc-admin-cli that proposes the integrity-poolwithdrawinstruction through the Squads vault.Details
integrity-pool.jsonIDL with thewithdrawinstruction and thePoolConfigaccount so Anchor can build the instruction and read the reward-custody mint on-chain.--destination(a PYTH token account) and an optional--amountin raw base units. When--amountis omitted it reads the reward-custody token balance and withdraws the full amount.reward_program_authorityis resolved to the multisig vault authority PDA (same pattern asset-publisher-stake-account);pool_configis auto-resolved from its PDA seeds andpool_reward_custodyis derived as the pool_config ATA of the pool'spyth_token_mint.sigVerify: false, since the authority signature is produced by the vault PDA at execution time) and the command aborts if the simulation fails.Verification
Simulated the built instruction against Solana mainnet-beta (pool_config
BE8Xq1iHSQYKG8CZorZsrTnxyeHKQLzCWm4dYKdFkVEL, reward custodyFbSivnCf6iXfXns6osFih2MgX8icmSKx9iba3gyFpiCT): the transaction returnederr: nullwith program logs showingInstruction: Withdrawand a successful SPL token transfer CPI.