sovereign-swarm-os

Three agent autonomous trading swarm with verifiable on-chain identity, memory, and reasoning.

sovereign-swarm-os

Created At

Open Agents

Project Description

Sovereign Swarm OS is a three-agent autonomous trading system where every decision is publicly verifiable on-chain. Each agent owns an ENS subname on Sepolia, persists its full reasoning trail as a content-addressed blob on 0G Storage, and anchors the root hash to its ENS text records after every run. A fourth layer runs the actual LLM risk check on 0G Compute using Qwen-2.5-7b before any funds move.

The pipeline works as follows: the Researcher reads live USDC/WETH Uniswap V3 pool data on
Base Sepolia and proposes a trade. The Risk Manager submits that proposal to an on-chain LLM
and returns an approval or veto with a numeric score and reasoning string. If approved, the
Executor builds a real Uniswap V3 quote and submits the swap through KeeperHub. Every agent
writes its memory root to its own ENS subname so anyone can trace any trade back to the exact
words the model used to approve it. The entire codebase is open source and each package is
independently reusable as infrastructure for other agentic projects.

How it's Made

The stack is TypeScript throughout, structured as a pnpm monorepo with one package per infrastructure concern.

ENS integration uses viem to mint three subnames under an operator-owned parent on Sepolia via the ENS Registry and Public Resolver. After each agent phase, the orchestrator calls setText on that agent's subname with the key 0g_memory_root. ENSIP-19 reverse names are set
so wallets resolve each agent wallet address back to a human-readable subname.

0G Storage is accessed via @0gfoundation/0g-ts-sdk. Each agent serialises its reasoning blob,
uploads it to the Galileo testnet, and gets back a Merkle root hash. That hash is what goes
into ENS. Any third party can retrieve and verify the blob independently using the same SDK.

0G Compute uses @0glabs/0g-serving-broker to call Qwen-2.5-7b-instruct on the decentralised inference network. The broker handles payment channel negotiation and request signing. The model response is treated as the canonical risk decision and uploaded to 0G Storage before the executor is allowed to proceed.

KeeperHub is integrated via the kh CLI and @keeperhub/wallet. Every outbound HTTP call from
the executor goes through paymentSigner for x402/MPP payment-rail awareness. The Uniswap V3 swap is built using the Trading API for a Smart Order Router quote with a local exactInputSingle fallback, then submitted through KeeperHub on Base Sepolia.

The frontend is Next.js 15 App Router with wagmi and RainbowKit for wallet connection. API
routes are Node.js Route Handlers that spawn the orchestrator as a detached child process and
pipe stdout to a log file the dashboard polls live.

background image mobile

Join the mailing list

Get the latest news and updates

sovereign-swarm-os | ETHGlobal