Argus

2-node AXL swarm: 0G TEE infers DeFi rebalance, verifies, swaps on Uniswap. KeeperHub-run, ENS-named

Argus

Created At

Open Agents

Project Description

Argus — verifiable AI DeFi keeper.

DeFi keepers today are either centralized bots you have to trust, or naive on-chain automation that can't reason. Argus is neither. It's an autonomous agent that watches a vault, decides when to rebalance using an LLM running inside a TEE, and executes the swap on-chain — with cryptographic proof the AI wasn't tampered with.

A user funds a vault on Unichain Sepolia and walks away. KeeperHub triggers the workflow on a schedule, paying the agent in USDC via x402 on Base Sepolia. The trigger lands on a two-node Gensyn AXL swarm. Node A pulls the vault's current balances, asks 0G Compute (deepseek-chat-v3-0324, running inside Intel TDX TEE) whether to rebalance, and persists the raw model output to 0G Storage. Node B reads it back, re-hashes, re-verifies the TEE attestation via processResponse, signs an EIP-712 tag, and calls the vault — which routes through Uniswap's Universal Router for the swap.

The agent has its own identity: an ENS subname via Namestone (rebalancer.<parent>.eth) with text records pointing at its model, vault, and keeper. Every rebalance emits an on-chain RebalanceExecuted event with chatIdHash and outputHash as indexed topics — anyone can pull the bytes from 0G Storage, recompute the hash, and independently verify the AI signed exactly what ran in the TEE. No trusted intermediaries. No "trust me bro." Just receipts.

Five sponsors stitched into one trustless pipeline. End-to-end in under a minute.

How it's Made

Argus is a TypeScript monorepo with a Foundry vault contract and a Go-based KeeperHub CLI dependency. Five sponsor stacks wired together; here's the seam between each.

KeeperHub → Shim. The KeeperHub workflow posts to an Express shim (shim/) that exposes a KeeperHub-compatible HTTP surface. The shim translates the trigger into an AXL swarm message and tracks request lifecycle for the /status/:requestId polling pattern. x402 USDC payments settle on Base Sepolia.

Gensyn AXL swarm. Two AXL daemons form a Yggdrasil mesh — Node A (signal, port 9002) and Node B (execution, port 9003). Workers communicate over the AXL /send and /recv endpoints addressed by Yggdrasil pubkey. This was the trickiest seam: AXL regenerates pubkeys on each launch unless persisted, so the shim and workers grab pubkeys at startup from /topology and inject them via env.

0G Compute (TEE inference). Node A calls 0G Compute's broker SDK against the deepseek-chat-v3-0324 endpoint running inside Intel TDX. Each inference returns a chatId we later use to verify via processResponse. The raw model bytes (not just the parsed JSON) are persisted to 0G Storage via the flow contract's submit, so the verifier can re-hash exactly what the TEE produced. We hash output bytes with keccak256 and emit outputHash on-chain so verification is permissionless.

0G Storage. Used as swarm shared memory between Node A and Node B. Node A uploads the envelope (chatId + raw bytes + signature), Node B downloads by storage root. 0G testnet's flow contract submit reverts intermittently on Galileo, so we ship a STORAGE_FALLBACK_ON_FAIL flag that writes to a shared local path — same-host guarantee for demo, audit-logged so the bypass is visible. Same trick for ZEROG_DEV_BYPASS_VERIFY when the chatID signature endpoint times out.

Uniswap Universal Router on Unichain Sepolia. The vault contract holds user funds and exposes a single executeRebalance(EIP712Tag) entry point gated by the agent's signature. It encodes a Universal Router command sequence (V3_SWAP_EXACT_IN) and sweeps output back to the vault. RebalanceExecuted is emitted with chatIdHash, outputHash, requestId as indexed topics — that's the public verification anchor. Quoter not deployed at canonical address on Unichain Sepolia, so we run with amountOutMin=1 for testnet.

ENS via Namestone. The agent EOA owns a Namestone-issued subname under our parent .eth (Sepolia ENS registry). Text records (agent.model, agent.vault, agent.keeper) point at the deepseek model, vault address, and KeeperHub workflow ID — making the agent's full operational identity resolvable from a single ENS name.

Hacky bits worth calling out. (1) Single signer key reused across four chains (Ethereum Sepolia for ENS ownership, Base Sepolia for x402, Unichain Sepolia for swaps, 0G Galileo for storage) — keeps the demo deterministic. (2) AXL pubkey injection at startup because mesh keys regenerate per launch. (3) Three demo-mode bypass flags (STORAGE_FALLBACK_ON_FAIL, ZEROG_DEV_BYPASS_VERIFY, QUOTER_OPTIONAL) work around 0G testnet flake and missing Unichain Quoter — each logged when triggered so the caveat is auditable. (4) Originally ran shim + AXL nodes on Fly.io; trial expired mid-build, pivoted to fully local topology in one session — tx receipts are real on Unichain Sepolia regardless.

background image mobile

Join the mailing list

Get the latest news and updates