← Back to posts
DeFi/11 min read/June 2, 2025

Understanding Euler v2's Architecture

My curious dive into how Euler v2 actually works - the modular architecture, risk management, and what makes it different from other lending protocols.

DeFiLendingEulerSmart ContractsRisk Management

I got curious about Euler v2 after hearing people talk about its "modular" approach. Here's what I found when I dug into how it actually works.

Why I Started Looking at Euler v2

I kept hearing people mention Euler v2 in conversations about lending protocols, usually something about it being "modular" or "more flexible" than Aave or Compound. But honestly, I had no idea what that actually meant.

The Euler v1 hack in 2023 was pretty brutal - $200M+ lost due to a donation attack vulnerability. So when they announced v2, I was curious: were they just patching things up, or doing something fundamentally different?

Turns out they basically threw out the v1 codebase and rebuilt everything from scratch with a completely different architecture.

The Big Picture: Modular Everything

The first thing that hit me is that Euler v2 isn't really one protocol - it's more like a toolkit for building lending markets. Instead of having one giant monolithic contract like most other protocols, they've broken everything down into separate modules.

Here's the basic structure:

  • Ethereum Vault Connector (EVC): The core infrastructure that handles all the plumbing and access control
  • Individual Vaults: Each asset gets its own isolated ERC-4626 compliant vault contract
  • Risk Managers: Separate contracts that handle liquidations and risk parameters
  • Governance Modules: For managing parameters and upgrades

What clicked for me is that each vault is basically its own mini lending protocol. You want to create a market for some random ERC-20? Just deploy a new vault. No need to go through governance or modify the core protocol.

One clever thing I found: the EVC lets you have up to 256 different "accounts" per Ethereum address. So you could have separate risk profiles for different strategies without needing multiple wallets.

How Vaults Actually Work

This is where it gets interesting. Each vault is essentially a standalone lending market for a single asset. So if you have a USDC vault, that vault only deals with USDC lending and borrowing.

But here's the twist: vaults can recognize collateral from other vaults. So you could deposit ETH in the ETH vault, then borrow USDC from the USDC vault using your ETH position as collateral. The vaults talk to each other through the EVK.

What this means in practice: Say I want to use WETH as collateral to borrow USDC:

  1. I deposit WETH into the WETH vault, get ERC-4626 shares representing my deposit
  2. I go to the USDC vault and say "I want to borrow USDC using my WETH shares as collateral"
  3. The USDC vault checks with the WETH vault through EVC to verify my collateral
  4. If everything checks out, I get my USDC loan

The cool part is that each vault can have completely different risk parameters, interest rate models, and even different liquidation mechanisms.

One interesting detail: instead of moving actual tokens around for cross-vault operations, everything works through shares. The EVC tracks all this automatically and prevents external manipulation of token balances. There's also this "multicall" feature that lets you do complex operations that might temporarily violate limits, as long as everything's healthy by the end of the transaction.

Interest Rate Models: Flexible by Design

One thing that stood out to me is how flexible their interest rate system is. Instead of hardcoding interest rate curves like most protocols do, Euler v2 lets each vault use whatever interest rate model it wants.

They've got some default models:

  • Standard model: Similar to what Aave uses, rates go up as utilization increases
  • Kinked model: Lower rates up to a certain utilization, then jumps up steeply
  • Custom models: Vaults can implement whatever crazy rate model they want

I found this interesting because it means different assets can have completely different rate behaviors. A stablecoin vault might use a gentle curve, while a volatile asset vault might have more aggressive rate changes.

Risk Management: The Liquidation Engine

The liquidation system is probably where Euler v2 gets most complex. Instead of having liquidators directly interact with vaults, they've created this separate "Risk Manager" layer.

Here's how I understand it works:

  1. Risk Managers monitor vault health and decide when positions need liquidating
  2. Liquidators bid on liquidation opportunities through the Risk Manager
  3. Batch Liquidations: Multiple positions can be liquidated together for efficiency

What's clever is that vault operators can choose different Risk Managers. So you could have:

  • A conservative Risk Manager that liquidates early
  • An aggressive one that waits longer but extracts more value
  • A specialized one for specific asset types

The liquidators don't need to understand each vault's specifics - they just bid through the Risk Manager interface.

There's also this operator delegation feature that's pretty neat. Vault operators can delegate specific management functions to other addresses, so you could have specialized operators handling different aspects of vault management without giving them full control.

The Governance Piece: Minimal but Effective

Unlike Aave or Compound where governance controls everything, Euler v2 governance is much more limited. The core EVK is basically immutable once deployed.

What governance can control:

  • Adding new Risk Managers to the whitelist
  • Emergency pause mechanisms
  • Some fee parameters

What it can't control:

  • Individual vault parameters (those are controlled by vault operators)
  • Interest rate models
  • Liquidation logic (handled by Risk Managers)

This approach means less governance overhead but also means vault operators have more responsibility for their own risk management.

Fee Structure: Everyone Gets a Cut

The fee model is pretty straightforward but has some interesting dynamics:

Interest Rate Spread: Like most lending protocols, borrowers pay more than lenders receive. The spread goes to:

  • Vault operators (for managing the vault)
  • Protocol fees (to Euler DAO)
  • Risk Manager fees (for liquidation services)

Liquidation Fees: When liquidations happen, fees get split between:

  • Liquidators (for doing the actual liquidation)
  • Risk Managers (for coordinating)
  • Protocol treasury

What I found interesting is that vault operators can set their own fee rates (within limits). So there's actual competition between vaults for the same asset.

Cross-Collateral: The Magic Sauce

The cross-collateral system is probably the most complex part of Euler v2. Here's how I understand it works:

Each vault maintains a list of "collateral vaults" it recognizes. When you want to borrow from Vault A using collateral from Vault B:

  1. Vault A checks if it recognizes Vault B as valid collateral
  2. It queries Vault B for your collateral value
  3. It applies its own risk parameters (LTV ratios, liquidation thresholds)
  4. If you meet the requirements, you get your loan

The tricky part is that each vault can have different opinions about the same collateral. USDC Vault might accept ETH at 80% LTV, while DAI Vault only accepts it at 70% LTV.

This creates some interesting dynamics where the same collateral position might be safe in one vault but risky in another.

Oracle Integration: Flexible but Risky

Euler v2 doesn't dictate which oracles vaults should use. Each vault operator chooses their own price feeds. This is both powerful and dangerous.

Powerful because:

  • Vaults can use specialized oracles for niche assets
  • No dependency on a single oracle provider
  • Can use oracle aggregators or custom price models
  • Supports bid/ask price quotes for more sophisticated pricing

Dangerous because:

  • Oracle failures only affect individual vaults, not the whole protocol
  • But bad oracle choices can lead to vault-specific exploits
  • Risk Managers need to understand oracle risks for each vault they monitor

One cool feature I noticed: the oracle system can provide different prices based on transaction amounts. So a large liquidation might get a different price than a small trade, which helps with slippage management.

There's also this risk-adjusted collateral value calculation that goes beyond just applying LTV ratios. The system can dynamically adjust collateral values based on various risk factors.

How This Compares to Euler v1

The difference between v1 and v2 is night and day:

Euler v1:

  • Single monolithic protocol like Aave/Compound
  • All assets in shared pools with cross-collateralization
  • Complex risk-adjusted interest rates
  • Vulnerable to systemic attacks (as the hack proved)

Euler v2:

  • Modular architecture with isolated vaults
  • Each asset gets its own ERC-4626 compliant contract
  • Flexible risk management through separate Risk Managers
  • Risk isolation prevents single points of failure
  • Strict access control through EVC
  • "Socialization" mechanism for handling bad debt without affecting other vaults

The v1 hack happened because all assets were interconnected in complex ways. In v2, if one vault gets exploited, it doesn't automatically drain the entire protocol. There's also this interesting "socialization" feature where if a vault can't cover bad debt, the loss gets distributed among that vault's lenders rather than affecting the whole system.

Another security improvement: the EVC has strict access controls that prevent unauthorized operations, and there's autonomous balance tracking that makes it much harder for external contracts to manipulate vault states.

What Makes This Different from Other Major Protocols

After digging into this, here's how I see the current landscape:

Aave: The Established Giant ($37B TVL)

  • Architecture: V3 with shared pools, V4 coming mid-2025 with unified liquidity hub and "spokes" model
  • Governance: Heavy governance for V3, V4 will allow developers to create custom "spokes" with credit access
  • Risk: Conservative, battle-tested, enhanced security coming in V4
  • Best for: Blue-chip assets, institutional users, those wanting proven stability

Compound v3 (Comet): The Single-Asset Specialist

  • Architecture: Single base asset borrowing (mainly USDC), multi-chain deployment
  • Governance: Token-based governance, focus on risk parameter optimization
  • Risk: Simplified risk model with single borrowing asset, advanced account management
  • Best for: Users who want to borrow stablecoins against crypto collateral with lower liquidation risk

Morpho v2: The Intent-Based Platform ($6B TVL)

  • Architecture: Intent-based lending with fixed-rate/fixed-term loans, cross-chain functionality, P2P matching
  • Governance: Institutional-focused with customizable loan terms and KYC/compliance features
  • Risk: Sophisticated risk management with portfolio collateral support and multiple oracle systems
  • Best for: Institutional users, fixed-rate borrowing, cross-chain liquidity, bespoke loan terms

Euler v2: The Modular Experiment

  • Architecture: Permissionless vault deployment with flexible risk management through separate Risk Managers
  • Governance: Minimal central control, vault operators control their own risk parameters
  • Risk: High flexibility but complexity, risk isolation between vaults
  • Best for: Long-tail assets, sophisticated vault operators, custom risk management strategies

The current competitive landscape shows different approaches:

  • Aave: Betting on unified liquidity and developer ecosystems (V4 spokes)
  • Compound: Focusing on single-asset simplicity and advanced account features
  • Morpho: Targeting institutional users with TradFi-like fixed-rate products
  • Euler v2: Enabling maximum customization for sophisticated operators

Key tradeoffs:

  • User Experience vs Flexibility: Compound offers simplicity, Euler v2 offers maximum customization
  • Institutional vs Retail: Morpho v2 targets institutions, others focus more on retail DeFi users
  • Innovation Speed: Euler v2's permissionless vaults vs Aave's governance-controlled development
  • Risk Approach: Isolated risks (Euler v2) vs shared liquidity benefits (Aave V4)

My Take: Interesting but Complex

After spending time understanding Euler v2, I'm impressed by the architectural thinking but also slightly overwhelmed by the complexity.

What I like:

  • The modular approach makes sense for a mature DeFi ecosystem
  • Permissionless vault creation could enable a lot of innovation
  • Risk isolation means one bad vault doesn't take down everything

What worries me:

  • The complexity creates more attack surfaces
  • Cross-vault dependencies could create systemic risks
  • Vault operators need to be pretty sophisticated to manage risk properly

Who this is for:

  • Sophisticated vault operators who want maximum flexibility
  • Protocols that need lending for niche assets
  • Users who want access to long-tail assets with proper risk management

It feels like Euler v2 is betting that DeFi is mature enough to handle this level of complexity in exchange for much more flexibility. Whether that bet pays off will depend on how well vault operators and Risk Managers actually perform in practice.

The architecture is definitely clever, but I'd want to see it battle-tested with real volume and market stress before fully trusting it with serious money.


This was my attempt to understand Euler v2 from the outside. If I got anything wrong or missed important details, let me know - this stuff is complex and I'm still wrapping my head around some of the cross-vault dynamics.