Risk & Compliance Track β Automated cryptoasset exposure monitoring, SCO 60 regulatory compliance engine, and AI-powered advisory system built on Chainlink CRE.
SCO60-CRE is a real-time cryptoasset supervisory platform that integrates Chainlink CRE workflows with a full-stack monitoring system to help regulators enforce Basel III SCO 60 rules β the BCBS standard governing institutional cryptoasset exposure.
| Module | Function |
|---|---|
| CRE Workflow | Orchestration layer: cron-triggered + on-chain log-triggered monitoring |
| SCO 60 Engine | Classifies assets (Group 1a/1b/2a/2b), calculates RWA, checks soft/hard caps |
| On-Chain Reporting | Writes exposure results to ExposureOracle.sol, triggers RiskAlertManager.sol |
| AI Advisory | Google Gemini 2.0 Flash generates compliant regulatory action recommendations |
| Stress Testing | Simulates market shocks (50% price drop, liquidity haircut) and recalculates CAR |
| Regulator Dashboard | React UI with glassmorphism design, real-time BTC/ETH prices, alert management |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Chainlink CRE Layer β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β workflow.go β CRE Workflow (Cron + Log Triggers) β β
β β ββ FetchPrices() β CoinGecko API β β
β β ββ CheckExposures() β SCO 60 threshold engine β β
β β ββ AnalyzeRisk() β Gemini AI advisory β β
β β ββ WriteOnChain() β ExposureOracle.sol β β
β β ββ EmitAlerts() β RiskAlertManager.sol β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β REST API / Events
βββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββ
β Golang Backend API Server (Gin + JWT + RBAC) β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββββββββββββ β
β β Exposure β β Pricing β β Alerts β β Stress Testing β β
β β Engine β βCoinGecko β β System β β Engine β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββββββββββββ β
β PostgreSQL 16 β
βββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β HTTP / JSON
βββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββ
β React + Tailwind Frontend β Supervisory Portal β
β Dashboard β Institutions β Alert Center β Stress Testing β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Go 1.23+
- Node.js 20+
- Docker & Docker Compose
- Chainlink CRE CLI
# 1. Clone the repository
git clone https://github.com/smpebble/sco60-cre_demo
cd SCO60-CRE
# 2. Configure environment
cp backend/.env.example backend/.env
# Edit backend/.env β add your AI_PROVIDER_KEY (Gemini API) and blockchain keys
# 3. Start all services (PostgreSQL + Backend + Frontend)
docker-compose up -d
# 4. Verify everything is running
curl http://localhost:8090/health
open http://localhost:3000# 1. Start database
docker-compose -f docker-compose.db.yml up -d
# 2. Start backend API server
cd backend
cp .env.example .env # Edit .env
go run cmd/server/main.go
# 3. Start frontend (new terminal)
cd frontend
npm install
npm run dev
# 4. Run the Chainlink CRE workflow (new terminal)
cd sco60-cre
cre workflow simulate sco60-cre
Basel III SCO 60 classifies cryptoassets into four groups with corresponding risk weights:
| Group | Asset Type | Risk Weight | Treatment |
|---|---|---|---|
| 1a | Tokenised traditional assets | 20% | Standard credit/market risk |
| 1b | Stablecoins (meets stabilisation criteria) | 20% | Standard credit/market risk |
| 2a | Crypto (meets hedging criteria) | 100% | Multiplication factor applied |
| 2b | Unhedged crypto (BTC, ETH) | 1250% | Full deduction from capital |
Group 2 Exposure Caps (applied against Tier 1 Capital):
- π‘ Soft Cap (1%) β Warning, enhanced monitoring required
- π΄ Hard Cap (2%) β Critical, excess exposure receives 1250% RW penalty
The sco60-cre/ directory contains the CRE workflow, meeting hackathon requirements:
β
Blockchain integration β Reads on-chain events from RiskAlertManager.sol (log trigger), writes to ExposureOracle.sol
β External API β CoinGecko real-time price feeds (REST integration)
β AI/LLM β Google Gemini 2.0 Flash for regulatory risk assessment and recommendations
β Automated monitoring β Cron trigger (every hour) + manual/log triggers
1. FetchPrices β CoinGecko API: BTC, ETH, USDT, USDC prices
2. CheckExposures β SCO 60 Group 1a/1b/2a/2b categorization + RWA
3. AIAnalysis β Gemini: Generate regulatory compliance assessment
4. WriteOnChain β ExposureOracle.sol: reportExposure() transaction
5. EmitAlerts β RiskAlertManager.sol: emitAlert() if thresholds exceeded
15 core tables including:
| Table | Description |
|---|---|
institutions |
Regulated entities (bank, securities, trust) |
crypto_assets |
SCO 60 classified assets with risk weights |
holdings |
Daily position reports by institution |
exposure_results |
Calculated SCO 60 metrics per institution per date |
alerts |
On-chain event log + off-chain risk alerts |
stress_test_results |
Historical stress simulation results |
ai_advisories |
LLM-generated regulatory recommendations |
price_history |
Daily OHLCV from CoinGecko |
| Contract | Network | Purpose |
|---|---|---|
ExposureOracle.sol |
Sepolia | Stores institution exposure data on-chain |
RiskAlertManager.sol |
Sepolia | Emits threshold breach events (CRE log trigger) |
All endpoints require JWT authentication (Authorization: Bearer <token>).
POST /api/v1/auth/login
GET /api/v1/dashboard
GET /api/v1/institutions
GET /api/v1/institutions/:id
GET /api/v1/assets
GET /api/v1/exposures/:institutionId
POST /api/v1/exposures/calculate [ADMIN, REGULATOR]
GET /api/v1/alerts
POST /api/v1/alerts/:id/resolve [ADMIN, REGULATOR]
GET /api/v1/prices
GET /api/v1/stress/scenarios
POST /api/v1/stress/run [ADMIN, REGULATOR]
POST /api/v1/ai/advisory [ADMIN, REGULATOR]
GET /api/v1/ai/advisories/:instId
GET /api/v1/holdings/:instId
To prove the core workflow engine works without requiring judges to configure the Chainlink CRE CLI locally, we provide native simulation scripts that execute the exact identical pipeline:
# Ensure backend is running, then execute:
chmod +x scripts/simulate_cre.sh
API_BASE_URL=http://localhost:8090/api/v1 ./scripts/simulate_cre.sh# Open PowerShell and execute from the project root:
$env:API_BASE_URL="http://localhost:8090/api/v1"; .\scripts\simulate_cre.ps1SCO60-CRE/
βββ sco60-cre/ # Chainlink CRE Workflow
β βββ workflow.go # CRE workflow (cron + log triggers)
β βββ exposure_checker.go # SCO 60 threshold engine
β βββ ai_analyzer.go # Gemini LLM integration
β βββ workflow_test.go # 6 unit tests
β
βββ backend/ # Golang API Server
β βββ cmd/server/main.go # Entry point
β βββ internal/
β β βββ config/ # Environment configuration
β β βββ models/ # Domain types (15+ models)
β β βββ middleware/ # JWT + RBAC + CORS
β β βββ repository/ # PostgreSQL data access (9 repos)
β β βββ service/ # Business logic (7 services)
β β βββ handler/ # HTTP handlers (17 endpoints)
β βββ migrations/ # PostgreSQL schema (15 tables)
β βββ Dockerfile
β
βββ frontend/ # React + Tailwind Portal
β βββ src/
β β βββ pages/ # Dashboard, Institutions, Alerts, Stress Test
β β βββ components/ # MainLayout, shared UI
β β βββ contexts/ # AuthContext
β β βββ lib/ # API client, utilities
β β βββ types/ # TypeScript DTOs
β βββ Dockerfile
β
βββ contracts/ # Solidity Smart Contracts
β βββ ExposureOracle.sol
β βββ RiskAlertManager.sol
β
βββ scripts/
β βββ simulate_cre.sh # Integration test script
βββ docker-compose.yml # Full-stack deployment
βββ README.md
This project satisfies all Chainlink CRE hackathon requirements:
- β CRE Workflow as the orchestration layer with at least one blockchain + external API integration
- β Automated Risk Monitoring β Continuous SCO 60 exposure assessment
- β Real-time Backup Health Checks β Capital adequacy monitoring with threshold alerts
- β
Protocol Protection Triggers β On-chain
RiskAlertManager.solevents for automated response - β AI/LLM Integration β Gemini 2.0 Flash for regulatory advisory generation
- β Successful CRE Workflow deployment β Staging and production configurations included
MIT License β Built for the Chainlink Hackathon 2026.