AgentBadge
FX Delta Agent
A paid x402 API for AI agents. It compares live stablecoin prices on Celo with official FX rates and returns a clear signal per corridor: buy, sell, or watch. Every call is a real USDC payment on Celo mainnet.
Architecture
One paid call, end to end. The settle leg is a real transaction on Celo mainnet (42220).
Celo mainnet (42220) — the settle leg is a real tagged transaction: 0x7f2927…55b6b2 ↗
⚡ AgentBadge components in this flow ▾
Everything inside the dashed border runs on the AgentBadge deployment at agentbadge.xyz:
- /api/fx-delta — HTTP API: health, corridors, snapshot, premium, stream, per-corridor, verify
- Verify + Settle — premium gate: checks the EIP-3009 payment permit, claims the nonce, submits the onchain settle and pays gas as the seller
- Delta Engine — polls Celo pools (Mento FPMM + Uniswap) and official FX references every few seconds, computes deltas and signals
- MCP /mcp/fxdelta — five MCP tools: get_delta, list_corridors, get_quote, get_events, get_digest
- USDC Contract and Telegram are external Celo/third-party components
📋 Step-by-step payment + data flow ▾
- Request — the agent calls
GET /api/fx-delta/premiumand gets HTTP 402 withaccepts(USDC and USDT on eip155:42220, amount, payTo) - Pay — the agent signs an EIP-3009
transferWithAuthorizationpermit (no gas spent by the buyer) and retries with thePAYMENT-SIGNATUREheader - Settle — the premium gate verifies the signature, claims the nonce, and the seller submits the tx to the USDC contract with an ERC-8021 attribution tag (
celo_24acc530146f) in calldata - Receipt — the server waits for the onchain receipt; the payment is auditable on Blockscout
- Response — only after settlement the API returns 200 with deltas and buy/sell/watch signals per corridor
- Engine — meanwhile the delta engine continuously reads pool reserves and official FX rates; a delta ≥ threshold pushes a Telegram alert
❓ FAQ — questions & answers ▾
What does an agent actually buy?
A snapshot of the onchain premium: for every corridor (USDm, EURm, BRLm, wARS, cNGN, IDRX…) the API reports the gap between the live Celo pool price and the official FX reference, plus a signal — buy, sell, or watch. Deltas ≥ 0.5% are executable signals; thin, stale, frozen, or weekend-closed markets are flagged.
How much does a call cost and who pays gas?
0.005 USDC per premium call on Celo mainnet (eip155:42220), payable in USDC or USDT. The buyer only signs an EIP-3009 permit — it spends no gas. The seller pays the CELO gas when it submits the settle transaction.
Where is the proof it works on mainnet?
Every settle transaction lands on Celo mainnet and carries the ERC-8021 tag in its calldata. See the verified settle tx 0x7f2927…55b6b2 — buyer 0x4a2f…6bb0 → seller 0x0F71…186e, 0.005 USDC, block 80576414.
Is there a free way to evaluate it?
Yes. Health, corridors and snapshot endpoints are free, and every identity (X-Wallet header or IP) gets one premium-grade call per minute on the free tier before 402 kicks in.
How do agents consume it besides HTTP?
Via MCP: the /mcp/fxdelta namespace exposes get_delta, list_corridors, get_quote, get_events and get_digest, with the same freemium + x402 payment model and SSE streaming.
What is verified onchain vs offchain?
Payments are settled and auditable on Celo mainnet. Delta verdicts can additionally be anchored to an Arc event log (hash of the canonical verdict); anchoring is disabled on production and the verify endpoint returns 404 until a record exists.
Why does the seller hold CELO?
Self-settle means our seller wallet submits transferWithAuthorization itself — that is what makes every payment a tagged tx attributable to us on the ERC-8021 leaderboard. CELO covers gas (~0.02 CELO per settle).
How it works
Request
The agent calls the premium endpoint and gets HTTP 402 with the price, assets (USDC/USDT), and payTo on Celo mainnet.
Sign
The agent signs a USDC payment permit (EIP-3009). The buyer spends no gas.
Settle
The seller submits transferWithAuthorization on Celo mainnet with an ERC-8021 attribution tag in calldata.
Receive
After the receipt confirms, the API returns per-corridor deltas and buy / sell / watch signals. Large gaps push Telegram alerts.
Try it live
The premium endpoint answers with payment requirements on Celo mainnet. Health shows the running engine — both calls are free.
curl -i https://agentbadge.xyz/api/fx-delta/premium
# → 402 Payment Required · eip155:42220 · USDC/USDT · 5000 units · payTo 0x0F711f82…
A paid call needs an EIP-3009 signature — see the README-HACKATHON.md for the full reproduction script.
Mainnet proof
One verified payment, end to end. Click through to Blockscout.
| Settle transaction | 0x7f292710b92b…55b6b2 ↗ |
| Network | Celo mainnet · eip155:42220 |
| Asset | USDC 0xcebA9300…32118C ↗ |
| Buyer (buymain) | 0x4a2f11B5…4E6Bb0 ↗ |
| Seller / payTo / gas payer | 0x0F711f82…58186e ↗ |
| Amount | 0.005 USDC · block 80576414 · status success |
| ERC-8021 tag | celo_24acc530146f — inside tx calldata |
| Buyer balance | 4.840 → 4.835 USDC · 0 CELO spent |
| Seller balance | 0 → 0.005 USDC · gas ~0.021 CELO |
Earlier testnet dry-runs of the same rail exist — the submission proof is the mainnet tx above.
API surface
Every public endpoint and the MCP namespace.
| Method | Path | Access | Description |
|---|---|---|---|
| GET | /api/fx-delta/health | free | Engine status, corridor count, data sources |
| GET | /api/fx-delta/corridors | free | List of currency corridors |
| GET | /api/fx-delta/snapshot | free · 1/min | Latest deltas snapshot (free-tier rate limit) |
| GET | /api/fx-delta/premium | x402 · $0.005 | Full deltas + buy/sell/watch signals |
| GET | /api/fx-delta/stream | free | SSE live stream of deltas |
| GET | /api/fx-delta/:corridor | free | Deltas for one corridor |
| GET | /api/fx-delta/verify/:id | free | Verdict hash check (needs an anchored record; 404 until anchoring is enabled) |
| MCP | /mcp/fxdelta | freemium + x402 | get_delta · list_corridors · get_quote · get_events · get_digest |
Stack
One call = one verifiable mainnet payment
Plug in your agent, sign a permit, and verify the settle on Blockscout.
Support: support@agentbadge.xyz