The Process
How It Works
Deposit. Earn yield. Borrow to spend. Earn revenue. Deposit again. The treasury grows with every cycle.
Fund the Agent Treasury
On-chain (Base)
- Agent deposits USDC into its BorrowVault — supplied directly to Aave V3 as collateral.
- Optionally swap into WETH + cbBTC for diversified, yield-earning collateral.
- The treasury grows while the agent operates. No action needed.
Agent Proposes a Spend Plan
You approve
- The agent needs to pay for a service — compute, APIs, infrastructure, another agent.
- It submits a spend plan: how much USDC to borrow, and who to pay.
- You review the plan and approve it. The agent cannot move funds without your approval.
CRE Verifies the Plan
Chainlink DON
- After your approval, CRE's decentralized network independently verifies the plan.
- DON nodes check: allowlisted payee, amount within limits, correct nonce, safe health factor.
- All nodes must reach consensus. No single point of trust.
- DON signs the verified report and delivers it on-chain via the Keystone Forwarder.
Vault Executes Borrow + Pay
On-chain (Base)
- BorrowBotReceiver verifies the DON signature and decodes the verified plan.
- BorrowVault enforces 12 on-chain safety checks: allowlists, nonce, expiry, cooldown, limits.
- Health factor verified after borrow — the treasury stays safe.
- Aave V3 issues variable-rate USDC debt. USDC goes directly to the payee.
Service Provider Gets Paid
Confirmed on-chain
- USDC arrives at the payee wallet — verifiable on Basescan.
- Vault nonce increments, proving execution completed.
- Collateral stays in Aave earning yield — the agent never sold its assets.
Layered Security
Three Layers of Safety Checks
Every borrow passes through CRE validation, vault enforcement, and Aave protocol checks — no single point of trust.
- Vault not paused (on-chain read)
- Valid addresses for asset + payee
- Agent cannot escalate borrow amount
- Asset and payee must match request
- DON consensus on agent response
- Only executor (Receiver) can call
- Borrow token + payee allowlisted
- Nonce replay protection
- Plan not expired (< 5 min)
- Cooldown between executions (configurable)
- Per-tx cap ($100) + daily cap ($200)
- Health factor ≥ 1.6 post-borrow
- LTV + liquidation threshold enforced
- Collateral must support borrow
- Variable-rate debt tracked on-chain
Architecture
How the Pieces Connect
Key Contracts
Holds collateral, borrows, pays
CRE entry point on-chain
Lending + borrowing
Borrow + collateral token
Optional collateral assets
“What about liquidation?”
When you borrow against crypto, there’s always a risk: if the price drops too far, the protocol sells your collateral to cover the debt. Agent Treasury prevents this by keeping borrows small relative to what’s in the vault.
Safety Buffer
1.6x
The vault always holds 60% more collateral than it owes — enforced on every borrow
Max per Spend
$100
The agent can only borrow up to $100 at a time — no large, risky borrows
Max per Day
$200
Even with multiple spends, total borrowing is capped at $200 per day
All limits are set by the vault owner and enforced on-chain. Advanced liquidation protection is on the roadmap.
The Vision
Where This Is Going
The wealthy never sell — they borrow against what they own. Agent Treasury brings that same model to AI agents, creating a self-sustaining cycle that runs forever.
Today
- Deposit BTC, ETH, or USDC as collateral
- Earn yield on Aave V3 while holding
- Borrow USDC to pay allowlisted services
- CRE verifies every spend — 12 on-chain checks
Next
- Auto-spend below a threshold — no approval needed
- Owner approval only for large or unusual spends
- x402 payments: borrow USDC, pay per HTTP request
- Agents operate autonomously within guardrails
The Endgame
- Agent holds BTC + ETH — assets appreciate over time
- Borrows USDC to operate: compute, data, services
- Earns revenue → deposits back → treasury grows
- The cycle repeats forever. Self-sustaining agents.
Why x402? Today the agent pays an allowlisted address. With x402, any HTTP service can require payment via the standard 402 status code. The agent borrows USDC from its treasury and pays per-request — no accounts, no API keys, no invoices. Just money over HTTP, verified by Chainlink CRE.
See it in Action
Approve a spend plan, watch CRE verify it, and see the payment execute on Base mainnet.
Open Interactive Demo