Vault Instructions

deposit

Deposit USDC into the agent's stake account. Creates a stake account on first deposit. Automatically upgrades the agent's tier when balance crosses a threshold.

  • amountu64, USDC amount in base units (6 decimals)
request_withdrawal

Start a withdrawal. Initiates a cooldown period (default 7 days, configurable via governance, range: 1–90 days) period. Automatically downgrades tier if the remaining balance falls below the current tier threshold.

  • amountu64, USDC amount to withdraw
complete_withdrawal

Finalize a withdrawal after the cooldown period has elapsed. Transfers USDC back to the owner's token account.

cancel_withdrawal

Cancel a pending withdrawal request. Restores the amount to the available balance and automatically upgrades the tier if applicable.

close_stake

Close an empty stake account and reclaim rent after deactivation.

  • owner — the wallet that owns the stake account
  • agentPda — the agent PDA associated with the stake account