Overview
Theupdate_deposit_limit_for_spl_token instruction allows the program authority to modify the maximum deposit amount for a specific SPL token’s merkle tree.
Each SPL token has its own separate merkle tree with its own deposit limit.
Only the program authority can call this instruction.
Function Signature
lib.rs:191-206
Parameters
u64
required
New maximum deposit amount in the token’s smallest unit. The value depends on the token’s decimals:USDC (6 decimals):
- 1,000 USDC:
1_000_000_000 - 10,000 USDC:
10_000_000_000 - 1,000,000 USDC:
1_000_000_000_000
- Similar to USDC
- 100 tokens:
100_000_000_000 - 1,000 tokens:
1_000_000_000_000
Accounts
AccountLoader<MerkleTreeAccount>
required
The SPL token-specific merkle tree account to update.PDA Seeds:
["merkle_tree", mint.key()]- Mutable: Yes
- Authority check: Must be owned by the signer
Account<Mint>
required
The SPL token mint account. Used to derive the correct tree PDA.
- Mutable: No
- Validation: Must be in the allowed tokens list (see supported tokens)
Signer
required
The program authority. Must match the tree’s authority field.
- Signer: Yes
- Validation: Checked via
has_one = authorityconstraint
Code Example
Common Use Cases
Update USDC Limit
Update USDC Limit
Increase USDC deposit limit to 1 million:
Disable Deposits for a Token
Disable Deposits for a Token
Set limit to 0 to prevent new deposits of a specific token:
Update Multiple Token Limits
Update Multiple Token Limits
Update limits for multiple tokens in sequence:
State Changes
MerkleTreeAccount (for the specific SPL token)
max_deposit_amount: Updated tonew_limit
Behavior
- Verifies the signer is the tree’s authority
- Loads the SPL token-specific tree account (derived from mint address)
- Updates the
max_deposit_amountfield - Emits a program log message with the mint address
- The new limit applies immediately to all subsequent deposits of that token
Implementation
lib.rs:191-206
Account Constraints
lib.rs:857-872
Errors
Error (6000)
Thrown when the signer is not the tree’s authority.
Error (6018)
Thrown if the mint is not in the allowed tokens list (on non-localnet environments).
Program Log Output
When successful, the instruction logs:Monitoring
Monitor limit changes for specific tokens:Network Differences
- Mainnet/Devnet: Only allowed tokens can have their limits updated
- Localnet: Any SPL token mint can be used for testing
See Also
- update_deposit_limit - Update SOL deposit limit
- initialize_tree_account_for_spl_token - Initialize tree with initial limit
- supported-tokens - List of allowed SPL tokens
- deposit-limits - Deposit limit configuration guide