Riskometer
Autonomous risk monitoring for every DeFi protocol
What it is
Riskometer is an autonomous DeFi risk monitoring and response platform powered by Chainlink CRE.
It solves a critical problem: DeFi protocols have lost over $60 billion to preventable risks like stablecoin depegs, oracle manipulation, and whale concentration, because no automated, trustless system existed to detect and respond to these threats in real time.
Riskometer deploys three specialized monitoring agents called Guards on a Chainlink CRE DON:
The Depeg Guard monitors stablecoin peg deviation using a weighted consensus of Chainlink Price Feeds (40%), CoinGecko API (30%), and Uniswap V3 TWAP (30%). When
deviation crosses user-defined thresholds, it autonomously triggers escalating on-chain actions from alerts all the way to emergency pauses.
The Oracle Guard detects price feed anomalies by tracking heartbeat freshness, cross-source spread, and volatility for feeds like ETH/USD.
The Whale Guard tracks top-N wallet concentration as a percentage of total supply and triggers protective actions when dangerous thresholds are breached.
Why CRE is essential: Riskometer fundamentally cannot exist without Chainlink CRE. The entire value proposition depends on decentralized, trustless computation and
execution. Without CRE, risk monitoring would require a centralized server watching prices and submitting transactions from a single hot wallet, which introduces the
exact single points of failure DeFi was designed to eliminate. CRE enables the DON to fetch prices from multiple sources, compute weighted risk scores through consensus
among independent nodes, and generate cryptographically signed reports that are verifiable on-chain. No single node can fabricate a risk score or trigger a false
emergency. The DON-signed report is what gives protocols the confidence to hand over critical functions like pausing borrowing or reducing collateral factors to an
automated system. CRE transforms risk monitoring from "trust this server" to "verify this proof."
How it works: A protocol team connects their wallet, enters their contract address, and Riskometer automatically discovers all callable functions from the ABI. No
custom integrations or code changes required. They map functions to risk levels and set escalation thresholds. From that point, the CRE DON continuously monitors data
sources, computes a weighted risk score with consensus, and when thresholds are breached, generates a DON-signed report that triggers the protocol's defense function
on-chain. Fully autonomous, fully verifiable, no human in the loop.
What makes it unique: Riskometer is protocol-agnostic. Any DeFi protocol can plug in by simply providing a contract address. The platform auto-generates the entire CRE
workflow configuration, making decentralized risk monitoring accessible without specialized Chainlink development expertise.
Test Transactions:
How it Works
Riskometer is a full-stack application spanning four layers, with Chainlink CRE at its core.
Smart Contracts (Solidity + Foundry): The DepegGuardExecutor deployed on Sepolia receives DON-signed reports from the CRE Forwarder, validates signatures, prevents
replay attacks, and dispatches protocol-agnostic actions via low-level calls. A MockProtocol contract simulates lending protocol responses for demo purposes.
CRE Workflows (TypeScript + Bun + @chainlink/cre-sdk): This is the heart of the system. Three independent CronCapability-triggered workflows run directly on the
Chainlink DON. Each fetches multi-source price data using EVMClient.callContract for on-chain reads and HTTPClient.sendRequest with median consensus for off-chain APIs.
The DON nodes independently compute weighted risk scores and reach consensus, then submit DON-signed reports via runtime.report() and evmClient.writeReport() to
Sepolia. CRE is what makes this decentralized rather than just another centralized bot. The computation happens across multiple independent nodes, the aggregation uses
consensus, and the output is a cryptographic proof that the risk score was honestly computed. Without CRE, every piece of this pipeline would need a trusted centralized
operator.
Backend (Express.js + MongoDB + Viem): Serves as the coordination layer. It stores user workflows in MongoDB, fetches on-chain events (DepegAlertLogged,
ActionDispatched, RiskReportReceived) via Viem with chunked block-range queries, and streams live updates to the frontend over WebSocket. The /api/config endpoint
auto-generates CRE workflow JSON from any contract's ABI, lowering the barrier to deploying new CRE workflows.
Frontend (React + Vite + TailwindCSS + RainbowKit): Features a guided onboarding wizard for contract input, function discovery, and threshold configuration. Includes
a real-time risk gauge (0-100), sparkline charts, live event timeline, and WebSocket-powered status indicators. Wallet connection via RainbowKit/wagmi.
Links
Created by
- Arunava Barua