Program Instructions
On-chain instructions exposed by the Veil program.
Admin Instructions
init_config
Initialize global protocol configuration.
Accounts:
admin- signer creating the configconfig- config PDA (["veil_config"])system_program
Parameters:
governance: Pubkeyer_authority: Pubkeyallowed_mints: Vec<Pubkey>whitelist_enabled: boolmax_recipients: u16batch_timeout_secs: u64
update_mint_whitelist
Update whitelist mode and the set of allowed mints.
Accounts:
governanceconfig
Parameters:
whitelist_enabled: boolallowed_mints: Vec<Pubkey>
set_er_authority
Rotate the ER authority.
Accounts:
governanceconfig
Parameters:
new_er_authority: Pubkey
pause
Pause the protocol.
Accounts:
governanceconfig
unpause
Unpause the protocol.
Accounts:
governanceconfig
Vault Instructions
init_vault
Initialize a token-specific vault for an employer.
Accounts:
employerconfigtoken_mintvault- PDA["vault", employer, token_mint]vault_ata- PDA["vault_ata", vault]token_programsystem_program
Parameters: none
deposit
Deposit tokens into a vault.
Accounts:
employervaultvault_ataemployer_atatoken_minttoken_program
Parameters:
amount: u64
withdraw
Withdraw available tokens from a vault.
Accounts:
employervaultvault_ataemployer_atatoken_minttoken_program
Parameters:
amount: u64
delegate_vault
Delegate vault state to the ER flow.
undelegate_vault
Undelegate vault state from the ER flow.
Schedule Instructions
create_schedule
Create a recurring payout schedule.
Accounts:
employerconfigvaultschedule- PDA["schedule", vault, schedule_id]system_program
Parameters:
schedule_id: [u8; 32]interval_secs: u64reserved_amount: u64per_execution_amount: u64merkle_root: [u8; 32]total_recipients: u16er_job_id: [u8; 32]
Validation highlights:
- interval must be between 1 hour and 31 days
reserved_amountmust not exceed vaultavailableper_execution_amountmust be positive and not exceedreserved_amounttotal_recipientsmust be within config and hard protocol limits
pause_schedule
Pause or resume a schedule.
Accounts:
employerconfigschedule
Parameters:
pause: bool
update_schedule
Update a paused schedule.
This instruction replaces the schedule cadence, reserve amount, per-execution amount, Merkle root, and recipient count. It is intentionally paused-only so an active payout cycle cannot change underneath the coordinator.
Accounts:
employer- Signer, vault ownerconfig- Global config PDAvault- Vault PDAschedule- Schedule PDA
Parameters:
interval_secs- Seconds between executions (u64)reserved_amount- New total reserved amount (u64)per_execution_amount- New amount paid per execution cycle (u64)merkle_root- New Merkle root ([u8; 32])total_recipients- New number of recipients (u16)
Rules:
- The schedule must be
Paused - No payout batch can be in progress
per_execution_amountmust be greater than zero and cannot exceedreserved_amount- Increasing
reserved_amountpulls from vault available balance - Decreasing
reserved_amountreleases funds back to vault available balance next_executionis reset to the current timestamp plusinterval_secs
cancel_schedule
Cancel a schedule and release reserved funds back into the vault’s available balance.
Accounts:
employerconfigvaultschedule
Parameters: none
delegate_schedule
Delegate a schedule into the ER execution flow.
Accounts: ER flow accounts
Parameters:
schedule_id: [u8; 32]
undelegate_schedule
Undelegate a schedule from the ER execution flow.
Accounts: ER flow accounts
Parameters:
schedule_id: [u8; 32]
claim_payment
Execute a Merkle-proof-backed claim.
Accounts:
er_authorityconfigvaultvault_ataschedulerecipient_atatoken_minttoken_program
Parameters:
schedule_id: [u8; 32]recipient: Pubkeyamount: u64leaf_index: u16proof: Vec<[u8; 32]>
Commit Instruction
commit
Commit ER execution state back to Solana.
Accounts: commit context accounts
Parameters: none