AWS Builder Center

SperaxOS: AI Agents That Earn, Spend and Settle in a Yield-Bearing Dollar With USDs via x402

How an open-source DeFi agent workspace, a dollar that pays its holders, and the HTTP 402 payment standard combine so software can buy and sell services on its own, and how every dollar of that commerce feeds an on-chain buyback and burn of SPA.

Series: Sperax | SperaxOS (1 article)

  1. 1
    SperaxOS: AI Agents That Earn, Spend and Settle in a Yield-Bearing Dollar With USDs via x402 This article
Your edge, automated. Smart agents for fast, low-noise trading across chains
AI agents can already read, reason, plan and call tools. What they still can't do well is pay. Most of the web's useful data and services sit behind accounts, API keys, monthly plans and invoices, and all of those were built for humans with credit cards. An agent that wants one price quote from one API has no good way to buy it.
Sperax is working on that gap from three directions: SperaxOS, an open-source workspace where people run DeFi agents; USDs, a dollar on Arbitrum that earns yield just by sitting in a wallet; and x402, an open standard that lets any HTTP request carry its own payment. Put them together and you get agents that hold money which grows, spend it in small amounts under hard limits, and sell their own work to other agents. Every fee and every bit of yield that flows through the system also feeds a buyback and burn of SPA, the protocol's governance token.
This article covers how each piece works, how they fit together, and what is live today.

The idea

The thesis is simple: if agents are going to do economic work, they need native money and a native way to pay.
Native money means a balance an agent can hold without babysitting. It shouldn't need staking, claiming or moving between products to stay productive. Idle money that loses value is a tax on every agent that keeps a float.
A native way to pay means no signup flow. An agent asks for a resource, learns the price, pays and gets the result, all inside the HTTP request cycle. No account, no key to rotate and no invoice to reconcile.
USDs is the money and x402 is the payment rail. SperaxOS is where people build, run and supervise the agents that use them.

What SperaxOS has built

SperaxOS is an open-source AI agent workspace focused on DeFi and Web3. It began as a fork of the lobe-chat project and has since grown into its own platform, built on Next.js, React, tRPC and PostgreSQL.
A large tool surface. SperaxOS ships more than 100 builtin tool packages: market data, on-chain analytics, wallet and portfolio reads, DEX quotes, lending and yield data, security checks and more. It also connects to external tools through the Model Context Protocol (MCP).
A Smart Tool Router. Giving a model 100+ tools on every turn wastes tokens and confuses it. Before each turn, a lightweight classifier picks the handful of tools that matter for the request. If the classifier fails, the agent falls back to its own defaults rather than stalling.
A deterministic guard chain. Any tool call that can move money passes through a series of independent checks before it executes:
  • DeFiGuard covers portfolio risk, dollar caps and MEV exposure.
  • RiskAnalyzer scores the transaction.
  • MEVProtection routes around sandwich and front-running risk.
  • SpendGuard enforces the agent's spending envelope.
  • CapabilityGuard and PermissionGuard check capability tokens and the agent's permission level.
These are code, not prompts. A model can't talk its way past them, and they fail closed: if a check can't reach a decision, the call doesn't go through.
A strategy engine and autonomous tasks. Multi-step plans can be expressed as a DAG of steps and executed with the same guards in the loop. Agents can also run scheduled tasks on their own.
Bring your own model. SperaxOS works with a long list of model providers, including Amazon Bedrock.

USDs: a bank account on-chain

USDs is a dollar stablecoin on Arbitrum, live since 2021. Its defining feature is that it behaves like a bank account. Hold it in an ordinary wallet and the balance goes up on its own, roughly once a day. There's no staking contract, no claim button and no wrapper token.
How it's backed. USDs is minted against established dollar stablecoins: USDC, USDC.e and USDT. That collateral is put to work in lending and liquidity venues (Aave, Compound, Fluid, Stargate and Curve), each with a governance-set cap on how much can go to any one venue.
Where the yield comes from. Those venues pay interest and reward tokens. A contract called the YieldReserve sells the reward tokens at oracle price and mints USDs with the proceeds. That USDs is split:
  • 70% goes to the Dripper, which releases it to holders through a rebase.
  • 30% goes to the SPA buyback (more on this below).
How a rebase works. USDs doesn't track your balance as a fixed number. It tracks "credits", and your balance is your credits divided by a global creditsPerToken value. When yield arrives, the protocol lowers creditsPerToken, and every opted-in holder's balance rises at once without a single transfer. Rebases run at most once every 24 hours, inside a floor and cap set by governance.
Keeping the peg. Minting is capped at $1, so you never get more than a dollar of USDs for a dollar of collateral. Redemptions return collateral 1:1 minus a fee. If any collateral drifts more than 3% below its own peg, minting against it stops. If the system ever has a shortfall above 10%, the SPA treasury acts as a backstop.
Audits. The contracts have been audited by Quantstamp, SlowMist, Certik and PeckShield, and a public bug bounty has been running since March 2024.
For an agent, this is the right shape of money. Its working float earns while it waits, and nobody has to remember to harvest anything.

x402: how agents pay

x402 is an open payment standard built on HTTP's long-reserved 402 Payment Required status code. The flow takes two round trips:
  1. The client requests a resource.
  2. The server replies 402 with a price, the accepted tokens and networks, and where to pay.
  3. The client signs a payment authorization and repeats the request with it attached.
  4. The server verifies the payment, serves the response and settles on-chain.
There is no account, API key or invoice. The payment is the credential.
SperaxOS as a seller. SperaxOS sells 348 data and analysis operations over x402, priced at $0.001, $0.005 or $0.02 per call. Its 402 responses list USDs on Arbitrum first, then USDC on Arbitrum, then USDC on Base, so buyers who hold yield-bearing dollars can pay with them and everyone else still has a familiar option.
Agents as sellers. Agents built in SperaxOS can list their own capabilities as paid x402 endpoints. The builder sets the price and the payout address, and other agents can then hire that agent directly.
Agents as buyers. SperaxOS agents can also pay any x402-enabled API on the open web, not just Sperax's own.
When the charge happens. Order matters when money is involved:
  • For data calls, the payment is verified, the handler runs, and the payment settles only if the handler succeeded. An empty response or an upstream error returns a 502 and the buyer is never charged.
  • For agent runs, which are expensive and can't be undone, the payment settles before the run starts.
Target URLs are pinned against server-side request forgery (SSRF), so a paid request can't be pointed at internal infrastructure.

The hard part: making USDs payable

Most x402 payments use a token feature called EIP-3009, which lets a holder sign a one-off transfer authorization that someone else submits. USDs doesn't implement EIP-3009. It does have an EIP-2612 permit() function, but that function consumes the signer's nonce without ever setting an allowance, so it can't be used either.
The fix was the x402 v2 exact scheme with Permit2, Uniswap's widely deployed approval contract. The buyer approves Permit2 once, and every payment after that is a signed Permit2 transfer that works with any ERC-20, including rebasing ones. In the payment requirements this shows up as assetTransferMethod: "permit2".
Two details make it practical:
  • Gas-free first approval. The one-time Permit2 approval is sponsored through the erc20ApprovalGasSponsoring extension, so a buyer never needs ETH just to start paying.
  • Exact decimals. USDs has 18 decimals and USDC has 6. Prices are converted with exact string arithmetic rather than floating point, so a $0.001 call costs exactly $0.001 in both.
There is also a proposal upstream in the x402 project to make USDs a default Permit2 asset in the official TypeScript, Go and Python SDKs. It is still under review.

The facilitator

In x402, a facilitator is the service that checks a signed payment and submits it on-chain, so sellers don't have to run that logic themselves. Sperax runs one at x402.sperax.io. It implements the standard v2 API:
  • /supported lists schemes and networks.
  • /assets lists accepted tokens.
  • /verify checks a payment without moving funds.
  • /settle submits it on-chain.
It settles on Arbitrum One and Base. The code is open source, so any x402 seller can use it or run their own copy.
The first mainnet USDs payment through it settled on September 18, 2026: 0.001 USDs for a single API call. It's a small number, and that's the point. Payments that size are uneconomical on card rails and routine on this one.

Agent wallets: budgets that earn

Agents that pay need money, and people who run agents need control. In SperaxOS each user has an agent wallet, called the Bank:
  • Envelopes per agent. You fund each agent separately, and its envelope stays in USDs, so it keeps earning while it waits to be spent.
  • Layered spend limits. You set caps per payment, per hour, per day and per seller. The tightest one wins, and every check runs before anything is signed.
  • A statement. The Bank shows what each agent earned in yield next to what it spent, plus a self-funding ratio. The underlying arithmetic is plain: an agent covers its own costs when its balance × realised APR ÷ 365 ≥ its daily spend.
The wallet is custodial today, with keys stored encrypted. A note for builders using smart-contract wallets: contract accounts don't receive rebases by default and must call rebaseOptIn() once.

SPA buybacks and burn

SPA is the governance token of the Sperax protocol. Its link to USDs isn't a promise about price. It's a mechanism you can read on-chain.
The buyback contract. The SPABuyback contract on Arbitrum One (0xFbc0d3cA777722d234FE01dba94DeDeDb277AFe3) receives USDs and exchanges it for SPA at oracle price. It then:
  • burns 99.99% of the SPA it acquires, and
  • sends 0.01% to veSPA stakers.
What funds it.
  • 30% of all yield the protocol earns from collateral.
  • 100% of mint and redeem fees.
This split comes from governance. In 2024, SIP-66 moved the yield split from 50/50 to 70/30 in favour of holders and changed the buyback from a distribution into a burn.
Who decides. SPA holders can lock their tokens as veSPA for anywhere from one week to four years. veSPA votes on Snapshot over the protocol's main settings: which collaterals are accepted, which venues are used and their caps, fees, the drip rate, the rebase floor and cap, and the yield split itself.
Why this matters for agentic commerce. The loop is mechanical. More agents holding USDs as working capital means more collateral earning yield. More USDs minted and redeemed means more fees. Both feed the buyback, and the buyback burns SPA. Usage of the payment rail turns directly into SPA leaving circulation. There's no marketing in that chain, just contracts.

Trust, by design

Agents spending money is exactly where things go wrong if trust is an afterthought. The design rests on a few principles:
  • Guards are code, not instructions. The guard chain is deterministic and fails closed. No prompt injection can raise a spending cap.
  • Limits run before signatures. Spend limits are checked before a payment is signed, not reconciled afterwards.
  • Charge only for delivered work. Data calls settle only after the handler succeeds, and failed or empty responses cost nothing.
  • Open code on the money path. The x402 facilitator is open source, and the USDs contracts are public and audited.
  • Conservative peg rules. Mint caps, per-collateral circuit breakers and a treasury backstop limit how far a bad day can spread.

Why AWS

SperaxOS supports Amazon Bedrock as a model provider. Builders already working on AWS can plug Bedrock-hosted models into SperaxOS with their own AWS credentials and get the full stack on top: the tool router, the guard chain, the Bank and the x402 commerce layer.
That matters for the teams most likely to run agents that move money. They tend to have regions, accounts and governance settled on AWS already, so they can choose models there without giving up the DeFi tooling.

What's live, and what's next

Live today:
  • SperaxOS with 100+ builtin tools, the Smart Tool Router and the guard chain.
  • USDs on Arbitrum, earning and rebasing.
  • The x402 facilitator at x402.sperax.io, settling on Arbitrum One and Base, with USDs paid via Permit2.
  • 348 paid operations, agent-listed paid endpoints, and outbound payments to any x402 API.
  • The Bank, with per-agent envelopes, layered limits and the self-funding statement.
  • The SPA buyback and burn, fed by yield and fees.
In progress:
  • ERC-4337 smart-account wallets for agents, as a non-custodial alternative to today's Bank.
  • Making USDs a default Permit2 asset in the upstream x402 SDKs.
  • Proposed designs for tighter links between SPA and the platform, such as using veSPA to unlock agent capabilities. These are proposals, not shipped features.
Volume is early. This is a starting line, not a victory lap. The rails are live, open and verifiable, and now they need traffic.

In short

SperaxOS gives agents tools and guardrails. USDs gives them money that earns while it waits. x402 lets them pay and get paid per request, with no accounts or keys. The SPA buyback turns that activity into a burn anyone can verify on-chain.
Agents that earn, spend within limits, and settle in a dollar that pays its holders. That's the stack.

Learn more

Series: Sperax | SperaxOS (1 article)

  1. 1
    SperaxOS: AI Agents That Earn, Spend and Settle in a Yield-Bearing Dollar With USDs via x402 This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article