Skip to content
Delegations and subscriptions hold rent that normally returns to their recorded payer on revoke. If a sponsor funded the account and the user later closes or replaces their Subscription Authority, the account is stranded and its rent stuck. RevokeAbandonedDelegation and RevokeAbandonedSubscription let the recorded payer reclaim it. To run these snippets on a local network, first set up a local environment.

​When It Applies

Allowed only when the account’s Subscription Authority is provably terminal — closed, or closed and recreated (so init_id no longer matches). A live delegation or subscription can never be closed this way.
RevokeAbandonedDelegationRevokeAbandonedSubscription
ClosesFixed or recurring delegation PDASubscription PDA
SignerRecorded payerRecorded payer
AccountsDelegation + recorded authoritySubscription + recorded authority + plan
Eligible whenAuthority closed, or recreated (init_id mismatch)Same, for the plan’s mint — the mint is read from the bound plan, so an unrelated authority cannot be substituted to force a close
Use ordinary revoke instead whenDelegation is expired or fully spentSubscription is cancelled and expired
RevokeAbandonedDelegation is also the recorded payer’s only recovery path for a never-expiring delegation (expiry_ts == 0) that isn’t fully spent: ordinary revoke fires for the payer only on expiry or, for a fixed delegation, full spend.

​Revoke An Abandoned Delegation

The recorded payer signs. Pass the dead delegation PDA and its recorded Subscription Authority (which may already be closed). Rent returns to the payer.

​Revoke An Abandoned Subscription

The recorded payer signs. Pass the abandoned subscription PDA, its recorded Subscription Authority (which may already be closed), and the plan the subscription belongs to. Rent returns to the payer.

​Notes

  • The recorded payer signs, not the delegator, delegatee, or subscriber.
  • Both instructions fail if the Subscription Authority is still live for the account — use ordinary revoke instead.
  • RevokeAbandonedDelegation works for both fixed and recurring delegations.