EUR-Agent-Treasury

a bank for AI agents · regulated euros earning yield · zero ALGO
x402 · algorand testnet agent … Pay demo →
Liquid EURQ
—EURQ
spendable balance on the agent wallet
Staked · Vault
—
held off-wallet · released only inside the payment
Accrued Yield
—
interest earned between calls

Last Settlement · Atomic Group

Awaiting first settlement — run a paid call to /api/data.
1Withdraw from vaultstaked → liquid
2Pay APIEURQ
3Fee-payerpooled gas · agent 0 ALGO
⟮ bound atomically · all-or-nothing ⟯
3 actions · one transaction · ~2.8s finality · agent paid 0 gas

Payment Lifecycle

  • Request protected API
    GET /api/data
  • 402 Payment Required
    priced in EURQ · facilitator fee-payer
  • Build atomic group (B5)
    withdraw + pay + fee-payer
  • Sign locally · retry
    PAYMENT-SIGNATURE (x402 v2)
  • Facilitator settles
    one group · ~2.8s
  • 200 · upstream payload
    paid-call count +1

Paid Calls · 0

  • No paid calls yet.

How an agent uses this bank

1 · OPEN
Account + vault
An agent keypair. Its vault — a LogicSig escrow that only ever releases funds back to the agent — has a deterministic address, so there's no extra key to store.
2 · STAKE
Park idle euro
Move EURQ into the vault. It sits staked — earning yield via Folks on mainnet — until the moment the agent needs to spend it.
3 · SPEND
Pay any x402 API
Wrap fetch with the client. On a 402 it withdraws from the vault and pays in one atomic group — the euro leaves the stake only to be spent, and the agent pays 0 gas.
import { createAgentClient } from './src/agent/client.js';
import { resolveVaultEscrow, escrowVault } from './src/algo/vault.js';

// 1. open — wallet + the agent's deterministic vault
const { lsig } = await resolveVaultEscrow(algod, { agentAddr, asaId });

// 3. spend — wrap fetch; payment is invisible to the agent's code
const bank = createAgentClient({
  agent: { addr: agentAddr, sk: agentSk },
  suggestedParams: await algod.getTransactionParams().do(),
  vault: escrowVault(lsig, { agentAddr, asaId }),   // funds come from the stake
});

const res = await bank.fetch('https://any-x402-api/endpoint');
//          402 -> [vault-withdraw, pay, fee-payer] atomic -> 200, agent paid 0 gas
const data = await res.json();
Stake once with scripts/vault-setup.ts; then every bank.fetch(url) pays itself. Full runnable example (open → stake → spend on this testnet, ~30 lines): examples/agent.ts.
connecting…