SwarmFi

A multi-agent DeFi swarm where autonomous agents communicate peer-to-peer

Visit Repo
SwarmFi banner

About

SwarmFi is an autonomous DeFi swarm where a researcher agent scans live markets, a risk agent scores opportunities on 0G Compute (sealed inference), and an executor agent commits decisions through KeeperHub with full audit trails on 0G Storage. Agents communicate peer-to-peer via Gensyn AXL and identify themselves through ENS.

How it's made

SwarmFi is a three-agent autonomous DeFi swarm composed entirely of sponsor primitives, glued together with FastAPI on Python 3.12 and a tiny Node.js sidecar.

Each cycle, a researcher sweeps four Base bluechip pairs (ETH/USDC, ETH/USDT, WETH/USDC, cbBTC/USDC) and ranks them on a transparent composite edge profile (40% momentum, 25% bluechip, 20% spread, 15% size-fit) — inspired by Carver's Systematic Trading. The top pair becomes the signal. A risk agent sends that signal to 0G Compute for sealed AI inference (qwen3-plus / GLM-FP8) which scores it 0–10 against a structured rubric. An executor consults the Uniswap Trading API as a live price oracle (quote, route, gas estimate), then settles the swarm's commitment on Sepolia via KeeperHub /api/execute/transfer — which gives us a real on-chain tx hash per cycle. 0G Storage snapshots the entire cycle (signal, decision, tx) as one Merkle root committed via a flow tx.

Identity is ENS end-to-end: researcher/risk/executor.swarmfi.eth are real Sepolia subnames; the dashboard never hardcodes addresses, it resolves through ENS at runtime and updates swarmfi.role / status / last / tx / snapshot text records every cycle. Agents talk peer-to-peer over Gensyn AXL — three nodes (9002/9012/9022), pubkey-derived IPv6 routing.

Notably hacky bits: KeeperHub's /execute/contract-call endpoint silently ignores the calldata field and strips msg.value, causing Universal Router reverts (InsufficientETH() = 0x6a12f104). We pivoted to /execute/transfer and used the Uniswap quote as price intelligence rather than full swap execution — documented thoroughly for KH's Builder Feedback bounty. We also wrote a buffered 0G Storage layer that batches every per-event write into one consolidated on-chain snapshot per cycle (60–90s flow-tx latency × 12 writes/cycle was unworkable). Frontend is single-file vanilla HTML + GSAP via CDN — no build step, no bundler, ships in a Docker image alongside the backend.

From the public ETHGlobal showcase page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

DormantLast push 215 days ago

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.

SwarmFi - Ai Agent

SwarmFi: 4 AI agents trade DeFi autonomously — P2P comms, decentralized memory, no human needed.

Swarmex

Autonomous multi-agent DeFi engine: specialized AI swarms trade via Uniswap v4 hooks and 0G memory.

Sentinel Swarm

Multi agent DeFi guardian swarm with verifiable AI decisions and guaranteed on chain execution

SwarmNet

4 AI agents swap DeFi assets autonomously via P2P mesh — no central server, no human in the loop.