Wallet Infrastructure
Wallet Infrastructure
Treasury

Spending Limits

Set an amount per time window for each signer.

Releasing soon

Allowance usage and delegate spends sent by the platform, with the spend_limit_exceeded error, are being released.

Spend caps

A spend cap limits how much one signer can send of one asset within a rolling time window. We record it and check it before every payment, on every network the wallet holds.

FieldValue
signerIdThe signer the cap applies to.
assetThe asset, for example USD₮.
limitBaseUnitsThe cap, in the asset's base units.
windowSecondsThe rolling window, in seconds.
treasurytrue for a treasury wallet (default), false for a customer wallet.
ActionRequest
Set a capSet spend cap
List capsList spend caps
Remove a capRemove spend cap

Also enforced on chain

On treasuries that hold a Safe, the same cap can also be written to the Safe, which then enforces it itself. Add onChain to Set spend cap:

  1. The cap is recorded and enforced by us straight away.
  2. The response returns a userOpHash for the on-chain allowance.
  3. Signers approve it like any payment; see Signers and Approvals.

If the on-chain step does not start, the recorded cap stays in force and the response says why.

To write allowances yourself instead, Create delegate address returns the signer's delegateAddress and the entityKey that authorises spending against it, for use in Prepare allowance setup. The signer must be a passkey registered on the treasury; any other signer is refused with 403.

Allowance usage (releasing soon)

List allowances returns each on-chain allowance with its cap, what was spent and what remains in the current window, and when the window resets.

Spending within the allowance (releasing soon)

A signer spends within their allowance with Prepare delegate spend and Submit delegate spend. The platform sends the payment and pays the network fee.

A spend above what remains is refused with 409 spend_limit_exceeded, which states the remaining amount and when the window resets. Nothing is sent.

Removing a cap

A cap linked to an on-chain allowance is removed only after the allowance is revoked; until then the request is refused with 409. Revoke it with Prepare allowance setup and a cap of zero.

Errors

CodeStatusCause
spend_limit_exceeded409The amount is above what remains of the allowance. detail states what remains and when the window resets.
forbidden403The signer is not a passkey registered on this treasury, or the Safe is not this treasury's.
validation_failed409Removing a cap whose on-chain allowance is still in force, or that may have one we cannot check. Revoke the allowance first.

On this page