Program Escrow Spend Limit Precedence
This document clarifies the precedence between the contract-wide global rate limits (RateLimitConfig) and the per-program spend thresholds.
Precedence Resolution
- Per-Program Thresholds: Programs can define a maximum spend threshold via
set_program_spend_threshold. This is strictly enforced during payouts (both single and batch) viaenforce_spend_threshold. If a payout exceeds this limit, it is rejected with aSpendLimitExceedederror. - Global RateLimitConfig: The global
RateLimitConfig(set viaupdate_rate_limit_config) tracks operational parameters likemax_operationsandwindow_size. However, this config is currently not strictly enforced as a blocking limit on payouts (e.g., batch sizes or cumulative payout volumes are not bounded bymax_operationsduring thebatch_payoutexecution).
Conclusion: The per-program threshold is the effective enforced limit for payout amounts. Since the global RateLimitConfig does not enforce hard caps on payout execution (either by batch size or amount), the per-program settings implicitly act as the most restrictive (and only) enforced limits. The per-program spend threshold always overrides the global rate limit.