All projects

KPI Pulse

CRE-powered DeFi KPI oracle that auto-toggles onchain risk mode from live protocol data.

DeFi & Tokenization Risk & Compliance Tenderly

What it is

KPI Pulse is an automated risk monitoring system for DeFi. It uses Chainlink CRE to pull live protocol KPIs from DefiLlama, publish normalized snapshots onchain, and automatically switch a strategy's risk mode when configurable thresholds are crossed. Today, strategy operators and treasury teams monitor metrics like TVL manually and react inconsistently when protocol health changes. KPI Pulse replaces that with a fully automated, auditable control loop. The system supports two execution paths: a scheduled cron trigger for proactive monitoring, and an event-driven log trigger for on-demand checks. Both share the same core logic and produce verifiable onchain artifacts (KPI snapshots, policy mode transitions, and emitted events) that are visible in Tenderly Explorer.

How it Works

KPI Pulse is built with the Chainlink CRE TypeScript SDK, Solidity smart contracts compiled with Foundry, and deployed to a Tenderly Virtual TestNet forked from Sepolia. The CRE workflow package (cre-workflow/) uses @chainlink/cre-sdk with two cre.handler() registrations, a CronCapability trigger for scheduled updates and an EVMClient.logTrigger for reactive updates. Inside the shared callback, the workflow uses HTTPClient with consensus aggregation to fetch live TVL from DefiLlama, EVMClient.callContract to read the prior onchain snapshot, and runtime.report() + EVMClient.writeReport() to publish new snapshots and apply policy changes through signed CRE reports. Three Solidity contracts handle the onchain state: KpiOracle stores KPI snapshots, PolicyManager holds threshold configuration, and StrategyController manages the risk mode state machine with an allowlisted update request path.

Links

Created by

  • David Seibold