How Euler v2 leverages Pyth for secure lending markets
How Euler leverages Pyth's low-latency price data to enable effective risk management for vault curators.
Euler v2 sought to strike a delicate balance: enabling capital efficiency while isolating risk for depositors. It looked to achieve a modular vault design hinges on a reliable oracle framework, with each vault requiring tailored risk parameters and trusted, chain-specific price feeds.
With Pyth, Euler v2 is able to offer isolated vaults that prevent risks in one market from spreading to others. Vault curators define the risk parameters—including which oracle to use—and rely on accurate, on-demand pricing to protect their vaults from exploits and bad debt events.
Euler’s integration of Pyth’s on-demand pricing architecture empowers users to trigger oracle updates with each transaction—ensuring timely, precise price data on-chain. This innovation enhances capital efficiency and control, advancing the frontier of risk-managed DeFi lending.
Euler: Modular, curated vaults for a new DeFi credit layer
Learn how Euler v2 leverages Pyth's on-demand data for efficiency and security, enabling vault curators to implement effective risk management.
“Pyth’s innovative on-demand oracle seamlessly aligns with Euler’s mission of modular, secure lending. Our pioneering real-time integration enables vault curators to tap into Pyth’s comprehensive suite of accurate, on-demand price feeds and deliver exceptional user experience for both lenders and borrowers.” — Anton Totomanov, Senior Smart Contract Developer
Context: Building more secure borrowing and lending
The core challenge for lending protocols is to design mechanisms that maximize capital efficiency while enabling markets collateralized by any priceable asset—without exposing users to unnecessary liquidations or the protocol to bad debt.
Euler advances this frontier through flexible vault architecture, offering optionality around isolated and cross-collateralized designs. Each market’s risk can be confined to its vault, shielding the broader system from contagion. This case study explores how Pyth’s on-demand data enhances Euler’s ability to deliver more precise risk controls and a smoother user experience.
Challenge: Achieving security and user experience
Historically, lending and borrowing protocols have used push-based oracles where vaults and users have no control over the timing of price updates and liquidation triggers, leaving them dependent on external parties to push prices on-chain.
Euler's challenge was to design a protocol modular enough to democratize vault creation while remaining agnostic about governance, risk parameters, and asset pricing. An additional challenge was to enable oracle updates that occur atomically with user or curator interactions.
Although isolated vaults substantially reduce the risk surface for the protocol, oracle risk remains within each market. For instance, in January 2022, an exploiter inflated the TWAP Uniswap price for FLOAT/USDC and was able to drain liquidity out of Rari's Fuse pool 90.
By enabling vault curators to choose Pyth, Euler v2 offers more accurate and timely updates, mitigating attempts to manipulate on-chain price feeds.
Solution: Accurate and secure prices—on-demand
Euler v2 allows vault curators to configure Pyth as the oracle source for accurate, permissionless, and secure on-demand price data. Oracle updates are triggered whenever a user or curator interacts with the protocol:
Vault Creation — When curators deploy new vaults, Pyth updates are used to value collateral and set risk parameters.
Lending — When lenders deposit assets, fresh Pyth prices mark collateral to market.
Ongoing Risk Management — Euler and its curators use Pyth to track real-time metrics such as health factor and borrowing capacity.
Euler’s modular oracle routing system, built around ERC-7726, enables advanced configurations—like chaining Pyth prices in series or validating them against reference values. This flexibility, combined with Pyth’s reliability, underpins the next-generation architecture of composable and isolated lending markets.
Impact: A eureka moment for risk management
On January 10, 2025, the Usual protocol announced changes to USD0++ redemption guarantees, leading to a sudden depeg. While other platforms relying on hardcoded or delayed oracles incurred major losses, Euler’s USD0++ vaults pulled real-time prices from Pyth—executing liquidations instantly and preventing bad debt.
Pyth’s on-demand architecture allowed curators and users to react dynamically. As a result, Euler’s vaults closed positions safely and protected lenders—demonstrating robust risk management where others failed. In contrast, platforms with over $100M in vault exposure to USD0++ (still priced at $1) faced large-scale mispricing and user losses.
Euler’s integration with Pyth ensured not just performance during normal operations, but resilience in extreme scenarios—delivering zero bad debt even in sharp market stress.