Overview
Theupdate_deposit_limit instruction allows the program authority to modify the maximum deposit amount for the SOL merkle tree.
For SPL tokens, use update_deposit_limit_for_spl_token instead.
Only the program authority can call this instruction.
Function Signature
Parameters
New maximum deposit amount in lamports. Examples:
- 1 SOL:
1_000_000_000 - 100 SOL:
100_000_000_000 - 1,000 SOL:
1_000_000_000_000(default) - 10,000 SOL:
10_000_000_000_000
Accounts
The merkle tree account to update. PDA:
["merkle_tree"].- Mutable: Yes
- Authority check: Must be owned by the signer
The program authority. Must match the tree’s authority field.
- Signer: Yes
Code Example
Update SPL Token Deposit Limit
For SPL tokens, use the separate instruction with the mint-specific PDA:Common Use Cases
Increase Limit for High Volume
Increase Limit for High Volume
When transaction volume increases, raise the limit to accommodate larger deposits:
Decrease Limit for Security
Decrease Limit for Security
During security incidents or maintenance, lower the limit to reduce risk:
Disable Deposits Temporarily
Disable Deposits Temporarily
Set limit to 0 to prevent all new deposits:
State Changes
MerkleTreeAccount
max_deposit_amount: Updated tonew_limit
Behavior
- Loads the tree account and verifies authority
- Updates the
max_deposit_amountfield - Emits a program log message
- The new limit applies immediately to all subsequent deposits
Authorization
The signer must be the tree’s authority. This is verified through Anchor’shas_one constraint:
Errors
Thrown when the signer is not the tree’s authority.
Program Log Output
When successful, the instruction logs:Monitoring Limit Changes
You can monitor limit changes by:- Parsing transaction logs for “Deposit limit updated” messages
- Periodically fetching the tree account and checking
max_deposit_amount - Setting up event listeners for authority transactions
See Also
- initialize - Initialize program with default limits
- initialize_spl_tree - Set initial SPL token limit
- update_global_config - Update fee rates