Skip to main content
This script handles an ordinary withdrawal request in separate runs. Queue and claim use the depositor keypair; fill uses an authorized manager or allocator with the installed fill policy. Governance OptOut requests use the separate proposal-aware fill contract.

Set up

Use a funded vault with configured prices and enough payout liquidity for a full fill. Queueing requires the depositor’s LP ATA. The program enforces claim timing and cancellation cooldown.

Script

Save as queued-withdrawal.mts. Running a phase simulates and submits transactions. The manual claim sender targets vaults whose refresh and claim fit one transaction with the supplied price-plan tables; larger accounts need the refresh and bundle pattern, including any additional vault lookup tables.
queued-withdrawal.mts

Run each phase

Alternatively, before any fill and after cancellation cooldown, the depositor can run cancel. A partial fill can be claimed once: it pays every recorded fill, returns unfilled LP, and closes the request. Resolve uncertain confirmation before retrying any phase.