Non custodial DeFi Trading with an Agenti AI swarm built for coffee
0x Golden Goose is an AI-style autonomous trading swarm built for ETHGlobal OpenAgents: three cooperating agents—PriceScout, RiskManager, and Executor—that watch markets, decide whether a trade is acceptable under risk rules, and (optionally) execute Uniswap v3 swaps on Sepolia, without a single monolithic “bot brain.”
PriceScout polls Uniswap v3 (mainnet quotes via QuoterV2) for WETH/USDC, maintains a rolling window of prices, and emits BUY / SELL / HOLD style signals when deviation crosses configurable thresholds.
RiskManager consumes those signals over an inter-agent bus, applies gates (confidence, circuit breaker, cooldown, adjusted size), and emits an approve/reject decision.
Executor runs in simulate mode by default, or live mode with a wallet key: it can pull funds from a SwarmFund vault contract (per-user vault, bot wallet, trade limits), swap on SwapRouter02, and settle back.
KeeperHub can drive the swarm on a schedule or price alerts via HTTP POST to a small Node callback server.
Gensyn AXL carries SIGNAL → DECISION → RESULT messages (with a local event bus fallback when no AXL node is up).
0G Labs storage is used to persist snapshots and an event trail.
ENS names identify each agent. A React + Vite dashboard (and optional Firebase Hosting deploy) shows live stats and includes a wagmi/viem “My Vault” panel for deposits, withdrawals, and vault settings on Sepolia.
The backend is TypeScript on Node, compiled with tsc. The entrypoint boots three agent classes extending a shared BaseAgent that wires AXL (fetch to /topology, /send, /recv with timeouts and fallback) and a 0G client (@0glabs/0g-ts-sdk + ethers JsonRpcProvider) for storeState / appendEvent when keys and SDK are available.
PriceScout calls viem createPublicClient + QuoterV2 quoteExactInputSingle via encodeFunctionData / call (avoiding brittle simulateContract on public RPCs).
RiskManager is pure decision logic on in-memory stats. Executor uses viem wallet client + Uniswap helpers for approve/swap and optional SwarmFund drawdown / returnFunds with ABI from parseAbi.
A node:http server exposes /api/stats, /api/settings, /api/trigger with permissive CORS and binds 0.0.0.0 so ngrok can reach the API while the UI (local Vite or hosted Firebase) polls JSON. The UI is React 18, TanStack Query, wagmi v3 + @wagmi/connectors (injected) on Sepolia, with SwarmFund + ERC20 ABIs inlined for deposit/withdraw/limits/bot wallet. Firebase is static hosting (dist + SPA rewrite). Notable “glue”: HTTP bridge from KeeperHub into a process that otherwise speaks AXL; early HTTP listen so the dashboard stays reachable while slow RPC/0G init runs; ngrok-skip-browser-warning on fetches when tunneling.

