Last weekend I built something I've been thinking about for months. I entered the Stellar Hacks: Agents hackathon with less than 48 hours on the clock and came out the other side with Calypso — a system where an autonomous agent pays USDC micropayments to spin up a swarm of trading bots across every major Stellar DEX, then watches an AI retune the swarm in real time.
I want to walk through what I built, why I built it this way, and where it goes from here — because Calypso is not a standalone hackathon project. It is the technical foundation for the next phase of Hoops Finance.
The problem I kept hitting
If you've ever tried to test a DeFi strategy on Stellar testnet, you know the frustration. The pools are empty. There's no volume. No arb pressure, no fee accumulation, no realistic slippage. You can deploy contracts all day but you have no way of knowing whether they'll survive real market conditions until you ship to mainnet and hope for the best.
I've been running into this wall for the entire life of Hoops. Every time I deploy a new router adapter or test a yield strategy, I'm trading against dead orderbooks. The data I get back tells me nothing useful. And I maintain testnet deployments of Soroswap, Aquarius, Phoenix, and Comet myself — so I know exactly how empty those pools are.
The Stellar docs actually recommend building testing infrastructure that repopulates testnet with useful data after resets. Nobody has productized that. Gauntlet does it for Aave and Compound on EVM, and they've turned it into a massive business. Nothing equivalent exists on Stellar.
So I built it. But I didn't start from zero conceptually. This problem has a history on Stellar.
Kelp, Rockfish, and the gap they left behind
Stellar has had trading bots before. Kelp was the original — built by SDF themselves, open source, written in Go. It was a proper market-making bot for the SDEX with configurable strategies: buysell, balanced, mirror, TWAP. You could spin it up against the Stellar orderbook and it would place offers, maintain spreads, and keep pools liquid. SDF published it in 2019 because they understood the core problem: without market makers willing to quote both sides, the DEX was just empty books.
Rockfish came from the community — an arbitrage bot that used Stellar's native path payments to detect and capture cross-asset spread on the SDEX. It was named after the fish that live in kelp forests because it was built on Kelp's components. Rockfish would scan the orderbook, find circular arbitrage paths, and submit a path payment that either profited or bounced. One transaction per ledger maximum. Clean and conscientious.
Both are deprecated now. Kelp lives under stellar-deprecated/kelp on GitHub. Rockfish hasn't been updated since 2019. And the reason isn't that they failed — they worked fine for what they were. The reason is that Stellar moved on. The SDEX is still there, but the DeFi action shifted to Soroban AMMs: Soroswap, Phoenix, Aquarius, Comet. These are smart contract-based liquidity pools, not orderbook offers. Kelp and Rockfish were built for a different architecture.
What's missing now is the next generation of that same idea. Not just a single bot with a static config file — but a coordinated swarm with multiple archetypes that generates realistic market dynamics across multiple AMMs simultaneously. Not manual configuration in a YAML file — but AI-assisted planning and live parameter tuning. Not a tool you run on your laptop and hope it works — but a paid API that any agent can discover, call, and use.
That's the gap Calypso fills. It's the spiritual successor to Kelp and Rockfish, rebuilt for the Soroban era, with an AI layer on top and x402 as the access rail.
What Calypso actually does
Calypso is three x402-gated API endpoints. You pay USDC on Stellar to call them. That's the product.
POST /plan costs a penny. You send a natural language prompt — "stress test USDC/XLM with aggressive arb bots for 5 minutes" — and Gemini Flash returns a structured session config with bot recipes, target pools, and timing parameters.
POST /simulate costs five cents. It takes that config, spawns a swarm of bot wallets, funds each one, and starts them trading real transactions through the Hoops router across multiple DEXes simultaneously.
POST /analyze costs a penny. It reads on-chain protocol state and returns a structured health assessment — pool reserves, fee tiers, liquidity depth, risk profile.
Every payment is a real USDC transfer on Stellar. Every transaction hash is verifiable on stellar.expert. This is not mocked.
The part I'm most proud of
The early version had the user's browser wallet signing every x402 payment. Freighter popup on every API call. I realized that was architecturally wrong. If the UI opens a wallet popup every time the agent needs to think, you've built a paywall, not an agentic payment rail.
So I rebuilt the architecture around a long-lived Calypso Agent — a server-side Node service class that owns its own Stellar keypair. The user funds the agent once via Freighter. From that point on, the agent operates autonomously. It pays for its own plans. It pays for its own simulations. It spawns bot wallets, funds them from its own balance, runs the swarm, recovers residual funds when the session ends. The user doesn't sign anything after the initial deposit.
The agent calls the Calypso API over localhost HTTP using @x402/fetch with real on-chain x402 handshakes. Not an internal function call with the payment mocked out. The in-process facilitator verifies every payment and submits a real USDC transfer. A third-party agent running on a separate machine would see identical behavior. You could split these two services onto different continents and nothing in the code changes.
That separation — agent as executor, API as brain-for-hire — is the architectural decision that makes everything else possible.
The bots are dumb on purpose
There are three bot archetypes in the swarm: an arbitrageur that detects cross-DEX spread and executes when profitable, a noise trader that generates random volume on a timer, and an LP manager that deposits liquidity and rebalances when pool ratios drift.
None of them use AI. They run simple observe-decide-execute-log loops with rule-based logic driven by a JSON config. The arbitrageur checks if spread exceeds a threshold. The noise trader picks a random amount and direction. The LP manager watches a ratio and rebalances when it drifts.
The intelligence lives in the AI reviewer — a Gemini Flash endpoint that fires every five minutes, reads an aggregated summary of what all the bots did, and outputs parameter adjustments. "Arb bot is losing on slippage, widen the spread threshold." "Volume is clustering in Soroswap, shift a noise bot to Aquarius." "LP position is drifting unprofitably, tighten the rebalance ratio." The bots pick up the new config on their next tick.
This costs about twelve Gemini calls per hour. A few dollars a day. The bots themselves cost nothing to run — they're just signing Stellar transactions with near-zero fees.
I made this decision early and it's the right one. AI in the hot path would mean hundreds of LLM calls per minute, enormous context windows, and costs that make the product unviable. Rule-based bots with AI-tuned parameters produce the same emergent market behavior at a fraction of the cost.
What this has to do with Hoops
Calypso is a separate project with its own repo and its own identity. But it was built entirely on top of Hoops infrastructure, and it points directly at where Hoops is going.
Every bot in the swarm trades through the Hoops router. The router aggregates quotes across Soroswap, Aquarius, Phoenix, and Comet and routes through the best price. The Calypso bots are the first real load test of that router under sustained multi-DEX volume. That alone was worth building — I found edge cases in the adapter quoting logic that I never would have caught with manual testing.
Every bot gets a Hoops smart account — a Soroban contract that wraps swap execution, LP deposits, and token transfers behind a single signing authority. This pattern — ephemeral smart accounts controlled by an autonomous agent — is exactly the architecture I need for the next phase of Hoops.
Here's where it connects:
Agent smart accounts. The Calypso Agent is a server-side keypair today. In production, it becomes a deployed Soroban smart account with custom auth policies — spend caps, endpoint allowlists, time-locked withdrawals. A user deploys their own agent account, funds it, sets policies, and the agent operates within those constraints. This is the OpenZeppelin smart account pattern applied to DeFi strategy execution. Calypso proves the wallet hierarchy works: user account controls agent account, agent account controls bot accounts.
Automated market making. The bot chassis, the multi-DEX routing, the AI parameter tuning loop — this is the skeleton of an automated market maker. Replace "simulate testnet conditions" with "optimize yield on mainnet" and the architecture transfers directly. The agent funds itself, the bots execute, the AI tunes, the user withdraws profits.
The chat interface. Our SCF tranche 3 deliverables include an AI-powered chat that helps users build and deploy yield strategies. The Gemini orchestrator in Calypso — structured input from aggregated market data, structured output as strategy parameters — is the same pipeline. The chat is a natural language layer on top of the same endpoint. A user asking "what yield strategy works best for USDC/XLM right now?" gets an answer grounded in real simulated market data, not a hallucination.
None of this is theoretical. The code exists. The router works. The smart accounts deploy. The AI loop runs. Calypso is the proof that these pieces compose into something coherent.
What I learned building it in 48 hours
A few honest notes.
The x402 integration was harder than expected. The hosted facilitator at x402.org has a maximum transaction fee ceiling that rejects Soroban contract calls where resource fees exceed it on testnet. I ended up running the facilitator in-process following the stellar/x402-stellar self-hosted pattern with a higher fee ceiling. This is documented in the repo and it's something the Stellar x402 tooling team should know about — it'll bite anyone trying to gate Soroban-heavy endpoints.
Gemini Flash with responseMimeType: "application/json" is remarkably reliable for structured output. The planner and reviewer both return clean JSON that passes zod validation on the first try almost every time. I was prepared to build retry logic and parsing fallbacks. Barely needed them.
The crash recovery system was not in my original plan. I added it at hour 30 when I realized that if the server dies mid-session, bot wallets with funded balances become stranded. Every bot keypair is now persisted to disk the moment it's created. On startup, the server scans for leftover keystores, rebuilds the wallets, drains residuals back to the agent, and cleans up. Four exit paths — manual stop, timer expiry, circuit breaker, and crash — all recover funds.
Building on your own infrastructure is a cheat code. I already had the router, the DEX deployments, the smart account SDK, the RPC node. Calypso is a thin orchestration layer on top of a year of work. That's the honest framing and it's also the strongest pitch: this isn't a hackathon toy, it's a new surface on top of production infrastructure.
Where it goes
Calypso is open source under MIT. The repo is at github.com/Hoops-Finance/calypso-x402.
For Hoops, the roadmap is clear:
The agent wallet system becomes the foundation for per-user agent smart accounts with policy-based authorization. The bot chassis and AI tuning loop become the execution layer for automated yield strategies on mainnet. The x402 payment integration becomes the monetization layer for Hoops Pro — paid analysis, paid simulation, paid strategy recommendations. The /plan endpoint evolves into the conversational strategy builder we promised in our SCF application.
For the broader Stellar ecosystem, Calypso picks up where Kelp and Rockfish left off. Those tools proved that automated market participation makes the network better for everyone. Calypso brings that idea forward into the Soroban era — multi-DEX, AI-tuned, agent-native, and paid per call. Not a static bot with a config file. A service where agents pay to think.
If you're building on Stellar and want realistic testnet conditions for your protocol, fork the repo and run it. If you're building agents and want to see how x402 payment flows work end-to-end with a real facilitator, read the code. If you want to extend the bot archetypes or plug in a different router, the chassis is designed for it.
I'll be integrating the core components back into Hoops over the coming weeks. More updates soon.
— Bastian
Calypso was built for Stellar Hacks: Agents (x402 + Stripe MPP) on DoraHacks, April 2026.
Hoops Finance is supported by an active Stellar Community Fund grant.
