ZKRisk

AI-powered under-collateralized DeFi lending with ZK identity & cross-chain support.

ZKRisk

Created At

ETHGlobal New Delhi

Project Description

zkRisk is a production-ready DeFi lending protocol that combines real-time AI risk assessment, zero-knowledge identity, live oracle feeds, and cross-chain messaging to turn locked crypto capital into usable liquidity with stronger sybil-resistance and dynamic safety controls.

Core idea — instead of static LTVs, an AI LSTM volatility engine computes a lambda multiplier from live price/vol/sentiment inputs and adjusts borrowing capacity in real time. That enables capital-efficient, under-collateralized loans (example: deposit $100 SHIB → AI sets λ=1.8 → borrow $180 USDC) while preserving safety through oracle validation, liquidation thresholds, and circuit breakers.

Key features

AI Lambda Risk Engine (LSTM) for 30-day rolling volatility → dynamic LTV (1.0–2.0x).

Zero-Knowledge Identity (Self Protocol) to prevent Sybil attacks while preserving privacy.

Real-time Price Feeds (Pyth) and volatility readers to protect oracle integrity.

Cross-chain Lending (Hyperlane) — deposit on one chain, borrow on another (Polygon Amoy ↔ Celo Alfajores in demo).

Security controls: role-based access, reentrancy guards, slippage limits, emergency pause, and on-chain liquidation logic.

Engineer-friendly APIs: AI HTTP endpoints (health, volatility, predict) and easily-pluggable contract addresses for frontends.

Why it matters: billions of dollars are currently over-collateralized in DeFi — zkRisk targets 2–3× improvement in capital efficiency by safely expanding usable liquidity with AI and ZK identity controls.

How it's Made

We pieced zkRisk together like a DeFi Lego set, but with AI and zero-knowledge sprinkled on top.

Our frontend stack was Next.js + TypeScript + Tailwind, with Wagmi + RainbowKit to handle wallets and contract calls. That gave us a smooth UX where users can deposit collateral, check AI-powered borrowing limits, and borrow across chains.

The smart contract layer was written in Solidity, deployed with Hardhat, and split into modules: lending engine, collateral manager, liquidation module, cross-chain bridge, ZK identity verifier, and admin safety switches. We hardened them with OpenZeppelin guards, circuit breakers, and role-based access control so the system doesn’t implode if one piece misbehaves.

Now, where it gets interesting:

Fluence was our decentralized AI compute partner. We ran our LSTM volatility model on their distributed VMs. This turned our risk engine into a sort of “AI oracle” that could stream predictions back on-chain. The hacky part? We had to duct-tape together real-time Pyth feeds → Fluence inference → Solidity calls. At 4AM it felt like sorcery, but it worked.

Polygon gave us a fast, cheap, and developer-friendly home to deploy contracts. With low gas and strong tooling, it let us test crazy features like under-collateralized loans without burning ETH.

Self Protocol brought in the zero-knowledge identity layer. This was huge because it solved the “Sybil attack” problem—proving one human = one borrower—without exposing private data. Integrating it meant our loans are fairer and less gameable.

The most hackathon-worthy moment? Getting cross-chain lending to actually work with Hyperlane messaging. We demoed depositing $100 worth of SHIB on Celo and borrowing $180 USDC on Polygon, powered by the AI λ-risk score and ZK identity check. At one point, we were literally debugging Hyperlane relays while retraining the LSTM model in parallel—a total fire drill, but when it clicked, it felt magical.

So the stack in short:

Frontend: Next.js, TS, Tailwind, Wagmi, RainbowKit, Ethers.js

Smart Contracts: Solidity, Hardhat, Polygon Amoy + Celo Alfajores

AI Engine: Python, TensorFlow LSTM, Fluence decentralized compute

Infra & Partners: Pyth Network (price feeds), Self Protocol (ZK ID), Hyperlane (cross-chain), Polygon (scaling)

Security: OpenZeppelin, reentrancy guards, circuit breakers

It’s messy, ambitious, and glued together with partner tech and caffeine—but that’s the spirit of zkRisk.

background image mobile

Join the mailing list

Get the latest news and updates