SAKA - DeFi AI Agent

Your own AI DeFi agent on Uniswap that thinks on 0G and proves every move it makes.

SAKA - DeFi AI Agent

Created At

ETHGlobal Mumbai

Winner of

0G

0G - Build with 0G Private Computer 2nd place

Project Description

SAKA gives every user their own AI DeFi agent with a verifiable reason for every move. Sign in with a passkey, get a Privy agent wallet, and ask in plain English: "Swap $5 ETH to USDC", "Put $10 into ETH/USDC", "Is this hook safe?".

The agent plans on 0G, builds transactions on Uniswap, and runs every action through a safety pipeline: a trade score, a hook safety score, a simulation, an independent AI guard and a deterministic policy. Small, safe actions under your limits run on their own after a 3-second countdown you can cancel. Anything bigger waits for your passkey approval, and risky actions are refused with a reason.

Autopilot means the agent comes to you. Nine detectors watch each funded wallet every minute (dips, big moves, profit targets, idle USDC, LP out of range, new or changed hooks, better pools) and propose actions with Yes / Change / No, in the app and on Telegram. The Market Event Simulator lets you trigger a market event on demand: the event is simulated, the decision is real, and "no action" counts as a decision.

The Hooks page explains Uniswap v4 hooks in plain words, each with a deterministic 0–100 safety score based on the Uniswap v4 Security Framework.

Every decision, executed or refused, is stored on 0G Storage with every 0G request ID, check, policy result and transaction hash, so anyone can verify why the agent moved money without trusting us. Execution runs on Ethereum Sepolia; mainnet is read-only for market data.

How it's Made

SAKA is a TypeScript monorepo (pnpm + Turborepo) with a React + Vite + Tailwind web app on Vercel, and a Fastify API, BullMQ worker, PostgreSQL (Prisma) and Redis running in Docker on one Azure VM behind Caddy.

0G is the brain. Every inference goes through the 0G Router (Private Computer) with verify_tee: true, our own client request ID, and a check that the X-Request-ID header matches the x_0g_trace request ID in the body. Otherwise the answer is rejected. GLM-5.3 in private trust mode is the planner, with 0GM-1.0 as a verified fallback. Vela 2.0 on the /v1/decisions endpoint is the guard: it returns a probability, blocks below 0.8, and fails closed if 0G is unreachable. 0GM-1.0 writes plain-English explanations. Each finished decision is serialized as canonical JSON (no personal data, no signatures) and uploaded to 0G Storage with the TS SDK; we check the returned root hash against our local Merkle root and show it on the card with an explorer link.

Uniswap is the hands. We built our own MCP server, uniswap-agent-mcp, with 16 typed tools over the Trading API (client generated from the OpenAPI spec), the LP API, v4 V4Quoter / StateView / PoolManager / PositionManager and the v4 subgraph. It follows Uniswap's own uniswap-ai skills and is published as a plugin in our fork of Uniswap/uniswap-ai. The server is unsigned-only by design: a test fails the build if signing or broadcast code ever lands in it, so a hijacked model can only propose a trade. Permit2 flows return EIP-712 typed data plus an HMAC-signed resume token bound to the original arguments that expires in 120 s. score_hook reads the hook's 14 permission bits from its address and scores it against the v4 Security Framework.

Privy server wallets hold funds under a per-wallet policy that only allows Uniswap contracts, Permit2 and allowlisted tokens. Passkeys (WebAuthn via SimpleWebAuthn) handle sign-in and step-up approvals. Telegram alerts use grammY.

Notably hacky: the Market Event Simulator overlays simulated market data onto the real context reads, while the 0G planner, the pipeline and the Uniswap client stay real, so you can trigger a "3 a.m. crash" live and watch a genuine decision. The project has 600+ Vitest tests.

background image mobile

Join the mailing list

Get the latest news and updates