Skip to main content

Allocate Budget

Allocate budget from treasury to an agent.
cURL

Request Body

string
required
Agent UUID receiving the allocation
number
required
Amount to allocate in lamports (must be positive)
string
default:"treasury allocation"
Reason for allocation (1-256 characters)
string
Optional source agent UUID (if reallocating from another agent)

Response

string
required
Unique allocation identifier
string
required
Target agent UUID
string
Source agent UUID (if provided)
number
required
Allocated amount
string
required
Allocation reason
string
required
ISO 8601 timestamp

Rebalance Budget

Rebalance budget between two agents.
cURL

Request Body

string
required
Agent UUID to transfer budget from
string
required
Agent UUID to transfer budget to
number
required
Amount to transfer in lamports (must be positive)
string
default:"treasury rebalance"
Reason for rebalance (1-256 characters)

Response

string
required
Unique rebalance identifier
string
required
Source agent UUID
string
required
Target agent UUID
number
required
Transferred amount
string
required
Rebalance reason
string
required
ISO 8601 timestamp

Agent Budget Operations

Agent budgets are tracked and enforced automatically:

Get Agent Budget

See Agent Budget API for retrieving current budget and spending.

Budget Enforcement

Budgets are enforced at transaction execution:
  1. Check available budget before transaction
  2. Deduct from budget on successful transaction
  3. Reject if insufficient budget remaining
  4. Reset daily spending at midnight UTC

Treasury Workflows

Initial Setup

1

Create Agents

Create agents with initial budgets:
2

Allocate Additional Budget

Add more budget as needed:
3

Monitor Spending

Track budget usage:

Performance-Based Rebalancing

1

Review Agent Performance

Check transaction success rates and profitability via audit events:
2

Rebalance Budgets

Shift budget from underperforming to high-performing agents:
3

Update Capabilities

Adjust agent capabilities based on performance:

Budget Constraints

Transaction Execution

When an agent executes a transaction:
  1. Budget Check:
  2. Policy Evaluation:
    • Spending limits
    • Protocol restrictions
    • Risk thresholds
  3. Execution:
    • Transaction submitted
    • Budget updated on confirmation
  4. Daily Reset:
    • spentLamportsToday resets at midnight UTC
    • Total budgetLamports persists

Audit Trail

All treasury operations are logged to audit events:
Events include:
  • treasury.allocate
  • treasury.rebalance
  • agent.budget.updated
  • agent.budget.exceeded
  • agent.budget.reset

Best Practices

Set conservative initial budgets and increase based on performance
Monitor daily spending to detect anomalies early
Use descriptive reasons for all allocations and rebalances
Implement budget alerts when spending exceeds thresholds
Review budget usage regularly via audit events
Coordinate with policy limits - budgets and policies work together

Example: Multi-Agent Treasury


Transaction Types

Treasury operations can be executed via:
  1. Direct API calls (shown above)
  2. Agent execution with treasury_allocate or treasury_rebalance transaction types
  3. CLI commands: