Skip to main content
All use cases
TreasuryFintechs

One wallet, two slots, kept liquid by policy.

The agent watches the BRL and USDC slots, keeps the operating float above its floor, and moves idle balance between them under one mandate the owner signed. No FX desk, no 2am scramble when a slot runs low.

BeforeManual sweeps, idle cash, FX desk
AfterSlots kept liquid under one mandate
1 wallet
BRL + USDC slots, no FX desk
Try it in the Sandbox
1 wallet
BRL + USDC
Two slots, no FX desk
Floor
Kept liquid
Each slot stays above its policy floor
In production
Multi-slot live
BRL + USDC wallet runs today
Sealed
Every move
Hash-chained to the mandate
What the agent does

Idle balance, rebalanced under the mandate.

The agent sees the BRL slot dip under its floor, moves idle balance from the USDC slot to refill it, and seals the move to the mandate. It never crosses a cap the owner did not set.

  • Watches each slot against a floor you set
  • Rebalances BRL and USDC under one signed mandate
  • No FX desk in the loop, no manual sweep
  • Every move sealed to the mandate that allowed it
Treasury Agent
Wallet · mandate
Agent
BRL slot under floor. Rebalancing from USDC.
via codespar_pay · Wallet
Moved to BRL. Float back above floor.
SlotBRL
FromUSDC slot
Mandatecm_tr
Receiptrcpt_TA
Floor holds. Payouts keep flowing.
rebalanced · sealed · under mandatercpt_TA01
The pain

The conversation is the easy part.

A payout float either sits idle or runs dry. Someone watches balances by hand and calls an FX desk to move money between currencies.

Watch balances and top up by hand

The agent keeps each slot above its floor automatically

Idle cash sits in the wrong slot

Idle balance rebalances between BRL and USDC on policy

Call an FX desk to move between currencies

The wallet holds both slots, no desk in the loop

Trust that a move stayed inside policy

Every rebalance is checked against the mandate

How the agent does it

Treasury on autopilot, inside a mandate.

The agent runs the multi-slot wallet under one mandate the owner signed. BRL and USDC are slots of the same wallet, with Pix at the center. Each move is sealed so the whole float reconstructs end to end.

01
Watch
Wallet

Balances across slots

02
Floor
Policy

Slot dips below its floor

03
Verify
codespar_pay

Mandate cap, scope, expiry

Mandate
04
Rebalance
Wallet

Move between BRL and USDC

05
Seal
Audit ledger

Receipt to the mandate

Architecture

The agent reads balances across the wallet slots, and when one dips below its policy floor codespar_pay verifies the mandate before moving idle balance between BRL and USDC. Each rebalance is hash-sealed to the mandate so the float reconstructs end to end.

In code

A few lines. The whole loop.

treasury-agent.ts
const session = await codespar.sessions.create();

// keep the BRL slot above its floor, funded from the USDC slot
const res = await session.execute("codespar_pay", {
  action: "rebalance",
  slot: "BRL",
  floor: 5000, // policy floor from the signed mandate
});

await session.verificationStatus(res.toolCallId);
1 wallet · sealedreceipt · rcp_treasu
Featured tools
codespar_pay

Moves idle balance between wallet slots, inside the mandate.

Wallet (BRL + USDC)

Holds both slots of the multi-rail wallet; Pix is the center.

Audit ledger

Hash-seals every rebalance to the mandate that allowed it.

See the meta-tool reference

Ship it this afternoon.

Open the sandbox, point a session at your providers, and run the whole loop against real rails in minutes — not the quarter it takes to build it by hand.

Treasury agent — CodeSpar | CodeSpar