About
RiskClaw — an autonomous risk guardian for Uniswap v4-style liquidity pools, powered by 0G. RiskClaw watches pool behavior in real time, runs verifiable AI risk analysis on 0G Compute, persists every decision and piece of evidence on 0G Storage, and updates an onchain policy registry that a Uniswap v4 hook reads before every swap and liquidity add. Built for the ETHGlobal agentic hackathon, it is fully shipped and live on the 0G Galileo testnet (chain id 16602). A three-agent swarm coordinates each loop: - Observer snapshots pool metrics and writes them to 0G Storage KV. - Analyst sends those metrics to 0G Compute, where a TEE-verified 7B-parameter LLM (qwen-2.5-7b-instruct) returns a signed risk memo with a score and reasoning. The memo is pinned to 0G Storage and its explanationRoot is committed onchain. - Guardian validates the memo against hard guardrails (max fee, max score, max single-update jump), logs the decision, and submits a signed PolicyUpdate tx to RiskPolicyRegistry. RiskHook.beforeSwap then enforces one of three modes on the next swap: ALLOW (baseline fee), PENALTY_FEE (dynamic fee override, e.g. 10% effective), or BLOCK (revert with PoolBlocked). The same hook blocks LP deposits into red pools via beforeAddLiquidity. The hook is deployed at a CREATE2-mined address whose low 14 bits encode its declared v4 permissions (BEFORE_SWAP_FLAG | BEFORE_ADD_LIQUIDITY_FLAG).
Every policy update onchain carries a PolicyProof struct with explanationRoot, computeProofRoot, metricsRoot, the provider address, and the inference responseId — so anyone can audit which model, on which evidence, justified each policy change. The full chain (observation → inference → decision → onchain enforcement → real swap settling at the AI-set fee) has been demonstrated end-to-end with verifiable testnet transactions.
The reusable pieces — 0G Storage memory adapters, 0G Compute + TEE verification helpers, policy schema/guardrails, and v4 hook adapters — are designed to lift into a hook-agent-kit package so any builder can drop a 0G-powered agent loop in front of their own v4 hook. Repo: https://github.com/Truunik/RiskClaw
From the public ETHGlobal showcase page. Votes, swipes and the judge score are hackfeed's own.






