Vault Operations

Vaults are the core treasury accounts in ClawPay that hold your digital assets.

Overview

A vault is a smart contract-based account on Solana that:

  • Holds USDC, SOL, or other SPL tokens

  • Enforces programmable authorization rules

  • Supports multi-party approval workflows

  • Provides real-time balance tracking

  • Enables instant transfers within the network

Creating Vaults

Basic Vault

const vault = await client.vaults.create({
  name: 'Company Treasury',
  currency: 'USDC',
  network: 'solana'
});

console.log(`Vault ID: ${vault.id}`);
console.log(`Deposit address: ${vault.depositAddress}`);

Vault with Initial Deposit

Vault Properties

Depositing Funds

Via Deposit Address

Send funds directly to the vault's deposit address:

Deposits are credited after blockchain confirmation (typically 1-2 seconds on Solana).

Programmatic Deposit

Checking Balances

Current Balance

Balance Types:

  • available: Funds available for immediate use

  • pending: Funds in transit or awaiting settlement

  • total: Sum of available + pending

Balance History

Balance Alerts

Set up alerts for low balances:

Authorization Policies

Control how funds can be spent from a vault.

Whitelist Policy

Only allow spending at approved merchants:

Multi-Party Approval

Require multiple approvers for large transactions:

Time-Based Restrictions

Limit spending to business hours:

Velocity Controls

Prevent rapid successive transactions:

Vault Metadata

Store custom data with vaults:

Freezing Vaults

Temporarily stop all transactions:

When frozen:

  • No outgoing transactions allowed

  • Deposits still accepted

  • Balance queries still work

  • Cards linked to vault are automatically frozen

Closing Vaults

Permanently close a vault:

Important: Closing a vault is irreversible. All linked cards will be cancelled.

Vault Permissions

Control who can access and manage vaults:

Permission Roles

Role
Permissions

Owner

Full control, including delete vault

Admin

Manage settings, add members, create cards

Manager

Create cards, approve transactions, view details

Viewer

View balance and transactions only

Transaction History

View all vault activity:

Export Transactions

Audit Logs

Track all vault modifications:

Vault Analytics

Spending Insights

Budget Tracking

Best Practices

1. Use Descriptive Names

2. Set Authorization Policies Early

Configure policies immediately after creation:

3. Monitor Balance Alerts

4. Regular Audits

Review vault activity regularly:

5. Separate Vaults by Purpose

Troubleshooting

Vault Frozen

Insufficient Balance

Next Steps

Last updated