Intelligent Risk Markets for DeFi Protection
PRISM creates continuous prediction markets that price DeFi protocol risk in real time. When risk rises, Chainlink CRE workflows automatically trigger graduated protective actions — no human intervention required.
Built for the Chainlink Convergence Hackathon 2026.
Tenderly Virtual TestNet Explorer: https://dashboard.tenderly.co/sasha_bey/project/testnet/91cd6067-7154-43a7-8b3d-314ec3f799f3
Chain ID: 73571 | Public RPC: https://virtual.mainnet.eu.rpc.tenderly.co/9ecfd80e-d72d-478b-b72f-a9b7997bfd84
[pok/ Solidity smart contracts (Foundry, Solc 0.8.24)
cre-workflows/ Chainlink CRE workflows (TypeScript)
frontend/ Web UI (Next.js 15 + thirdweb v5)
docs/ Documentation and specs
PRISM is designed as one RiskMarket per protocol. The monitored protocol is a config value — not hardcoded logic:
CRE workflow configs → "monitoredProtocol": "aave"
DeFiLlama API → https://api.llama.fi/tvl/{monitoredProtocol}
To add a new protocol (e.g. Compound, Lido, MakerDAO), you deploy a fresh set of contracts and update the config:
┌─────────────────────────────────────────────┐
│ PRISM Instance #1 — monitoredProtocol: "aave" │
│ RiskMarket → ShieldVault → InsurancePool │
│ 5 CRE workflows watching Aave TVL │
├─────────────────────────────────────────────┤
│ PRISM Instance #2 — monitoredProtocol: "compound-v3" │
│ RiskMarket → ShieldVault → InsurancePool │
│ 5 CRE workflows watching Compound TVL │
└─────────────────────────────────────────────┘
The smart contracts are protocol-agnostic — they only track a risk price. Any of the 3,000+ protocols on DeFiLlama can be monitored by changing a single config string. For the hackathon, Aave is used as the reference protocol due to its large TVL (~$14.7B) and recognizability.
cd "[pok"
forge build
forge test -vvvcd cre-workflows
npm install
npm run buildRun a live demo with real on-chain transactions showing the full risk lifecycle:
cd cre-workflows
npm run demo # live on-chain demo
npm run simulate # read-only simulation (7/7 steps)cd frontend
npm install
npm run devCopy .env.example to .env and fill in your keys:
cp .env.example .envAll files that use Chainlink CRE SDK (@chainlink/cre-sdk):
| Workflow | File | CRE Features | External Data |
|---|---|---|---|
| Risk Monitor | cre-workflows/src/risk-monitor/index.ts |
CronCapability, ConfidentialHTTP, EVMClient, DON consensus | DeFiLlama TVL API |
| AI Risk Agent | cre-workflows/src/ai-risk-agent/index.ts |
CronCapability, ConfidentialHTTP (4x), EVMClient, LLM | DeFiLlama, CoinGecko, GitHub, Gemini LLM |
| Threshold Controller | cre-workflows/src/threshold-controller/index.ts |
CronCapability, EVMClient, privateTransact, 3-retry backoff | On-chain only |
| Reserve Verifier | cre-workflows/src/reserve-verifier/index.ts |
CronCapability, ConfidentialHTTP, EVMClient | DeFiLlama TVL API |
| World ID Verifier | cre-workflows/src/world-id-verifier/index.ts |
CronCapability, ConfidentialHTTP, EVMClient, cross-chain relay | World ID API |
cre-workflows/src/risk-monitor/workflow.yamlcre-workflows/src/ai-risk-agent/workflow.yamlcre-workflows/src/threshold-controller/workflow.yamlcre-workflows/src/reserve-verifier/workflow.yamlcre-workflows/src/world-id-verifier/workflow.yaml
cre-workflows/src/shared/confidential-http.ts— Privacy audit tracking for ConfidentialHTTPClientcre-workflows/src/shared/private-tx.ts— Private transaction wrapper (MEV protection)cre-workflows/src/shared/secrets.ts— CRE Runtime secrets management
cre-workflows/project.yaml— Top-level CRE project configurationcre-workflows/config/project.yaml— Workflow schedules, network settings, privacy parameters
cre-workflows/src/demo-live.ts— Live on-chain demo executing all 5 CRE workflows with real transactionscre-workflows/src/simulate.ts— Read-only 7-step CRE simulation framework
[pok/src/RiskMarket.sol—creWorkflowaddress for CRE-authorized trades and market resolution[pok/src/ShieldVault.sol—triggerProtection(zone)callable by CRE workflow[pok/src/InsurancePool.sol—pauseNewShields(),updatePoolHealth()callable by CRE workflow[pok/src/WorldIDGate.sol—mockVerify(),verifyCrossChain()callable by CRE workflow
MIT
