ChainGuard Sentinel
Decentralized smart contract risk monitoring powered by Chainlink CRE, AI, and on-chain reports.
What it is
ChainGuard Sentinel is an AI-powered monitoring and alerting system for already-deployed smart contracts (DeFi, RWAs, DAOs). It addresses the problem of ongoing market risk after deployment—price volatility, liquidity drops, and oracle deviations that can cause liquidations or exploits, without requiring any change to contract code.
What it is: A web dashboard where users add contract addresses and run "Full Analysis" or enable automatic scanning at an interval. Each analysis triggers a Chainlink CRE workflow that reads the contract on-chain, fetches market data (e.g. Chainlink Data Feeds), runs AI risk analysis (OpenRouter/Gemini), and writes the report back to a CRE consumer contract on Sepolia. The frontend reads the result via getAssessment(requestId) and displays risk level, score, and summary.
How it works: (1) User or cron calls requestRiskAnalysis(contractAddress, chainSelectorName) on the consumer contract. (2) The contract emits RiskAnalysisRequested. (3) The CRE workflow (EVM log trigger) runs: EVM reads contract state, pulls Chainlink price data, runs AI, encodes the report. (4) The workflow writes the report to the consumer via onReport. (5) The app polls getAssessment until filled and updates the UI. No custom backend—only the frontend, the consumer contract, and the CRE workflow (simulated locally with the CRE CLI or deployed on a DON).
What problem it solves: Centralized monitoring tools are a single point of failure and lack verifiable execution. ChainGuard collapses the full pipeline—blockchain + external data + LLM—into one CRE workflow, so execution is decentralized, tamper-resistant, and auditable, with the outcome stored on-chain.
How it Works
Frontend: Next.js 16 (React), Tailwind, Vercel/PxxlSpace. Wallet and chain reads via Wagmi/viem (Sepolia). The app talks only to the CRE consumer contract and its own Next.js API routes (trigger-analysis, assessment poller, sync).
Smart contracts: Solidity (Forge), deployed on Sepolia. ChainGuardCREConsumer emits RiskAnalysisRequested and stores reports delivered by CRE; ChainGuardRegistry (optional) holds monitored contracts and alerts.
CRE workflow: TypeScript workflow in a separate repo (chain-guard-cre), triggered by the consumer’s EVM log. Uses CRE SDK, viem for EVM reads and event decoding, Chainlink Data Feeds for market data, and OpenRouter(or Gemini) for AI risk analysis. Run locally via "cre workflow simulate" (listener script in the frontend repo) or deployed to a Chainlink DON.
Integration: The frontend repo includes a CRE EVM listener script that watches for RiskAnalysisRequested and runs "cre workflow simulate" so the report is written on-chain during development. Production uses the same flow with the workflow on a DON; Vercel or the deployment app's Cron can hit the trigger-analysis API on a schedule.
Links
Created by
- Bilal Oyeleke