The Unified Risk Layer for DeFi - From Price Oracles to Protocol-Owned Risk Oracles
- The Problem: Real-Time Risk, Slow Response Paths
- From Price Oracles to a Risk Layer
- Aave’s Risk-Management Journey
- The Black-Box Problem in First-Generation Risk Oracles
- Protocol-Owned Risk Infrastructure with Chainlink CRE
- Case Study: Optimizing Pendle PT Token Pricing on Aave
- What the Risk Layer Must Resolve
- Conclusion
- Frequently Asked Questions
- References
Risk conditions in DeFi move in real time. They are volatile, sometimes unpredictable, and frequently distilled into signals a protocol could act on if it had a fast enough response path. The problem is rarely detecting the signal; it is acting on it with guarantees. This article is based on a conference talk on the subject and follows its argument that the missing piece of the DeFi oracle stack is a unified risk layer: a component that sits between real-world risk signals and on-chain response actions, combining real-time responsiveness, programmatic execution, and data-rich methodologies. The concrete example is the pricing of Pendle Principal Token collateral on Aave, delivered as protocol-owned risk infrastructure rather than an operator’s black box.
This article has been made with the help of Claude Code and several custom skills
[TOC]
The Problem: Real-Time Risk, Slow Response Paths
Once a risk signal exists, a protocol needs a way to translate it into an on-chain action such as changing a parameter, adjusting a price, or halting an activity. Three response paths are available today, and each resolves one part of the problem while leaving another open.
On-chain governance. A risk manager makes a recommendation, stakeholders deliberate, and a vote authorises execution, usually behind a timelock. This is the most credibly neutral path and it is excellent for demonstrating that a protocol behaves consistently. It is also slow: it depends on the consensus of stakeholders who are, for the most part, non-specialists, and the timelock adds further delay. It does not scale to the number of parameters a mature lending market has to manage.
Delegated operators. To move faster, many protocols delegate risk-management responsibilities to a whitelisted operator that is authorised to change specific parameters within pre-agreed bounds. Execution is efficient, but the arrangement is trust-based. The protocol generally does not know what the operator’s security posture or monitoring systems look like, and cannot verify that the operator will act quickly and responsibly at the moment it matters most.
On-chain controllers. A programmatic controller executes in real time with no human in the loop. It removes the trust and latency problems, but it is narrow: it has access only to a small set of on-chain inputs, which is too thin a data diet for the nuanced decisions that resilient risk management requires.
Each path resolves one of three requirements (real-time responsiveness, programmatic execution, data-rich methodology) at the expense of the others. A unified risk layer is defined precisely as the component that satisfies all three at once, with consistent guarantees, sitting between the risk signals in the outside world and the appropriate response action inside the protocol.
From Price Oracles to a Risk Layer
The industry has been discussing the oracle problem (how to bring trustworthy external data on-chain) for years, so it is natural to frame the risk layer in oracle terms. The oracle stack in production today has two layers.
The raw data layer is almost always market price data, because price is the input most immediately needed to power a DeFi protocol. The oracle network above it handles data transport: it queries multiple independent data providers, aggregates their responses, reaches its own internal consensus across a distributed set of nodes to preserve data integrity, and delivers the result on-chain for the protocol to consume.
The missing piece is a third layer that turns diverse data into actionable risk decisions rather than raw values.

Introducing a risk layer on top of the oracle network immediately widens the range of data a protocol can incorporate in an actionable way. Instead of market price alone, the risk layer can ingest liquidity conditions, volatility properties, macroeconomic data, derivatives data, credit ratings, and other market behaviours and events. Its role is threefold:
- Ingest diverse risk signals from those sources.
- Define the threshold conditions that matter and the response actions that are appropriate and usable for the specific protocol.
- Emit one or more output conditions, which fall into two families:
- risk-managed pricing, a price that already accounts for the asset’s risk profile, and
- risk-managed responses, such as circuit breakers or risk-parameter changes.
Those outputs are then fed on-chain and consumed by the protocol exactly as a price feed is today. The claim behind this design is that a risk layer of this kind will become the dominant way DeFi protocols ingest external data over the next couple of years, because price alone cannot express the conditions that actually drive protocol risk.
Aave’s Risk-Management Journey
Aave is a useful reference because it is a mature protocol that has secured tens of billions of dollars over several years, and its risk tooling has visibly evolved through each of the three response paths described above.
- 2020: on-chain governance. Aave introduced on-chain governance in which risk managers made recommendations that stakeholders deliberated on and approved for execution. For a young protocol, this was an effective way to prove resiliency and consistency, but it was not a scalable way to run day-to-day parameter management.
- 2023: manual risk stewards. This delegation structure let Aave hand a trusted third party ownership over specific parameters, bounded by how much each parameter could move and how frequently a change could be executed. Faster than governance, but trust-based.
- 2024: first-generation risk oracles. Built on top of the risk-steward framework, these replaced the manual operator with an automated one. Execution became programmatic, driven by an encoded methodology that defined the threshold conditions and the appropriate parameter updates to push on-chain, again inside tightly controlled bounds.

Each step traded some neutrality for speed and scale. The first-generation risk oracle was the closest thing to the unified risk layer, but it carried a limitation serious enough to define the next problem to solve.
The Black-Box Problem in First-Generation Risk Oracles
At the time the first risk oracles were built, there was no credibly neutral, highly reliable infrastructure on which an operator could run one. Out of necessity, operators built the risk oracle as a proprietary black box on their own back-end, typically on a cloud provider such as AWS. By default, that made the decision logic intransparent: not visible to the protocol team, to auditors, or to other service providers.
That opacity has several consequences.
- Dependency. The protocol depends entirely on the operator to keep executing reliably, with no independent way to see what the system is doing.
- Silent failure. If the oracle failed to push an update when it should have, the failure was silent. Nobody could see that an expected action had not happened.
- No root-cause visibility. If the oracle pushed an update that contradicted its stated methodology, there was no way to reconstruct what caused the deviation.
- Manipulability under the guise of automation. Because the operator controls the back-end, it can update the logic without notice, stop the oracle from running, or push a manual update while presenting it as the output of an automation. From the protocol’s point of view, all three are indistinguishable from normal operation.
The through-line of these problems is dependency on an opaque operator. The remedy is to move from operator-owned infrastructure to protocol-owned risk infrastructure, where the logic that governs a protocol’s parameters is visible to, and controlled by, that protocol.
Protocol-Owned Risk Infrastructure with Chainlink CRE
The way to make a risk oracle protocol-owned is to run its off-chain logic on neutral, verifiable infrastructure rather than a single operator’s server. The design described here builds on the Chainlink Runtime Environment (CRE), the same class of infrastructure that already powers the majority of DeFi today and is validated by a decentralised network of Chainlink nodes.
Building on CRE changes the ownership model in two ways that directly answer the black-box problem:
- The off-chain workflow belongs to the protocol. The code that runs off-chain can be validated by the protocol team and by auditors, so the methodology is fully transparent rather than hidden on an operator’s back-end.
- Full data access. Because the workflow runs inside the Chainlink environment, it has access to the complete set of data capabilities Chainlink provides, which is what lets the risk layer move beyond price alone.
Under this model the risk oracle is no longer a delegation of authority to an outside party; it is an extension of the protocol’s own capabilities, running on infrastructure nobody involved has to trust unilaterally.
Case Study: Optimizing Pendle PT Token Pricing on Aave
The flagship use case is the pricing of Pendle Principal Token (PT) collateral on Aave, one of the first risk oracles being rolled out under this model.
What a PT token is
A Pendle PT token is effectively a zero-coupon bond on a yield-bearing underlying with a fixed time to maturity. At maturity it redeems one-to-one for the underlying asset. The yield the holder earns is exactly the discount paid today relative to that future parity redemption: buy below par now, redeem at par later, and the gap is the return.
The difficulty is that PT tokens are hard to price on-chain in a non-manipulable way. A common strategy is to apply a simple linear discount equal to the yield the token is expected to earn over its remaining time to maturity. If \(FV\) is the face (redemption) value, \(y\) the implied yield, and \(\tau\) the fraction of a year to maturity, the linear approximation is roughly
[\begin{aligned} P_{\text{linear}} \approx FV \cdot \left(1 - y \cdot \tau\right) \end{aligned}]
This is safe but conservative. A conservative discount leaves headroom between the price the protocol uses and the price the market would support, and that headroom is unused collateral efficiency: a borrower backed by PT collateral can borrow less than the asset could actually justify, which degrades the borrower experience.
Using the asset’s time-varying risk profile
A PT token is not equally risky across its life, and that structure is what a richer methodology can exploit. Early in its life the token exhibits excessive volatility: a relatively small change in the yield of the underlying asset has an outsized influence on the PT price. As the token approaches maturity, its behaviour becomes far more deterministic, volatility falls, and the price path toward par carries much greater assurance.
Two kinds of optimisation follow from this:
- Discount adjustment. The linear discount can be adjusted so that the price it produces tracks the actual PT market price more closely, recovering the collateral efficiency that a flat conservative discount throws away.
- Liquidation-parameter tapering. The market’s liquidation parameters (borrowing power, or loan-to-value; the liquidation threshold; and the bonus paid to liquidators) can start conservatively while the token is young and volatile, and taper toward more aggressive values as maturity approaches and the price becomes more predictable.
The net effect is a price and a set of parameters that follow the asset’s real risk profile through time instead of pinning them to the worst case for the entire life of the token.
The workflow architecture
The optimisation runs as a CRE workflow owned by the protocol. It consumes two data inputs:
- the Pendle AMM price of the token, and
- a parameter registry, a per-asset configuration covering every asset that has a Pendle token price feed.
Those inputs enter the workflow, which then runs the risk methodology: it evaluates the threshold conditions and determines the appropriate actionable responses. When the workflow identifies an optimisation, CRE pushes the resulting value on-chain through the Llama Guard oracle, which authorises the corresponding updates to the target Aave market and its market oracle.

Because the workflow logic is validated to the protocol team and auditors, this is the concrete sense in which the design is a move from delegation to protocol ownership: the methodology that sets Aave’s PT parameters is transparent and belongs to Aave, not to an operator running an opaque process elsewhere.
This is the first of several use cases in the same mould. Others in progress include risk-managed price feeds on the net asset value (NAV) of real-world-asset collateral, and risk oracles for supply and borrow caps and other parameter optimisations.
What the Risk Layer Must Resolve
Returning to the three friction points, the requirement for a DeFi risk layer is to resolve all of them simultaneously rather than trading one for another.
| Response path | Strength | Weakness the risk layer must remove |
|---|---|---|
| On-chain governance | Resilient, credibly neutral, consistent | Slow, relies on human consensus, not scalable |
| Delegated operators | Efficient execution | Trust-based; unknown security and monitoring; timing risk |
| On-chain controllers | Programmatic, real-time | Narrow data access, insufficient for nuanced decisions |
Stated positively, the risk layer must respond in real time as conditions evolve, it must expand the protocol’s capabilities rather than delegate them away, and it must be driven by data-rich methodologies sophisticated enough to keep the protocol resilient. Delivering all three at once is what turns risk management from an external service into core protocol infrastructure, with the end goal of helping the protocols that adopt it reach scale, resiliency, and durable user trust.
Conclusion
The oracle stack solved the problem of getting trustworthy prices on-chain, but price is only one of the inputs that determine a protocol’s risk. The unified risk layer generalises the oracle from a price transport into a decision layer: it ingests diverse signals, applies an explicit methodology, and emits either risk-managed prices or risk-managed responses. Aave’s path from governance to manual stewards to automated risk oracles shows both the pull toward automation and the cost of the first attempt, an opaque operator-run black box. Running the methodology on neutral, verifiable infrastructure such as Chainlink CRE removes that opacity and returns ownership of the logic to the protocol. The Pendle PT pricing case makes the payoff concrete: a price and liquidation parameters that follow the asset’s time-varying risk profile recover collateral efficiency that a flat conservative discount leaves on the table, without giving up transparency.

Frequently Asked Questions
Q: What are the three response paths a protocol can use to act on a risk signal, and what does each fail to provide?
On-chain governance, delegated operators, and on-chain controllers. Governance is credibly neutral and consistent but slow and unscalable because it relies on the consensus of non-specialist stakeholders plus a timelock. Delegated operators execute efficiently but are trust-based: the protocol cannot verify their security or monitoring, or that they will act at the critical moment. On-chain controllers are programmatic and real-time but have access to too narrow a set of data for nuanced decisions. Each resolves one of the three requirements (real-time execution, programmatic execution, data-rich methodology) while leaving the other two open.
Q: How does the risk layer differ from the price oracle network beneath it?
The oracle network transports and aggregates raw data, almost always market price, and delivers a value on-chain. The risk layer sits above it and turns diverse data into decisions. It ingests signals beyond price (liquidity, volatility, macroeconomic data, derivatives data, credit ratings), defines threshold conditions and protocol-appropriate responses, and emits either a risk-managed price or a risk-managed response such as a circuit breaker or a parameter change. In short, the oracle network answers “what is the value?” while the risk layer answers “what should the protocol do about it?”.
Q: Why is a simple linear discount for Pendle PT tokens described as leaving collateral efficiency unused?
A linear discount prices the PT token at roughly \(FV \cdot (1 - y\tau)\), applying the full expected yield as a flat haircut for the entire life of the token. Because it is deliberately conservative, the price the protocol uses sits below the price the market would support, and the gap is headroom that no one is using. A borrower posting PT collateral can therefore borrow less than the asset could safely justify, which is the sense in which the conservatism is a cost: the unused headroom is lost collateral efficiency and a worse borrower experience.
Q: Why can PT pricing and liquidation parameters be made more aggressive as the token approaches maturity?
A PT token’s risk profile changes over its life. Early on it is highly volatile: a small move in the underlying yield moves the PT price disproportionately. Near maturity the price path toward the one-to-one redemption is much more deterministic and carries greater assurance. Because the uncertainty shrinks over time, the discount can be tightened to track the market price more closely, and the liquidation parameters (loan-to-value, liquidation threshold, liquidation bonus) can be tapered from conservative early values toward more aggressive ones, matching the parameters to the actual risk at each point in time.
Q: What specific problem of first-generation risk oracles does running the workflow on Chainlink CRE solve?
First-generation risk oracles were built as proprietary black boxes on an operator’s own back-end because no credibly neutral, reliable infrastructure existed to run them. That made the logic opaque to the protocol, auditors, and other service providers, which in turn allowed silent failures, unexplained deviations from the stated methodology, and manipulation under the guise of automation (the operator could change the logic, stop it, or push manual updates unnoticed). Running the workflow on CRE makes the off-chain code validatable by the protocol team and auditors and executes it across a decentralised node network, so the methodology becomes transparent and protocol-owned rather than a dependency on one opaque operator.
Q: How do the two data inputs and the on-chain write fit together in the Pendle PT workflow?
The workflow consumes the Pendle AMM price of the token and a parameter registry that holds the per-asset configuration for every asset with a Pendle price feed. It runs the risk methodology over those inputs, evaluating threshold conditions and computing the appropriate response. When it finds an optimisation, CRE pushes the value on-chain through the Llama Guard oracle, which authorises the resulting updates to the target Aave market and its market oracle. The AMM price supplies the live market signal, the registry supplies the per-asset rules and bounds, and the on-chain write applies the result within those bounds.