Skip to content
Solana’s Token Programs support delegation—granting another account permission to transfer tokens from your token account up to a specified limit. This enables use cases like automated payments, escrow services, and third-party payment processing without giving up custody of your funds.

​How Delegation Works

When you approve a delegate, you’re authorizing a specific account to transfer tokens on your behalf:
  • Owner retains custody: You still own the tokens and can transfer or revoke at any time
  • Capped spending: The delegate can only transfer up to the approved amount
  • Single delegate per account: Each token account can only have one active delegate
  • New approval replaces old: Approving a new delegate automatically revokes the previous one
Delegation is non-custodial. The delegate can spend tokens up to the limit, but cannot access or drain the account beyond the approved amount. The owner can revoke at any time.

​Business Use Cases

Use CaseHow Delegation Helps
Payment processorsMerchant grants processor permission to settle transactions
Automated payrollTreasury approves payroll service to disburse salaries
Escrow servicesBuyer delegates to escrow agent for conditional release
Trading platformsUser approves exchange to execute trades on their behalf
Card issuanceUser approves card issuer to charge purchases to their token account

​Approving a Delegate

Grant another account permission to spend tokens from your account:
Parameters:
  • source: The token account granting permission
  • delegate: The account that will have spending permission
  • owner: Current owner of the token account (must sign the transaction)
  • amount: Maximum tokens the delegate can transfer
  • decimals: Token decimals for validation (prevents decimal errors)

​Demo

To run the demos on this page, create a project and install their packages. "type": "module" lets the demos use top-level await:
In a second terminal, start a local network on 127.0.0.1:8899 with the Surfpool CLI and leave it running:
Save a demo as demo.ts and run it with npx tsx demo.ts.
Approve Delegate

​Revoking a Delegate

Remove all spending permissions from the current delegate:
Revoke removes all delegate permissions—there’s no partial revoke. If you need to reduce the limit, approve the same delegate with a lower amount.

​Demo

Revoke Delegate

​Transferring as a Delegate

When acting as the delegate, use a standard transfer but sign with the delegate keypair instead of the owner:
Transfer as Delegate
The transfer will succeed if:
  • The source account has sufficient balance
  • The delegate signs the transaction
Each transfer reduces the remaining allowance. When the allowance reaches zero, the delegate can no longer transfer tokens.

​Demo

Transfer as Delegate

​Checking Delegation Status

Query a token account to see its current delegate and remaining allowance:

​Demo

Check Delegation Status

​Security Considerations

For account owners:
  • Only approve trusted delegates
  • Set the minimum necessary spending limit
  • Revoke delegations when no longer needed
  • Monitor your accounts for unexpected transfers
For service providers (delegates):
  • Clearly communicate the requested spending limit to users
  • Implement proper key management for your delegate account
  • Track allowance consumption to request re-approval before limits are exhausted

​Delegation vs. Custody

AspectDelegationFull Custody
Token ownershipUser retainsUser transfers to custodian
Spending controlCapped at approved amountFull access to transferred funds
RevocationInstant, by ownerRequires custodian cooperation
Risk exposureLimited to approved amountEntire balance
Trust requiredLimitedHigh
Delegation provides a middle ground—enabling automated payments while limiting risk exposure to the approved amount.
ResourceDescription
Approve DelegateHow to grant another account permission to spend from your token account.
Revoke DelegateHow to remove an existing delegate and revoke its spending permissions.
Transfer TokenHow to transfer tokens between token accounts.