Skip to main content
POST
/
accounts
/
{address}
/
spending-limit
Create a spending limit
curl --request POST \
  --url https://grid.squads.xyz/api/grid/v1/accounts/{address}/spending-limit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "amount": 1,
  "destinations": [
    "<string>"
  ],
  "expiration": 123,
  "mint": "<string>",
  "period": "<string>",
  "spending_limit_signers": [
    "<string>"
  ],
  "transaction_signers": [
    "<string>"
  ]
}'
{
  "kms_payloads": [
    {
      "address": "<string>",
      "payload": "<string>",
      "provider": "privy"
    }
  ],
  "spending_limit_address": "<string>",
  "transaction": "<string>",
  "transaction_signers": [
    "<string>"
  ]
}
Create a spending limit to enable controlled, recurring payments without requiring full account authority signatures. Spending limits provide a secure way to delegate payment authority for specific tokens and amounts.

Spending Limit Concepts

Period Types

  • ONE_TIME: Single-use allowance
  • DAILY: Resets every 24 hours
  • WEEKLY: Resets every 7 days
  • MONTHLY: Resets every 30 days

Key Components

  • Amount: Maximum spendable amount in smallest token units
  • Mint: Token contract address (e.g., USDC, SOL)
  • Period: How often the limit resets
  • Spending Limit Signers: Authorized addresses that can use the limit
  • Destinations: Optional list of allowed recipient addresses
  • Expiration: Optional expiration timestamp

Security Model

Spending limits operate with reduced security requirements compared to full account operations:
  1. Creation: Requires full account authority signatures
  2. Usage: Only requires spending limit signer authorization
  3. Updates: Requires full account authority signatures
  4. Deletion: Requires full account authority signatures

Use Cases

  • Employee Expenses: Allow employees to spend within limits
  • Subscription Payments: Automate recurring payments
  • DeFi Operations: Enable automated DeFi strategies
  • Bill Payments: Simplify recurring bill payments

Important Notes

  • Amounts are specified in the token’s smallest unit (e.g., 1 USDC = 1,000,000 units)
  • Spending limits reset automatically based on the period
  • Unused amounts don’t carry over to the next period
  • Multiple spending limits can exist for different tokens
  • Spending limit addresses are generated deterministically

Authorizations

Authorization
string
header
required

Your Grid API key from the Grid Dashboard

Path Parameters

address
string
required

Smart account address

Body

application/json
amount
integer
required
Required range: x >= 0
mint
string
required
period
string
required
destinations
string[]
expiration
integer | null
spending_limit_signers
string[]
transaction_signers
string[]

Response

Spending limit created successfully

kms_payloads
object[]
required
spending_limit_address
string
required
transaction
string
required
transaction_signers
string[]