# Table of Contents - [Home | Euler Docs](#home-euler-docs) - [Concepts | Euler Docs](#concepts-euler-docs) - [Search the documentation](#search-the-documentation) - [Fee Flow | Euler Docs](#fee-flow-euler-docs) - [Sub-accounts | Euler Docs](#sub-accounts-euler-docs) - [Reward Streams | Euler Docs](#reward-streams-euler-docs) - [Ethereum Vault Connector (EVC) | Euler Docs](#ethereum-vault-connector-evc-euler-docs) - [Vaults | Euler Docs](#vaults-euler-docs) - [Swaps | Euler Docs](#swaps-euler-docs) - [Price Oracles | Euler Docs](#price-oracles-euler-docs) - [Markets | Euler Docs](#markets-euler-docs) - [Unit of Account | Euler Docs](#unit-of-account-euler-docs) - [EulerSwap | Euler Docs](#eulerswap-euler-docs) - [Operators | Euler Docs](#operators-euler-docs) - [Hooks | Euler Docs](#hooks-euler-docs) - [Annual Percentage Yield | Euler Docs](#annual-percentage-yield-euler-docs) - [Governance Contracts | Euler Docs](#governance-contracts-euler-docs) - [Interest Rate Models | Euler Docs](#interest-rate-models-euler-docs) - [Deploy An Oracle Router | Euler Docs](#deploy-an-oracle-router-euler-docs) - [Attack Vectors | Euler Docs](#attack-vectors-euler-docs) - [Advanced Features | Euler Docs](#advanced-features-euler-docs) - [Configure asymmetric concentration | Euler Docs](#configure-asymmetric-concentration-euler-docs) - [Set Fees | Euler Docs](#set-fees-euler-docs) - [Set LTV | Euler Docs](#set-ltv-euler-docs) - [Interface Guide | Euler Docs](#interface-guide-euler-docs) - [Set Equilibrium Price | Euler Docs](#set-equilibrium-price-euler-docs) - [Operational Considerations | Euler Docs](#operational-considerations-euler-docs) - [Select Vault Pairs | Euler Docs](#select-vault-pairs-euler-docs) - [Monitoring & Maintenance | Euler Docs](#monitoring-maintenance-euler-docs) - [Overview | Euler Docs](#overview-euler-docs) - [Q&A Highlights | Euler Docs](#q-a-highlights-euler-docs) - [Technical Specifications | Euler Docs](#technical-specifications-euler-docs) - [Deployment & Management | Euler Docs](#deployment-management-euler-docs) - [Use Case | Euler Docs](#use-case-euler-docs) - [Introduction | Euler Docs](#introduction-euler-docs) - [Introduction | Euler Docs](#introduction-euler-docs) - [Overview | Euler Docs](#overview-euler-docs) - [Overview | Euler Docs](#overview-euler-docs) - [Contract Addresses | Euler Docs](#contract-addresses-euler-docs) - [Deployment and Management | Euler Docs](#deployment-and-management-euler-docs) - [Objective Labs Edge UI Guide | Euler Docs](#objective-labs-edge-ui-guide-euler-docs) - [Introduction | Euler Docs](#introduction-euler-docs) - [Interest Rates | Euler Docs](#interest-rates-euler-docs) - [Risk Curators | Euler Docs](#risk-curators-euler-docs) - [Labeling | Euler Docs](#labeling-euler-docs) - [Rewards | Euler Docs](#rewards-euler-docs) - [Strategy Profitability | Euler Docs](#strategy-profitability-euler-docs) - [Return on Equity | Euler Docs](#return-on-equity-euler-docs) - [Liquidations | Euler Docs](#liquidations-euler-docs) - [Lens Contracts | Euler Docs](#lens-contracts-euler-docs) - [Creator UI Guide | Euler Docs](#creator-ui-guide-euler-docs) - [euler-vault-scripts Guide | Euler Docs](#euler-vault-scripts-guide-euler-docs) - [Querying Off-Chain Prices | Euler Docs](#querying-off-chain-prices-euler-docs) - [Developer Guide | Euler Docs](#developer-guide-euler-docs) - [Getting Lists of Verified Vaults | Euler Docs](#getting-lists-of-verified-vaults-euler-docs) - [Vault Types | Euler Docs](#vault-types-euler-docs) - [Working with Pyth Oracles | Euler Docs](#working-with-pyth-oracles-euler-docs) - [Subgraphs | Euler Docs](#subgraphs-euler-docs) - [Using Lens Contracts | Euler Docs](#using-lens-contracts-euler-docs) - [Euler Docs](#euler-docs) - [Euler Docs](#euler-docs) - [Euler Docs](#euler-docs) - [Allocator & Manager Handbook | Euler Docs](#allocator-manager-handbook-euler-docs) - [Comparison with Traditional AMMs | Euler Docs](#comparison-with-traditional-amms-euler-docs) - [Borrow | Euler Docs](#borrow-euler-docs) - [EulerSwap | Euler Docs](#eulerswap-euler-docs) --- # Home | Euler Docs [Skip to main content](https://docs.euler.finance/#__docusaurus_skipToContent_fallback) On this page Euler is a flexible platform for decentralized lending and borrowing, designed to adapt and grow with the evolving world of DeFi. For Everyday Users ------------------ Euler makes lending and borrowing simpler, more efficient, and more versatile, while giving users the freedom to explore new opportunities in DeFi. For Builders ------------ Behind the scenes, Euler's modular design and institutional-grade security empower builders to create and manage custom lending markets in a fully permissionless way, tailored precisely to their needs. For more details, read the [Introduction](https://docs.euler.finance/introduction) , dive into the [Lite Paper](https://docs.euler.finance/lite-paper) , or join the community [Discord server](https://discord.com/invite/pTTnr7b4mT) . Please don't hesitate to ask if you cannot find what you are looking for here. * [For Everyday Users](https://docs.euler.finance/#for-everyday-users) * [For Builders](https://docs.euler.finance/#for-builders) --- # Concepts | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/#__docusaurus_skipToContent_fallback) On this page Welcome to the concepts section of Euler documentation. Here you'll find detailed explanations of the core components, mechanics, and design principles that power the protocol. Whether you're new to Euler or looking to deepen your understanding, these guides will help you grasp how everything works together. Core Components --------------- * [**Ethereum Vault Connector (EVC)**](https://docs.euler.finance/concepts/core/evc) : The central nervous system that coordinates all protocol interactions * [**Vaults**](https://docs.euler.finance/concepts/core/vaults) : The building blocks of Euler's lending infrastructure * [**Markets**](https://docs.euler.finance/concepts/core/markets) : Understanding how lending markets function in Euler * [**Price Oracles**](https://docs.euler.finance/concepts/core/price-oracles) : How Euler ensures accurate asset pricing Financial Concepts ------------------ * [**Interest Rates**](https://docs.euler.finance/concepts/financial/interest-rates) : How borrowing and lending rates are determined * [**Annual Percentage Yield**](https://docs.euler.finance/concepts/financial/annual-percentage-yield) : Understanding your returns * [**Return on Equity (ROE)**](https://docs.euler.finance/concepts/financial/return-on-equity) : Measuring strategy performance * [**Strategy Profitability**](https://docs.euler.finance/concepts/financial/strategy-profitability) : Evaluating different approaches * [**Rewards**](https://docs.euler.finance/concepts/financial/rewards) : Understanding protocol incentives Risk Management --------------- * [**Vault Types**](https://docs.euler.finance/concepts/risk/vault-types) : Understanding the different types of vaults and their risk profiles * [**Liquidations**](https://docs.euler.finance/concepts/risk/liquidations) : How and why positions get liquidated * [**Risk Curators**](https://docs.euler.finance/concepts/risk/risk-curators) : The role of risk management in Euler Advanced Features ----------------- * [**Hooks**](https://docs.euler.finance/concepts/advanced/hooks) : Customizing and controlling vault operations * [**Operators**](https://docs.euler.finance/concepts/advanced/operators) : Delegating control to external contracts * [**Sub-accounts**](https://docs.euler.finance/concepts/advanced/sub-accounts) : Managing multiple isolated positions * [**Unit of Account**](https://docs.euler.finance/concepts/advanced/unit-of-account) : How Euler measures and tracks positions * [Core Components](https://docs.euler.finance/concepts/#core-components) * [Financial Concepts](https://docs.euler.finance/concepts/#financial-concepts) * [Risk Management](https://docs.euler.finance/concepts/#risk-management) * [Advanced Features](https://docs.euler.finance/concepts/#advanced-features) --- # Search the documentation [Skip to main content](https://docs.euler.finance/search/#__docusaurus_skipToContent_fallback) Search the documentation ======================== --- # Fee Flow | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/advanced/fee-flow/#__docusaurus_skipToContent_fallback) On this page Introduction ------------ **Fee Flow** is a powerful open-source module that enables the auctioning of protocol fees for EUL tokens (or other). These auctions convert protocol-generated fees (e.g., in USDC, DAI, or other assets in form of the vault shares) into EUL, which flows back to the Euler DAO treasury. The DAO can then decide, via governance, how to use these funds (e.g., burn, distribute, or allocate for growth). How Fee Flow Works ------------------ ### Fee Collection[​](https://docs.euler.finance/concepts/advanced/fee-flow/#fee-collection "Direct link to Fee Collection") * Protocol fees accumulate in the protocol from the interest fees * These fees can be in any asset (eUSDC, eDAI, eWETH, etc.) * Each vault has a function that allows anyone to transfer accrued fees to the FeeFlowController contract * The transfer of fees is typically done just-in-time during the auction settlement to optimize gas costs ### Auction Process[​](https://docs.euler.finance/concepts/advanced/fee-flow/#auction-process "Direct link to Auction Process") Fee Flow employs a reverse Dutch auction mechanism with the following characteristics: 1. **Epoch-based System** * Auctions occur in discrete epochs * Each epoch has a defined period (epochPeriod) * The auction price starts high and decreases linearly over time 2. **Price Dynamics** * Initial price (initPrice) is set at priceMultiplier times the previous epoch's settlement price * Price decreases linearly over the epochPeriod, tending towards zero * Example: With priceMultiplier=2 and epochPeriod=100 days, the auction starts at twice the previous settlement price 3. **Settlement Conditions** * The auction settles when the current price becomes lower than the aggregate value of accrued fees * The first bidder to pay the current auction price can claim all assets in the FeeFlowController * Bidders typically monitor fee values off-chain and transfer them just-in-time during settlement 4. **Asset Management** * Some assets may remain in their respective markets if they're not worth the gas cost to transfer * These assets can be included in future auctions * The system is designed to be MEV-resistant and efficient ### Example[​](https://docs.euler.finance/concepts/advanced/fee-flow/#example "Direct link to Example") If the protocol collects $10,000 in eUSDC fees, these are auctioned off. Bidders compete by offering EUL tokens. The winning bidders receive the eUSDC, and the EUL they pay is sent to the DAO treasury. For more detailed information about the implementation and technical specifications, please refer to the [Fee Flow repository](https://github.com/euler-xyz/fee-flow) . * [Introduction](https://docs.euler.finance/concepts/advanced/fee-flow/#introduction) * [How Fee Flow Works](https://docs.euler.finance/concepts/advanced/fee-flow/#how-fee-flow-works) * [Fee Collection](https://docs.euler.finance/concepts/advanced/fee-flow/#fee-collection) * [Auction Process](https://docs.euler.finance/concepts/advanced/fee-flow/#auction-process) * [Example](https://docs.euler.finance/concepts/advanced/fee-flow/#example) --- # Sub-accounts | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/advanced/sub-accounts/#__docusaurus_skipToContent_fallback) On this page Introduction ------------ **Sub-accounts** are a powerful feature in Euler that allows users to create multiple isolated positions within a single wallet address. This innovative approach to account management provides users with the flexibility to manage different strategies and risk profiles while maintaining the convenience of using a single wallet. Understanding Sub-accounts -------------------------- While each wallet address on Euler is limited to one outstanding liability at any given time, the Ethereum Vault Connector (EVC) provides each wallet with 256 virtual account addresses known as sub-accounts. These virtual addresses enable users to establish multiple risk-isolated positions in a gas-efficient manner across segregated accounts. The sub-account system solves a significant usability challenge in DeFi. Without sub-accounts, users would need to create and manage multiple wallet addresses to achieve the same level of position isolation. This would require: * Maintaining ETH balances in each address for gas fees * Setting up token approvals for each address * Managing multiple wallet connections in the user interface * Handling the operational complexity of switching between addresses Benefits of Sub-accounts ------------------------ **Risk Management**: Sub-accounts allow users to isolate different trading strategies or positions, preventing one position's risk from affecting others. **Gas Efficiency**: By using sub-accounts instead of multiple wallet addresses, users can save significant gas costs. There's no need to transfer ETH between addresses or set up multiple approvals. **Operational Simplicity**: Users can manage all their positions through a single wallet interface, making it easier to track and manage their overall portfolio. **Flexible Position Management**: Sub-accounts enable users to easily rebalance collateral and liabilities between positions without requiring additional approvals or complex transactions. Important Considerations ------------------------ **Internal Addresses**: It's crucial to understand that sub-account addresses are internal to the EVC and compatible vaults. These addresses should never be used for regular ERC20 token transfers or other external contract interactions. **Position Isolation**: While sub-accounts provide position isolation, users should still be mindful of their overall risk exposure across all sub-accounts, as they are all ultimately controlled by the same wallet. **Gas Optimization**: When using multiple sub-accounts, consider the gas implications of operations that affect multiple positions. The EVC's batching functionality can help optimize gas costs for such operations. * [Introduction](https://docs.euler.finance/concepts/advanced/sub-accounts/#introduction) * [Understanding Sub-accounts](https://docs.euler.finance/concepts/advanced/sub-accounts/#understanding-sub-accounts) * [Benefits of Sub-accounts](https://docs.euler.finance/concepts/advanced/sub-accounts/#benefits-of-sub-accounts) * [Important Considerations](https://docs.euler.finance/concepts/advanced/sub-accounts/#important-considerations) --- # Reward Streams | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/advanced/reward-streams/#__docusaurus_skipToContent_fallback) On this page Introduction ------------ **Reward Streams** is an innovative open-source module that enables projects to seamlessly stream rewards to users of new markets in a permissionless manner. This module implements the billion-dollar algorithm, allowing for the simultaneous distribution of multiple reward tokens. Key Features ------------ ### Permissionless Distribution[​](https://docs.euler.finance/concepts/advanced/reward-streams/#permissionless-distribution "Direct link to Permissionless Distribution") Unlike traditional staking mechanisms that require users to lock their assets in separate contracts, Reward Streams allows users to subscribe to their preferred rewards while maintaining full control of their positions. This means you can earn rewards while simultaneously taking out loans, creating a more dynamic and efficient way to participate in the protocol. ### Multiple Reward Tokens[​](https://docs.euler.finance/concepts/advanced/reward-streams/#multiple-reward-tokens "Direct link to Multiple Reward Tokens") The module supports the distribution of multiple reward tokens simultaneously, providing flexibility for projects to incentivize different types of participation or target specific user behaviors. ### No Asset Locking[​](https://docs.euler.finance/concepts/advanced/reward-streams/#no-asset-locking "Direct link to No Asset Locking") Users can earn rewards without transferring their vault shares to a staking smart contract. This unique feature allows suppliers to earn rewards while concurrently taking out loans, presenting a dynamic and efficient approach to incentivizing and engaging users. Implementation -------------- The Reward Streams module is implemented as a smart contract that: * Tracks user deposits in vaults * Manages reward token distribution * Handles reward claims For more detailed information about the implementation and technical specifications, please refer to the [Reward Streams repository](https://github.com/euler-xyz/reward-streams) . * [Introduction](https://docs.euler.finance/concepts/advanced/reward-streams/#introduction) * [Key Features](https://docs.euler.finance/concepts/advanced/reward-streams/#key-features) * [Permissionless Distribution](https://docs.euler.finance/concepts/advanced/reward-streams/#permissionless-distribution) * [Multiple Reward Tokens](https://docs.euler.finance/concepts/advanced/reward-streams/#multiple-reward-tokens) * [No Asset Locking](https://docs.euler.finance/concepts/advanced/reward-streams/#no-asset-locking) * [Implementation](https://docs.euler.finance/concepts/advanced/reward-streams/#implementation) --- # Ethereum Vault Connector (EVC) | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/core/evc/#__docusaurus_skipToContent_fallback) On this page The **Ethereum Vault Connector (EVC)** is a foundational layer designed to facilitate core lending market functionality. It serves as a base building block for various protocols, providing a robust and flexible framework for developers to build upon. The EVC primarily mediates between vaults - contracts that implement the [ERC-4626](https://eips.ethereum.org/EIPS/eip-4626) interface and contain additional logic for interfacing with other vaults. Core Functionality ------------------ ### Vault Mediation[​](https://docs.euler.finance/concepts/core/evc/#vault-mediation "Direct link to Vault Mediation") The EVC's primary role is to mediate between different vaults in the protocol. When a user wishes to borrow, they must link their accounts and collateral vaults to the borrowed-from vault via the EVC. The liability vault, also known as the "controller", is then consulted whenever a user wants to perform an action that could impact account solvency, such as withdrawing collateral. The EVC is responsible for calling the controller, which determines whether the action is allowed or if it should be blocked to prevent account insolvency. This mediation ensures that all operations maintain the protocol's safety parameters while enabling complex cross-vault interactions. ### Account Management[​](https://docs.euler.finance/concepts/core/evc/#account-management "Direct link to Account Management") The EVC maintains a user's voluntary associations with vaults through several key mechanisms: 1. **Collateral Management**: Users deposit funds into collateral vaults and call `enableCollateral` for each vault they intend to use as collateral. This adds the vault to the account's collateral set. 2. **Controller Association**: When a user wants to borrow from a vault, they must call `enableController` to add this vault to their controller set. This is a significant action as it submits the account to the rules encoded in the controller vault's code. 3. **Collateral Control**: Once a controller is enabled, it can prevent withdrawals or disabling of collateral if such actions would violate the account's solvency requirements. The controller can also seize collateral to repay debt using the `controlCollateral` function. Advanced Features ----------------- ### Batching[​](https://docs.euler.finance/concepts/core/evc/#batching "Direct link to Batching") The EVC enables multiple operations affecting multiple vaults and external smart contracts to be performed within a single batch operation. This provides several benefits: * More convenient for UI users * More gas efficient * Allows deferring liquidity checks until the end of the batch ### Sub-accounts[​](https://docs.euler.finance/concepts/core/evc/#sub-accounts "Direct link to Sub-accounts") The EVC introduces sub-accounts, allowing users to create multiple isolated positions within their single owner account. This feature enables: * Easy rebalancing of collateral/liabilities between positions * No need for additional approvals * No special logic required from vaults ### Operators[​](https://docs.euler.finance/concepts/core/evc/#operators "Direct link to Operators") Users can attach external contracts to act on behalf of a sub-account. This generalizes the token approval system and enables powerful functionality: * Intents support * Stop-loss/take-profit/trailing-stop modifiers * Layered position managers ### Gasless Transactions[​](https://docs.euler.finance/concepts/core/evc/#gasless-transactions "Direct link to Gasless Transactions") The EVC supports meta-transactions out of the box for both EOAs and contract wallets, enabling gasless transaction capabilities. Security Features ----------------- ### Lockdown Mode[​](https://docs.euler.finance/concepts/core/evc/#lockdown-mode "Direct link to Lockdown Mode") The EVC introduces a `LOCKDOWN MODE` that can be activated by the owner for all their accounts simultaneously. In this mode: * Owner is restricted to managing operators and nonces * Operators are restricted to revoking their own permissions * Calling external smart contracts is prohibited * Controllers can still control collaterals for the accounts ### Permit Disabled Mode[​](https://docs.euler.finance/concepts/core/evc/#permit-disabled-mode "Direct link to Permit Disabled Mode") The `PERMIT DISABLED MODE` can be activated by the owner to prevent execution of permits signed by the owner. This is particularly useful in emergency situations where harmful permit messages have been signed. ### Authentication and Authorization[​](https://docs.euler.finance/concepts/core/evc/#authentication-and-authorization "Direct link to Authentication and Authorization") Vaults outsource their authentication to the EVC but handle authorization themselves. When a vault is invoked via the EVC's `call`, `batch`, or `controlCollateral` functions: * The vault sees the EVC as the `msg.sender` * The vault should call back into the EVC to retrieve the current execution context * The vault receives the `onBehalfOfAccount` and `controllerEnabled` status For more detailed information about the implementation and technical specifications, please refer to the [Ethereum Vault Connector repository](https://github.com/euler-xyz/ethereum-vault-connector) . * [Core Functionality](https://docs.euler.finance/concepts/core/evc/#core-functionality) * [Vault Mediation](https://docs.euler.finance/concepts/core/evc/#vault-mediation) * [Account Management](https://docs.euler.finance/concepts/core/evc/#account-management) * [Advanced Features](https://docs.euler.finance/concepts/core/evc/#advanced-features) * [Batching](https://docs.euler.finance/concepts/core/evc/#batching) * [Sub-accounts](https://docs.euler.finance/concepts/core/evc/#sub-accounts) * [Operators](https://docs.euler.finance/concepts/core/evc/#operators) * [Gasless Transactions](https://docs.euler.finance/concepts/core/evc/#gasless-transactions) * [Security Features](https://docs.euler.finance/concepts/core/evc/#security-features) * [Lockdown Mode](https://docs.euler.finance/concepts/core/evc/#lockdown-mode) * [Permit Disabled Mode](https://docs.euler.finance/concepts/core/evc/#permit-disabled-mode) * [Authentication and Authorization](https://docs.euler.finance/concepts/core/evc/#authentication-and-authorization) --- # Vaults | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/core/vaults/#__docusaurus_skipToContent_fallback) On this page Vaults are the fundamental building blocks of the Euler protocol, serving as the primitive unit for all lending and borrowing activities. In Euler, there are two main types of vaults: **Euler Vault Kit (EVK)** vaults and **Euler Earn** vaults, each serving distinct purposes while sharing common underlying principles. EVK Vaults ---------- **EVK (Euler Vault Kit)** vaults are extended [ERC-4626](https://eips.ethereum.org/EIPS/eip-4626) vaults that function as passive lending pools. Unlike standard ERC-4626 vaults that generate yield through active investment strategies, EVK vaults earn yield by lending assets to borrowers. These vaults accept ERC-20 token deposits and enable users to borrow against their collateral. note While vaults can be interacted with directly, the recommended approach is to use the [**Ethereum Vault Connector (EVC)**](https://docs.euler.finance/concepts/core/evc) as the primary entry point. The EVC provides batching, sub-accounts, simulations, and other advanced features that make interactions more efficient and flexible. The architecture of an EVK vault consists of several key components working together: * **Underlying Asset**: The ERC-20 token held by the vault, with each vault holding exactly one type of asset * **EVault**: The primary entry point contract implementing common vault logic: * Tracks deposits and borrows * Validates position health * Permits liquidations * Uses static modules for code organization * **Price Oracle**: Interfaces with external pricing systems to compute real-time values of collaterals and liabilities * **IRM (Interest Rate Model)**: Determines borrowing rates to incentivize or discourage borrowing based on market conditions * **ProtocolConfig**: Global protocol-level configuration controlling fee destinations and splits * **DToken**: A read-only ERC-20 interface for debt amounts, making debt modifications visible in block explorers and trackable by tax-accounting software ### Governance and Risk Management[​](https://docs.euler.finance/concepts/core/vaults/#governance-and-risk-management "Direct link to Governance and Risk Management") EVK vaults can be either governed or finalized (ungoverned), offering different approaches to risk management: Governed vaults are actively managed by a governor or risk curator who can adjust parameters like accepted collateral, borrowing limits, and pricing models as market conditions evolve. This approach provides a more passive lending experience but requires trust in the curator's risk management capabilities. Ungoverned vaults have governance permanently revoked, maintaining fixed parameters regardless of changing risk conditions. These vaults appeal to users who prefer self-managed risk without reliance on third parties. Market forces ultimately determine which vault configurations attract liquidity and remain viable. Earn Vaults ----------- Earn vaults are designed for passive yield seekers who want exposure to the Euler ecosystem without managing individual lending and borrowing positions. Built on the ERC-4626 standard, these vaults act as yield aggregators, deploying user deposits across multiple strategies selected and managed by risk curators. Risk curators play a crucial role in Earn vaults, responsible for rebalancing strategies, managing liquidity, and assessing risk profiles. This structure allows users to benefit from Euler's sophisticated lending infrastructure while delegating the technical complexities of yield optimization to professional risk managers. ### Key Features[​](https://docs.euler.finance/concepts/core/vaults/#key-features "Direct link to Key Features") Earn vaults offer several advantages for passive yield seekers. They provide simplicity through a single deposit interface, diversification across multiple yield-generating strategies, and non-custodial security where risk curators can rebalance allocations but cannot withdraw user funds. The continuous rebalancing of funds across the DeFi ecosystem ensures capital efficiency and optimal yield generation. Vault Composition ----------------- One of the most powerful aspects of Euler's vault system is the ability to compose vaults together. By linking EVK vaults as collateral for one another, creators can design various forms of markets. These can range from simple isolated collateral-debt pairs to complex, feature-rich, cross-collateralized clusters. Risk curators and asset managers can then layer Earn vaults on top of EVK vaults to generate risk-managed yield for passive yield-seekers. This composability enables the creation of sophisticated financial products while maintaining the security and efficiency of the underlying protocol. For more detailed information about the implementation and technical specifications, please refer to the [Euler Vault Kit repository](https://github.com/euler-xyz/euler-vault-kit) . * [EVK Vaults](https://docs.euler.finance/concepts/core/vaults/#evk-vaults) * [Governance and Risk Management](https://docs.euler.finance/concepts/core/vaults/#governance-and-risk-management) * [Earn Vaults](https://docs.euler.finance/concepts/core/vaults/#earn-vaults) * [Key Features](https://docs.euler.finance/concepts/core/vaults/#key-features) * [Vault Composition](https://docs.euler.finance/concepts/core/vaults/#vault-composition) --- # Swaps | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/advanced/swaps/#__docusaurus_skipToContent_fallback) On this page **Swaps** are a cornerstone of advanced position management in Euler. They enable users to move seamlessly between assets, manage leverage, rebalance portfolios, and automate complex strategies—all within the protocol's modular, composable architecture. Understanding swaps is key to unlocking the full power of Euler's advanced features, especially when combined with concepts like sub-accounts, hooks, and operators. Modularity and Trust Boundaries ------------------------------- Euler's architecture is built for flexibility and security. Core protocol logic is kept minimal and immutable, while advanced features like swaps are handled by periphery contracts. This separation allows for rapid innovation and integration with new DeFi primitives, without compromising the protocol's safety. * **Swapper** is intentionally untrusted: it can be replaced, customized, or even bypassed. It simply executes swaps as instructed, with no protocol-level assumptions about its behavior. * **SwapVerifier** is trusted and audited: it enforces the outcome of swaps, ensuring that slippage and price impact limits are respected. Only after verification are assets deposited or debts repaid. Why Swapper is Untrusted ------------------------ The Swapper contract is a black box from the protocol's perspective. Anyone can interact with it, and it has no access control. This means: * Users are free to use any swapper implementation, including their own. * The protocol does not rely on the Swapper for security—only on the SwapVerifier. * All critical checks (amounts received, debts repaid) are enforced by SwapVerifier, which must always follow Swapper in an EVC batch. Composing Swaps in EVC Batches ------------------------------ Swaps are most powerful when composed with other actions in an EVC batch. This enables atomic, gas-efficient workflows such as: * Borrow → Swap → Deposit (open leverage) * Withdraw → Swap → Repay (close/rebalance) * [Modularity and Trust Boundaries](https://docs.euler.finance/concepts/advanced/swaps/#modularity-and-trust-boundaries) * [Why Swapper is Untrusted](https://docs.euler.finance/concepts/advanced/swaps/#why-swapper-is-untrusted) * [Composing Swaps in EVC Batches](https://docs.euler.finance/concepts/advanced/swaps/#composing-swaps-in-evc-batches) --- # Price Oracles | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/core/price-oracles/#__docusaurus_skipToContent_fallback) On this page Introduction ------------ Price oracles are fundamental to Euler's lending protocol, providing the real-time price data needed to ensure borrowers remain over-collateralized and the system maintains its stability. These oracles are crucial for determining collateralization levels, triggering liquidations, and maintaining overall system health. Euler's oracle-agnostic and modular design allows seamless integration with any type of external price feed, giving vault creators and risk curators maximum flexibility in asset and risk management. Core Components --------------- ### IPriceOracle Interface[​](https://docs.euler.finance/concepts/core/price-oracles/#ipriceoracle-interface "Direct link to IPriceOracle Interface") At the heart of Euler's price oracle system is the `IPriceOracle` interface, which serves as the foundation for standardized price queries. This interface is the reference implementation for the "Common Quote Oracle" outlined in [ERC-7726](https://eips.ethereum.org/EIPS/eip-7726) , an Ethereum Improvement Proposal that defines a standard API for data feeds providing the relative value of assets. The interface provides three key functions: interface IPriceOracle { function name() external view returns (string memory); function getQuote( uint256 inAmount, address base, address quote ) external view returns (uint256 outAmount); function getQuotes( uint256 inAmount, address base, address quote ) external view returns (uint256 bidOutAmount, uint256 askOutAmount);} ### Adapters and Routers[​](https://docs.euler.finance/concepts/core/price-oracles/#adapters-and-routers "Direct link to Adapters and Routers") The system uses two main types of components to interact with price feeds: * **Adapters** are immutable and ungoverned smart contracts that implement the `IPriceOracle` interface. They serve as the atomic building blocks of the system, interfacing with external oracles and converting their data into a standardized format. Currently, Euler supports adapters for various vendors including Chainlink, Chronicle, Pyth, RedStone, Lido, Uniswap V3, and Balancer Rate Provider. * **Routers** are smart contracts that also implement the `IPriceOracle` interface but serve as configurable dispatchers for price queries. They can be governed to change which providers are queried, though they can be made immutable by transferring governance to `address(0)`. This flexible design allows the system to dynamically integrate various pricing sources, adapting to different assets and market conditions. Pricing Mechanisms ------------------ Price oracles can be categorized into different classes based on how they determine asset prices: * **Market oracles** use trading activity and liquidity from both decentralized and centralized exchanges to determine asset prices. They typically aggregate prices from multiple sources to provide real-time valuations, offering more accurate market-based pricing but potentially being more sensitive to short-term price fluctuations. * **Fundamental oracles** price assets based on intrinsic factors rather than market trading. These often use fixed prices, such as hard-coding the value of a stablecoin to 1 USD or using protocol-defined rates. While they can protect borrowers from temporary price fluctuations, they may not always reflect true market value during sustained price movements. * **Exchange rate oracles** establish prices based on built-in exchange rates between derivative assets and their underlying, using redemption values and protocol-defined calculations. These are particularly useful for assets that have a direct relationship with their underlying value. Oracle Types and Trade-offs --------------------------- Choosing an appropriate pricing mechanism for a credit vault is the responsibility of vault creators and risk curators. There is no single "best" way to price an asset in a lending protocol—each approach has trade-offs that shift risk between lenders and borrowers. For example, a fundamental price oracle that fixes an asset's price at 1 USD can protect borrowers from liquidation due to temporary price fluctuations in secondary markets, but may expose lenders to bad debt during sustained price movements. Conversely, a market-based oracle offers more accurate valuations but may be vulnerable to price manipulation or trigger unnecessary liquidations due to short-term price swings. Vendor-Agnostic Adapter System ------------------------------ Euler is vendor-agnostic, supporting adapters for Chainlink, Chronicle, Pyth, RedStone, Lido, Uniswap V3, and Balancer Rate Provider. Developers can integrate additional oracle sources by implementing new adapters that conform to the `IPriceOracle` interface. Standardized Pricing Interface ------------------------------ Euler's `IPriceOracle` is the reference implementation for the "Common Quote Oracle" outlined in ERC-7726, an Ethereum Improvement Proposal that defines a standard API for data feeds providing the relative value of assets. Price Quoting System -------------------- ### Currency Pairs[​](https://docs.euler.finance/concepts/core/price-oracles/#currency-pairs "Direct link to Currency Pairs") The system supports various types of currency pairs for price queries: * ERC-20 token addresses for both base and quote currencies * Fiat currencies using ISO 4217 codes (e.g., `address(840)` for USD) * Precious metals using similar address encoding ### Quote-Based Pricing[​](https://docs.euler.finance/concepts/core/price-oracles/#quote-based-pricing "Direct link to Quote-Based Pricing") Instead of returning simple price fractions, the system uses a quote-based approach that accepts an `inAmount` parameter and returns the equivalent amount in the quote currency. This approach handles decimal precision internally and reduces precision loss in extreme cases. ### Bid-Ask Spreads[​](https://docs.euler.finance/concepts/core/price-oracles/#bid-ask-spreads "Direct link to Bid-Ask Spreads") The system supports bid-ask spreads to represent price uncertainty: * **Bid:** The amount you would receive for selling * **Ask:** The amount you would pay for buying * **Mid-point:** The provider's best estimate of fair market value * **Spread:** The difference between bid and ask, representing confidence interval Implementation Details ---------------------- ### ERC-4626 Support[​](https://docs.euler.finance/concepts/core/price-oracles/#erc-4626-support "Direct link to ERC-4626 Support") The router can natively convert [ERC-4626](https://eips.ethereum.org/EIPS/eip-4626) vault shares into underlying assets using the standard `convertToAssets()` method. This is particularly important for Euler's credit vault system, where collateral assets are configured as vault addresses rather than the underlying assets themselves. However, it's important to note that while the `convertToAssets` function can include security mechanisms like internal balance tracking and virtual deposits to mitigate rounding-based exploits, these protections are only guaranteed in EVK vaults. For other ERC-4626 vaults, this method may be vulnerable to manipulation attacks and should be used with caution. For more information about potential vulnerabilities, see the [Donation Attacks documentation](https://docs.euler.finance/creator-tools/security/attack-vectors/donation-attacks) . ### CrossAdapter[​](https://docs.euler.finance/concepts/core/price-oracles/#crossadapter "Direct link to CrossAdapter") The `CrossAdapter` enables price derivation by combining two oracles that share a base or quote asset. For example, an ETH/DAI price can be derived from ETH/USDC and DAI/USDC prices. This feature enables more flexible price discovery while maintaining security through composable components. For more detailed information about the implementation and technical specifications, please refer to the [Euler Price Oracle repository](https://github.com/euler-xyz/euler-price-oracle) . * [Introduction](https://docs.euler.finance/concepts/core/price-oracles/#introduction) * [Core Components](https://docs.euler.finance/concepts/core/price-oracles/#core-components) * [IPriceOracle Interface](https://docs.euler.finance/concepts/core/price-oracles/#ipriceoracle-interface) * [Adapters and Routers](https://docs.euler.finance/concepts/core/price-oracles/#adapters-and-routers) * [Pricing Mechanisms](https://docs.euler.finance/concepts/core/price-oracles/#pricing-mechanisms) * [Oracle Types and Trade-offs](https://docs.euler.finance/concepts/core/price-oracles/#oracle-types-and-trade-offs) * [Vendor-Agnostic Adapter System](https://docs.euler.finance/concepts/core/price-oracles/#vendor-agnostic-adapter-system) * [Standardized Pricing Interface](https://docs.euler.finance/concepts/core/price-oracles/#standardized-pricing-interface) * [Price Quoting System](https://docs.euler.finance/concepts/core/price-oracles/#price-quoting-system) * [Currency Pairs](https://docs.euler.finance/concepts/core/price-oracles/#currency-pairs) * [Quote-Based Pricing](https://docs.euler.finance/concepts/core/price-oracles/#quote-based-pricing) * [Bid-Ask Spreads](https://docs.euler.finance/concepts/core/price-oracles/#bid-ask-spreads) * [Implementation Details](https://docs.euler.finance/concepts/core/price-oracles/#implementation-details) * [ERC-4626 Support](https://docs.euler.finance/concepts/core/price-oracles/#erc-4626-support) * [CrossAdapter](https://docs.euler.finance/concepts/core/price-oracles/#crossadapter) --- # Markets | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/core/markets/#__docusaurus_skipToContent_fallback) On this page Introduction ------------ A market on Euler is a marketplace where borrowers obtain loans and lenders provide capital (in the form of crypto assets) in exchange for interest. On Euler, builders can create custom markets by deploying vaults with the **Euler Vault Kit (EVK)** and linking them using the **Ethereum Vault Connector (EVC)**. The configuration of vaults determines the structure of the market, balancing capital efficiency and risk in different ways depending on the design. Euler's modular architecture allows market creators to design various forms of markets, from simple isolated collateral-debt pairs to more complex, capital-efficient, cross-collateralised clusters. Market Designs -------------- Euler is the only lending protocol that makes [vaults](https://docs.euler.finance/concepts/core/vaults) a core primitive, enabling builders to create tailor-made markets for diverse use cases in a permissionless manner. With the EVK and EVC, developers can replicate markets similar to those on Morpho, FraxLend, Kashi, Silo, Compound, or Aave. Euler's unparalleled modularity offers unique flexibility, allowing builders to deploy vaults that accept collateral from existing vaults in any other market. This fosters greater composability, accelerates ecosystem growth, and drives innovation within Euler. info The [**Ethereum Vault Connector (EVC)**](https://docs.euler.finance/concepts/core/evc) plays a crucial role in market creation by enabling vaults to interact with each other. It provides the infrastructure for cross-vault operations, allowing for complex market designs while maintaining security and efficiency. ### Simple collateral-debt pairs[​](https://docs.euler.finance/concepts/core/markets/#simple-collateral-debt-pairs "Direct link to Simple collateral-debt pairs") As shown in [Figure 1](https://docs.euler.finance/concepts/core/markets/#figure-1) , the most basic market on Euler requires a builder to specify at least two vaults: * Vault A lends assets out. * Vault B holds assets in escrow as collateral to borrow from Vault A. It can get no simpler than this. This design helps isolate risk within the simple market, but suffers from capital inefficiencies and liquidity fragmentation. ![Figure 1: A simple collateral-debt pair.](https://docs.euler.finance/img/concepts/simple-pair.png) **Figure 1: An example of a simple collateral-debt pair.** A USDC vault lends assets, and a ETH vault holds ETH collateral in escrow to borrow from the USDC vault. This setup mirrors markets found in protocols like Morpho, FraxLend, and Kashi. ### Collateral-debt pairs with rehypothecation[​](https://docs.euler.finance/concepts/core/markets/#collateral-debt-pairs-with-rehypothecation "Direct link to Collateral-debt pairs with rehypothecation") A more advanced market allows assets in Vault A to serve as collateral to borrow from Vault B, while assets in Vault B act as collateral to borrow from Vault A. See [Figure 2](https://docs.euler.finance/concepts/core/markets/#figure-2) . This rehypothecation mechanism enhances capital efficiency: * Collateralised assets are not idle; they generate yield while backing loans. * Borrowers can reduce net borrowing costs. * More capital-efficient borrowing across pairs is enabled. This design also unlocks more borrowing opportunities. If Vault A can borrow from Vault B, and Vault B can borrow from Vault C, then Vault A can indirectly borrow from Vault C via Vault B. ![Figure 2: A collateral-debt pair with rehypothecation.](https://docs.euler.finance/img/concepts/rehypothecated-pair.png) **Figure 2: An example of a simple market.** An ETH vault serves as collateral to borrow from a USDC vault, and the same USDC vault can act as collateral to borrow from the ETH vault. This structure enhances capital efficiency by allowing assets to be simultaneously used for lending and borrowing. This model is similar to markets on Silo and Fluid. ### Markets with multiple collaterals[​](https://docs.euler.finance/concepts/core/markets/#markets-with-multiple-collaterals "Direct link to Markets with multiple collaterals") To improve capital efficiency further, a market can allow multiple assets as collateral for borrowing. See [Figure 3](https://docs.euler.finance/concepts/core/markets/#figure-3) . Increased borrowing options: * Drive up interest rates for lenders. * Reduce liquidity fragmentation by allowing more borrowing paths. For example, if Vault A is borrowable by Vaults B, C, D, and E, it consolidates liquidity. The alternative—splitting liquidity across separate pairs (A-B, A-C, A-D, A-E)—can fragment liquidity, making borrowing harder and interest rates more volatile. While fragmentation can serve as a risk management tool, it can also create inefficiencies for borrowers. ![Figure 3: Multi-collateral market.](https://docs.euler.finance/img/concepts/multiple-collateral.png) **Figure 3: An example of a market where multiple vaults are used as collateral.** ETH, DAI and UNI collateral vaults are used to borrow from a single USDC lending vault, reducing fragmentation and improving borrowing efficiency. This model is similar to markets on Compound. ### Cross-collateralised markets[​](https://docs.euler.finance/concepts/core/markets/#cross-collateralised-markets "Direct link to Cross-collateralised markets") The most capital-efficient markets involve cross-collateralised clusters of multiple vaults. See [Figure 4](https://docs.euler.finance/concepts/core/markets/#figure-4) . Here: * Each vault can lend assets while serving as collateral * Benefits include rehypothecation, higher borrowing demand, and reduced liquidity fragmentation * Vaults can be composed in any configuration, allowing for innovative market designs However, these setups introduce higher contagion risk—if one vault defaults, risk spreads across the system. This risk can be mitigated through careful parameter selection and risk management. ![Figure 4: Cross-collateralised market.](https://docs.euler.finance/img/concepts/cross-collateral.png) **Figure 4: A system where multiple vaults both lend assets and act as collateral.** ETH, stETH, and USDC vaults can all be used to lend and borrow against one another, enabling higher capital efficiency. This model resembles a simpler version of the way markets work on Aave. ### Fully customisable markets[​](https://docs.euler.finance/concepts/core/markets/#fully-customisable-markets "Direct link to Fully customisable markets") Unlike many lending protocols that impose rigid market structures, Euler empowers developers to customise market designs to fit user needs. See [Figure 5](https://docs.euler.finance/concepts/core/markets/#figure-5) . Different assets and participants have varied risk and return preferences, making flexibility crucial. Additionally: * New markets can be built on top of existing vaults. * Developers are not restricted to predefined models but can innovate freely. ![Figure 5: Customisable markets on Euler.](https://docs.euler.finance/img/concepts/permissionless-markets.png) **Figure 5: An example of a customised market.** Unlike most lending protocols, Euler enables developers to create custom market designs by linking vaults in various configurations, including vaults from pre-existing markets, fostering innovation and composability as new types of market structure emerge. Creating a Market ----------------- To learn how markets work in more technical detail and how to deploy your own versions of any of those described here, visit the [Creator Tools](https://docs.euler.finance/creator-tools/) section. You'll find guides on configuring vault parameters, adding custom hooks, implementing advanced functionality, and governing vault risk. * [Introduction](https://docs.euler.finance/concepts/core/markets/#introduction) * [Market Designs](https://docs.euler.finance/concepts/core/markets/#market-designs) * [Simple collateral-debt pairs](https://docs.euler.finance/concepts/core/markets/#simple-collateral-debt-pairs) * [Collateral-debt pairs with rehypothecation](https://docs.euler.finance/concepts/core/markets/#collateral-debt-pairs-with-rehypothecation) * [Markets with multiple collaterals](https://docs.euler.finance/concepts/core/markets/#markets-with-multiple-collaterals) * [Cross-collateralised markets](https://docs.euler.finance/concepts/core/markets/#cross-collateralised-markets) * [Fully customisable markets](https://docs.euler.finance/concepts/core/markets/#fully-customisable-markets) * [Creating a Market](https://docs.euler.finance/concepts/core/markets/#creating-a-market) --- # Unit of Account | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/advanced/unit-of-account/#__docusaurus_skipToContent_fallback) On this page In the world of decentralized finance, where countless ERC-20 tokens exist, there's a fundamental need for a standardized way to express and compare asset values. This is where the concept of a unit of account comes into play. It serves as a common reference currency that allows the Euler protocol to make sense of the complex web of asset relationships, enabling everything from price comparisons to collateral valuations. The Role of Unit of Account --------------------------- When you interact with Euler's lending and borrowing features, you're dealing with different types of assets - perhaps depositing ETH as collateral to borrow DAI, or using WBTC to secure a loan in USDC. To make these interactions work smoothly, the protocol needs a way to compare these assets' values consistently. This is where the unit of account steps in, providing a standardized measure that makes these comparisons possible. ### Understanding Asset Valuation[​](https://docs.euler.finance/concepts/advanced/unit-of-account/#understanding-asset-valuation "Direct link to Understanding Asset Valuation") Imagine you're depositing ETH as collateral to borrow DAI. The protocol needs to know if your ETH collateral is sufficient to cover your DAI loan. Without a common unit of account, comparing these different assets would be like trying to compare apples and oranges. The unit of account provides a common denominator, allowing the protocol to accurately assess whether your position is properly collateralized and when it might become eligible for liquidation. ### Flexibility in Pricing[​](https://docs.euler.finance/concepts/advanced/unit-of-account/#flexibility-in-pricing "Direct link to Flexibility in Pricing") What makes Euler's approach to unit of account particularly interesting is its flexibility. While most lending protocols lock themselves into a single unit of account, typically USD or ETH, Euler's modular design allows any asset to serve as the unit of account. This means different markets can choose the most appropriate reference currency for their specific needs. For example, a stablecoin-based lending market might use USDC as its unit of account, while a BTC-backed borrowing market might prefer to use WBTC. Traditional DeFi markets can continue using ETH as their reference point. This flexibility allows Euler to adapt to various financial ecosystems and their unique requirements. Practical Applications ---------------------- The unit of account plays a crucial role in several key aspects of the protocol: ### Risk Management[​](https://docs.euler.finance/concepts/advanced/unit-of-account/#risk-management "Direct link to Risk Management") When assessing the health of a borrowing position, the unit of account provides the standard measure against which both collateral and debt are evaluated. This ensures that risk assessments are consistent and accurate across different asset pairs. ### Liquidation Triggers[​](https://docs.euler.finance/concepts/advanced/unit-of-account/#liquidation-triggers "Direct link to Liquidation Triggers") The unit of account is essential for determining when a position becomes undercollateralized and eligible for liquidation. By providing a consistent measure of value, it ensures that liquidation decisions are fair and transparent. ### Market Efficiency[​](https://docs.euler.finance/concepts/advanced/unit-of-account/#market-efficiency "Direct link to Market Efficiency") By allowing different markets to choose their own unit of account, Euler enables more efficient pricing and risk management. Markets can select the reference currency that best matches their specific use case, whether that's a stablecoin for stablecoin markets or a volatile asset for more traditional DeFi applications. * [The Role of Unit of Account](https://docs.euler.finance/concepts/advanced/unit-of-account/#the-role-of-unit-of-account) * [Understanding Asset Valuation](https://docs.euler.finance/concepts/advanced/unit-of-account/#understanding-asset-valuation) * [Flexibility in Pricing](https://docs.euler.finance/concepts/advanced/unit-of-account/#flexibility-in-pricing) * [Practical Applications](https://docs.euler.finance/concepts/advanced/unit-of-account/#practical-applications) * [Risk Management](https://docs.euler.finance/concepts/advanced/unit-of-account/#risk-management) * [Liquidation Triggers](https://docs.euler.finance/concepts/advanced/unit-of-account/#liquidation-triggers) * [Market Efficiency](https://docs.euler.finance/concepts/advanced/unit-of-account/#market-efficiency) --- # EulerSwap | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/advanced/euler-swap/#__docusaurus_skipToContent_fallback) On this page Introduction ------------ EulerSwap is a new decentralized exchange that integrates directly with Euler's lending infrastructure and leverages Uniswap v4's hook architecture. By combining the best of modular DeFi powerhouses, EulerSwap unlocks next-generation capital efficiency for market makers, liquidity providers, and traders. Unlike traditional AMMs that fragment capital across isolated liquidity pools, EulerSwap creates a unified system where the same assets can simultaneously facilitate swaps, earn lending yield, and serve as collateral for borrowing. For a step-by-step guide to providing liquidity on EulerSwap see our [User Guide](https://docs.euler.finance/user-guide/euler-swap) . Core Architecture ----------------- ### Unified Liquidity System[​](https://docs.euler.finance/concepts/advanced/euler-swap/#unified-liquidity-system "Direct link to Unified Liquidity System") When liquidity providers supply assets to Euler vaults, they can then install the swap operator on top of their positions. This architectural design enables capital to remain productive at all times by: * **Facilitating swaps** through traditional AMM mechanisms * **Earning lending yield** from borrowers in the underlying Euler vaults * **Serving as collateral** for borrowing other assets within the Euler ecosystem This structure eliminates capital fragmentation and maximizes yield opportunities without compromising liquidity provision. ### Single-Owner Pool Model[​](https://docs.euler.finance/concepts/advanced/euler-swap/#single-owner-pool-model "Direct link to Single-Owner Pool Model") Unlike traditional shared liquidity pools, each EulerSwap instance is created and managed by a single LP account. This design provides: * **Full control** over the pool's AMM curve parameters * **Customizable pricing** spreads and liquidity profiles * **Integrated access** to leverage and collateral strategies * **Active management** capabilities for sophisticated market makers Key Features ------------ ### Just-in-Time (JIT) Liquidity[​](https://docs.euler.finance/concepts/advanced/euler-swap/#just-in-time-jit-liquidity "Direct link to Just-in-Time (JIT) Liquidity") EulerSwap's integration with Euler's lending system enables powerful JIT liquidity provision. When an LP lacks sufficient output tokens, the protocol can borrow them on-demand using input tokens as collateral. **Capital Efficiency**: In optimal cases, this mechanism can simulate up to **50x the depth** of traditional AMMs, particularly effective in stable or pegged asset markets where pricing risk is minimal. ### Dynamic Hedging and IL Protection[​](https://docs.euler.finance/concepts/advanced/euler-swap/#dynamic-hedging-and-il-protection "Direct link to Dynamic Hedging and IL Protection") Because reserves live inside Euler vaults, LPs can borrow against them natively, enabling: * **Delta-neutral strategies** for uncorrelated pairs like WETH/USDC * **Impermanent loss mitigation** through dynamic position management * **Automated hedging** via smart contract operators * **Manual strategy adjustment** for sophisticated users ### Custom AMM Curves[​](https://docs.euler.finance/concepts/advanced/euler-swap/#custom-amm-curves "Direct link to Custom AMM Curves") EulerSwap supports flexible curve configurations defined at pool creation: * **Symmetric or asymmetric** distributions * **Single-sided or concentrated** liquidity ranges ### Shared Liquidity Layer[​](https://docs.euler.finance/concepts/advanced/euler-swap/#shared-liquidity-layer "Direct link to Shared Liquidity Layer") Assets deposited into Euler vaults can be utilized across multiple EulerSwap pools simultaneously. A single asset (e.g., USDC) can provide liquidity for numerous trading pairs, dramatically improving capital efficiency across the ecosystem. Uniswap v4 Integration ---------------------- EulerSwap is built for full compatibility with Uniswap v4's hook architecture, enabling: * **Seamless integration** with Uniswap's routing and solver networks * **Standard swap interfaces** with advanced execution logic running beneath * **Extended functionality** through lending-based logic hooks * **Transparent user experience** hiding complexity behind familiar interfaces Target Users ------------ ### Token Issuers[​](https://docs.euler.finance/concepts/advanced/euler-swap/#token-issuers "Direct link to Token Issuers") Bootstrap liquidity without relying on mercenary incentives or short-term yield farming ### DAOs and Protocol Teams[​](https://docs.euler.finance/concepts/advanced/euler-swap/#daos-and-protocol-teams "Direct link to DAOs and Protocol Teams") Improve capital efficiency of protocol-owned liquidity through active yield generation ### Market Makers[​](https://docs.euler.finance/concepts/advanced/euler-swap/#market-makers "Direct link to Market Makers") Access efficient, hedgeable LP positions with customizable parameters and risk management ### Sophisticated DeFi Users[​](https://docs.euler.finance/concepts/advanced/euler-swap/#sophisticated-defi-users "Direct link to Sophisticated DeFi Users") Combine lending, borrowing, and trading strategies in integrated workflows Use Cases --------- ### Stablecoin Liquidity Pools[​](https://docs.euler.finance/concepts/advanced/euler-swap/#stablecoin-liquidity-pools "Direct link to Stablecoin Liquidity Pools") Create correlated asset pools (USDT/USDC) earning both swap fees and boosted lending yield. Enable JIT liquidity for greater depth or borrow against positions for hedging. ### Long-tail Asset Trading[​](https://docs.euler.finance/concepts/advanced/euler-swap/#long-tail-asset-trading "Direct link to Long-tail Asset Trading") Deploy traditional 50/50 pools between emerging tokens and stablecoins, earning swap fees plus potential lending yield from both assets when supported. ### Hedged Major Asset Pools[​](https://docs.euler.finance/concepts/advanced/euler-swap/#hedged-major-asset-pools "Direct link to Hedged Major Asset Pools") Set up USDC/WETH pools with dynamic hedging by borrowing ETH against USDC deposits, automatically adjusting exposure to maintain delta-neutral or targeted risk profiles. ### Launchpad-style Markets[​](https://docs.euler.finance/concepts/advanced/euler-swap/#launchpad-style-markets "Direct link to Launchpad-style Markets") Deploy asymmetric liquidity with concentrated ranges for new token launches, enabling fixed-price execution for early buyers while facilitating price discovery. Security and Auditing --------------------- EulerSwap has undergone extensive security review with five leading audit firms engaged from early development stages. Key security measures include: * **$500,000 capture-the-flag competition** for live battle-testing * **Inherited safety properties** from Euler's battle-tested lending infrastructure * **40+ independent audits** across the underlying Euler protocol and modules Technical Implementation ------------------------ ### Smart Contract Architecture[​](https://docs.euler.finance/concepts/advanced/euler-swap/#smart-contract-architecture "Direct link to Smart Contract Architecture") * **Factory Contract**: Deploys new swap pools with immutable curve parameters * **Proxy Pattern**: Gas-efficient deployment with individual pool parameters and state * **Main Swap Contract**: Handles swaps, enforces curve invariants, supports flash swaps ### Developer Resources[​](https://docs.euler.finance/concepts/advanced/euler-swap/#developer-resources "Direct link to Developer Resources") * **Open Source**: All code available in the [EulerSwap GitHub repository](https://github.com/euler-xyz/euler-swap) * [**Maglev UI**](https://maglev.euler.finance/) : Purpose built UI to create EulerSwap operators. [Maglev Docs](https://docs.euler.finance/creator-tools/maglev/overview) EulerSwap represents the next evolution of DEX infrastructure, combining the liquidity efficiency of modern AMMs with the capital productivity of advanced lending protocols. By breaking down the traditional barriers between trading and lending, it opens new possibilities for yield generation and capital optimization in DeFi. * [Introduction](https://docs.euler.finance/concepts/advanced/euler-swap/#introduction) * [Core Architecture](https://docs.euler.finance/concepts/advanced/euler-swap/#core-architecture) * [Unified Liquidity System](https://docs.euler.finance/concepts/advanced/euler-swap/#unified-liquidity-system) * [Single-Owner Pool Model](https://docs.euler.finance/concepts/advanced/euler-swap/#single-owner-pool-model) * [Key Features](https://docs.euler.finance/concepts/advanced/euler-swap/#key-features) * [Just-in-Time (JIT) Liquidity](https://docs.euler.finance/concepts/advanced/euler-swap/#just-in-time-jit-liquidity) * [Dynamic Hedging and IL Protection](https://docs.euler.finance/concepts/advanced/euler-swap/#dynamic-hedging-and-il-protection) * [Custom AMM Curves](https://docs.euler.finance/concepts/advanced/euler-swap/#custom-amm-curves) * [Shared Liquidity Layer](https://docs.euler.finance/concepts/advanced/euler-swap/#shared-liquidity-layer) * [Uniswap v4 Integration](https://docs.euler.finance/concepts/advanced/euler-swap/#uniswap-v4-integration) * [Target Users](https://docs.euler.finance/concepts/advanced/euler-swap/#target-users) * [Token Issuers](https://docs.euler.finance/concepts/advanced/euler-swap/#token-issuers) * [DAOs and Protocol Teams](https://docs.euler.finance/concepts/advanced/euler-swap/#daos-and-protocol-teams) * [Market Makers](https://docs.euler.finance/concepts/advanced/euler-swap/#market-makers) * [Sophisticated DeFi Users](https://docs.euler.finance/concepts/advanced/euler-swap/#sophisticated-defi-users) * [Use Cases](https://docs.euler.finance/concepts/advanced/euler-swap/#use-cases) * [Stablecoin Liquidity Pools](https://docs.euler.finance/concepts/advanced/euler-swap/#stablecoin-liquidity-pools) * [Long-tail Asset Trading](https://docs.euler.finance/concepts/advanced/euler-swap/#long-tail-asset-trading) * [Hedged Major Asset Pools](https://docs.euler.finance/concepts/advanced/euler-swap/#hedged-major-asset-pools) * [Launchpad-style Markets](https://docs.euler.finance/concepts/advanced/euler-swap/#launchpad-style-markets) * [Security and Auditing](https://docs.euler.finance/concepts/advanced/euler-swap/#security-and-auditing) * [Technical Implementation](https://docs.euler.finance/concepts/advanced/euler-swap/#technical-implementation) * [Smart Contract Architecture](https://docs.euler.finance/concepts/advanced/euler-swap/#smart-contract-architecture) * [Developer Resources](https://docs.euler.finance/concepts/advanced/euler-swap/#developer-resources) --- # Operators | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/advanced/operators/#__docusaurus_skipToContent_fallback) On this page Introduction ------------ **Operators** represent a powerful generalization of the traditional token approval system in Euler, enabling users to delegate permissions to external contracts that can act on their behalf. This feature unlocks a wide range of advanced functionality, particularly for users who prefer to interact with the protocol through external interfaces or automated systems. Understanding Operators ----------------------- At its core, the operator system allows users to attach external contracts to act on behalf of their sub-accounts. This is more sophisticated than simple token approvals because it provides a way to delegate control of specific sub-accounts to external contracts. The system is designed to be flexible while maintaining security and control for the user. Potential Features ------------------ The operator system enables several powerful capabilities that can be implemented to enhance the user experience and enable more sophisticated interactions with the protocol: **Automated Trading Strategies**: Operators could be used to implement automated trading systems that execute trades based on predefined conditions. This could include features like stop-loss orders, take-profit targets, or trailing stops without requiring manual intervention. **Position Management**: External contracts could be authorized to manage positions, enabling more complex strategies that might involve multiple steps or require precise timing. This would be particularly useful for professional traders or automated trading systems. **Risk Management**: The system could support automated risk management features like dynamic collateral rebalancing, automated deleveraging during high volatility, or portfolio-wide stop-loss mechanisms. Security Considerations ----------------------- While the operator system provides powerful functionality, it's important to understand the security implications: **Binary Permissions**: Operator permissions are binary - an operator either has full control over a sub-account or no control at all. This means users should carefully consider which sub-accounts they delegate to operators. **Emergency Controls**: In case of security concerns, users can revoke operator permissions at any time. This provides an important safety mechanism if an operator's behavior becomes suspicious or if the user wants to regain full control of their positions. **Trust Requirements**: Users should only grant operator permissions to contracts they trust and have thoroughly vetted. This is particularly important as operators have full control over the sub-accounts they're authorized to act on behalf of. Best Practices -------------- When using operators, consider these best practices: **Selective Delegation**: Only delegate sub-accounts to operators when necessary, and consider using separate sub-accounts for different operators to maintain better control over your positions. **Regular Reviews**: Periodically review your operator settings and revoke permissions for operators you no longer use or trust. **Use Reputable Services**: When possible, use operators provided by well-known and trusted services that have been audited and have a track record of security. **Monitor Activity**: Keep an eye on the actions taken by your operators to ensure they're behaving as expected. * [Introduction](https://docs.euler.finance/concepts/advanced/operators/#introduction) * [Understanding Operators](https://docs.euler.finance/concepts/advanced/operators/#understanding-operators) * [Potential Features](https://docs.euler.finance/concepts/advanced/operators/#potential-features) * [Security Considerations](https://docs.euler.finance/concepts/advanced/operators/#security-considerations) * [Best Practices](https://docs.euler.finance/concepts/advanced/operators/#best-practices) --- # Hooks | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/advanced/hooks/#__docusaurus_skipToContent_fallback) On this page Introduction ------------ **Hooks** are a powerful feature in Euler that allows vault governors to customize and control vault operations. By implementing a hook configuration, governors can specify a hook target (a smart contract) and define which vault operations should trigger the hook. This system provides a flexible way to add custom logic and restrictions to vault operations without modifying the core vault code. Understanding Hooks ------------------- At their core, hooks are external contracts that can intercept and potentially modify or block vault operations. When a hook is triggered during an operation, the vault calls the hook target contract before completing the transaction. If the hook fails, the vault operation also fails, providing a way to enforce additional rules and restrictions. Key Features ------------ **Customizable Operations**: Hooks can be configured to affect various vault operations, including deposits, withdrawals, borrows, and repays. This allows for fine-grained control over how users interact with the vault. **Flexible Implementation**: Hook targets can implement any custom logic, making them suitable for a wide range of use cases, from simple restrictions to complex business rules. **Security Layer**: Hooks provide an additional security layer by allowing governors to implement custom checks and validations before operations are executed. Common Use Cases ---------------- **Pause Guardian**: A hook can be used to implement a pause mechanism, allowing governors to temporarily disable specific vault functions in response to market conditions or potential exploits. **Permissioned/RWA Vaults**: Hooks can control who can deposit or borrow, which is particularly useful for compliance requirements or undercollateralized lending scenarios. **Flash Loan Fees**: While flash loans are free by default, hooks can be used to implement fees on flash loan operations. **Utilization Caps**: Hooks can prevent a vault's utilization from exceeding a set threshold, helping to manage risk and maintain protocol stability. **Minimum Debt Sizes**: To prevent the creation of positions that are too small to liquidate profitably, hooks can block transactions that would create dust positions. **Collateral Limits**: Hooks can restrict the number of collateral assets an account can enable, helping to manage risk and complexity. Implementation Details ---------------------- When a hooked operation is called on a vault, the vault forwards the exact same calldata to the hook target contract, with the called address attached as trailing data. This means that hook targets must implement the same interface as vaults for the operations they want to hook into. This design allows hook targets to process the same parameters and make decisions based on the same information that the vault would use. For example, if a user calls `deposit(100)` on a vault, and the deposit operation is hooked, the hook target will receive the same `deposit(100)` calldata, plus the address of the account authenticated. This ensures that hook targets have all the necessary information to make informed decisions and implement additional features. For more detailed information about the implementation and examples, please refer to the [EVK Periphery repository](https://github.com/euler-xyz/evk-periphery/tree/master/src/HookTarget) . * [Introduction](https://docs.euler.finance/concepts/advanced/hooks/#introduction) * [Understanding Hooks](https://docs.euler.finance/concepts/advanced/hooks/#understanding-hooks) * [Key Features](https://docs.euler.finance/concepts/advanced/hooks/#key-features) * [Common Use Cases](https://docs.euler.finance/concepts/advanced/hooks/#common-use-cases) * [Implementation Details](https://docs.euler.finance/concepts/advanced/hooks/#implementation-details) --- # Annual Percentage Yield | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#__docusaurus_skipToContent_fallback) On this page Introduction ------------ **Annual Percentage Yield (APY)** is a crucial metric in Euler that helps users understand their potential returns or costs when interacting with the protocol. Unlike simple interest rates, APY accounts for the effects of compound interest, providing a more accurate picture of the actual yield over time. Whether you're supplying assets to earn yield or borrowing assets to access liquidity, understanding APY is essential for making informed decisions. Supply APY ---------- When you supply assets to Euler, you earn yield through multiple sources. The total Supply APY you see in the interface combines three main components: ### Lending APY[​](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#lending-apy "Direct link to Lending APY") The primary source of yield comes from lending your assets to borrowers. This is the base return you earn for providing liquidity to the protocol. The rate varies based on market conditions and the utilization of the asset in the protocol. ### Intrinsic APY[​](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#intrinsic-apy "Direct link to Intrinsic APY") Some assets have built-in yield mechanisms. For example, when you supply wstETH, you earn staking rewards from Lido. These rewards compound with your lending interest every block, potentially boosting your overall returns. The intrinsic yield is specific to each asset and depends on its underlying mechanics. ### Rewards APY[​](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#rewards-apy "Direct link to Rewards APY") Euler may offer additional incentives in the form of reward tokens, such as rEUL. These rewards provide an extra layer of yield on top of your lending returns. Unlike intrinsic yield, reward APY doesn't compound with lending interest, but it can significantly enhance your overall returns. Borrow APY ---------- Borrowing on Euler comes with its own cost structure, reflected in the Borrow APY. This rate is typically higher than the Supply APY for two main reasons: the protocol maintains a utilization buffer below 100%, and a small portion of the interest goes to protocol fees. ### Borrowing APY[​](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#borrowing-apy "Direct link to Borrowing APY") This is the core interest rate you pay to lenders. It's calculated based on the utilization rate of the asset and can vary as market conditions change. The rate is designed to incentivize optimal utilization of the protocol's liquidity. ### Intrinsic APY[​](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#intrinsic-apy-1 "Direct link to Intrinsic APY") When you borrow certain assets, you may need to account for their intrinsic yield. For example, borrowing wstETH means you'll need to pay back both the borrowing interest and the staking rewards that accrue to the asset. This compounds with your borrowing costs every block. ### Rewards APY[​](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#rewards-apy-1 "Direct link to Rewards APY") In some cases, borrowing can be profitable thanks to reward incentives. The protocol may offer reward tokens like rEUL to borrowers, which can offset or even exceed the borrowing costs. These rewards don't compound with the borrowing interest but can make borrowing attractive in certain market conditions. Understanding APY Dynamics -------------------------- The relationship between Supply APY and Borrow APY creates an interesting dynamic in the protocol. When utilization is low, Supply APY tends to be lower, and Borrow APY is lower to encourage borrowing. As utilization increases, Supply APY rises to attract more suppliers, while Borrow APY increases to manage risk. This balance ensures that: * Lenders earn competitive returns for providing liquidity * Borrowers have access to capital at reasonable rates * The protocol maintains sufficient liquidity for all users * Risk is managed through appropriate rate adjustments Best Practices -------------- When evaluating APY opportunities in Euler: 1. Consider all components of the APY, not just the headline rate 2. Understand how intrinsic yield affects your position 3. Factor in reward tokens when calculating total returns 4. Monitor rate changes as market conditions evolve 5. Consider the impact of compound interest on your returns 6. Be aware that APY rates are dynamic and can change * [Introduction](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#introduction) * [Supply APY](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#supply-apy) * [Lending APY](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#lending-apy) * [Intrinsic APY](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#intrinsic-apy) * [Rewards APY](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#rewards-apy) * [Borrow APY](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#borrow-apy) * [Borrowing APY](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#borrowing-apy) * [Intrinsic APY](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#intrinsic-apy-1) * [Rewards APY](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#rewards-apy-1) * [Understanding APY Dynamics](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#understanding-apy-dynamics) * [Best Practices](https://docs.euler.finance/concepts/financial/annual-percentage-yield/#best-practices) --- # Governance Contracts | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/governance-contracts/#__docusaurus_skipToContent_fallback) On this page Governance contracts are essential for secure, flexible, and upgradeable management of Euler Vault Kit (EVK) vaults and oracle routers. They enable fine-grained control over vault operations, risk parameters, and emergency responses, balancing the need for rapid intervention with robust user protection. Key Principles -------------- Governance contracts in Euler are designed for security and flexibility, but their deployment and management require careful attention. All governance contracts must be deployed from existing, audited factories—there is no UI for these deployments, so users should rely on scripts or block explorers to perform the process. The standard Creator UI does not support the full suite of governor contracts and is only compatible with multisigs. As a result, risk curators and advanced users are encouraged to use [euler-vault-scripts](https://github.com/euler-xyz/euler-vault-scripts) or develop their own custom management tools for managing clusters and advanced governance scenarios. To ensure consistent and secure governance across all protocol components, governor contracts should be installed not only on vaults but also on the oracle router. This approach provides fine-grained control and robust protection for both lending markets and their associated price feeds. Recommended Architecture ------------------------ The recommended governance suite is illustrated below. It features dual timelocks (admin and wildcard), a risk steward, guardian, and emergency roles, all allowing for the operations to be (optionally) batched via the EVC. This architecture enables: * Time-delayed governance for transparency and user protection * Emergency response capabilities for rapid risk mitigation * Role separation for operational and administrative security ![Recommended Governance Architecture](https://docs.euler.finance/assets/images/governor-suite-762899445ae314fcb6d3ace1581cbb06.png) Components ---------- * **`GovernorAccessControlEmergency`:** Selector-based access control contracts for fine-grained permissioning and emergency actions. * **`CapRiskSteward`:** Specialized risk management contract that allows authorized users to adjust supply and borrow caps within predefined safety limits and cooldowns, and to update interest rate models (IRMs) only to those deployed by a recognized factory. * **`GovernorAccessControlEmergencyFactory`:** Factory for deploying the full governance suite, including timelocks and emergency roles. * **`CapRiskStewardFactory`:** Factory for deploying CapRiskSteward contracts that work alongside selector-based governors for delegated, but limited, risk management that can bypass timelock controllers. Deployment & Management ----------------------- ### Deployment Process[​](https://docs.euler.finance/creator-tools/governance-contracts/#deployment-process "Direct link to Deployment Process") 1. Prepare timelock parameters: * Set `minDelay` (minimum 1 day) for both admin and wildcard timelocks * Define proposers, cancellers, and executors for each timelock * Identify emergency guardians for rapid response capabilities 2. Deploy through `GovernorAccessControlEmergencyFactory`: * Call `deploy` with the prepared parameters * Record the addresses of deployed contracts 3. Install governance: * Set the `GovernorAccessControlEmergency` as governor for your vault(s) * Install the same governor on your oracle router * If using `CapRiskSteward` for delegated risk management: * Deploy `CapRiskSteward` via `CapRiskStewardFactory`, providing the governor access control contract, IRM factory addresses and the admin address * Grant `setInterestRateModel.selector` and `setCaps.selector` roles to the `CapRiskSteward` on the governor contract * Assign the wildcard role on the `CapRiskSteward` to a multisig or other trusted address * [Key Principles](https://docs.euler.finance/creator-tools/governance-contracts/#key-principles) * [Recommended Architecture](https://docs.euler.finance/creator-tools/governance-contracts/#recommended-architecture) * [Components](https://docs.euler.finance/creator-tools/governance-contracts/#components) * [Deployment & Management](https://docs.euler.finance/creator-tools/governance-contracts/#deployment--management) * [Deployment Process](https://docs.euler.finance/creator-tools/governance-contracts/#deployment-process) --- # Interest Rate Models | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/interest-rate-models/#__docusaurus_skipToContent_fallback) On this page **Interest rate models (IRMs)** are a core component of risk management and capital efficiency in Euler vaults. They determine how borrowing and supplying rates respond to changes in utilization. Euler currently supports two main types of IRMs, each with distinct governance and operational requirements. Kink IRM (Linear Kink Model) ---------------------------- * **Description:** The Kink IRM is a classic model where the interest rate increases linearly with utilization up to a "kink" point, after which it rises more steeply. This model is highly configurable and can be tailored to current market conditions. * **Governance:** Requires active management. Curators or risk managers must monitor market conditions and redeploy new Kink IRMs as needed, swapping them into governed vaults to maintain optimal risk/reward profiles. * **Deployment:** New Kink IRMs can be deployed using the [Creator UI](https://create.euler.finance/) . The model parameters (base rate, kink rate, max rate, kink utilization, etc.) are set at deployment. * **Suitability:** Not suitable for ungoverned or immutable vaults (such as Edge vaults) due to the need for ongoing updates. Adaptive Curve IRM (Morpho-Style) --------------------------------- * **Description:** The Adaptive Curve IRM is based on the Morpho adaptive curve model, with some parameter tweaks for Euler. It automatically adjusts the interest rate at the target utilization based on time spent above or below the target, reducing the need for manual intervention. * **Governance:** Designed for minimal intervention. A preset of Adaptive Curve IRMs has been deployed and their addresses are available in the `irmRegistry` contract. * **Selection:** In the Edge Creator UI, you can select from the available Adaptive Curve IRMs in the registry. These are suitable for ungoverned or immutable vaults, as they adapt to market conditions without requiring redeployment. * **Suitability:** Recommended for Edge vaults and other ungoverned/immutable deployments. * [Kink IRM (Linear Kink Model)](https://docs.euler.finance/creator-tools/interest-rate-models/#kink-irm-linear-kink-model) * [Adaptive Curve IRM (Morpho-Style)](https://docs.euler.finance/creator-tools/interest-rate-models/#adaptive-curve-irm-morpho-style) --- # Deploy An Oracle Router | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/deploy-oracle-router/#__docusaurus_skipToContent_fallback) On this page **The Oracle Router** is a required component of the Euler protocol. Every vault must be connected to an Oracle Router to obtain reliable, on-chain price feeds for its underlying asset and all accepted collateral. The router enables flexible, modular pricing paths and can be managed either from its dedicated UI page or during vault configuration. It is recommended that all vaults in a cluster share a single router, ensuring consistent pricing and risk management. Available Oracles ----------------- Before deploying your own Oracle Router, check the [Euler Oracles Dashboard](https://oracles.euler.finance/) to see if there are existing oracles that meet your needs. The dashboard provides a comprehensive overview of all available oracles, their configurations, and their current status. Using an existing oracle can save time and reduce deployment complexity. Quick Start ----------- 1. **Deploy the Oracle Adapter** * If you cannot find a suitable oracle from above, then you can choose to deploy your own through the Oracle Deployer ([oracle-deployer.euler.finance](https://oracle-deployer.euler.finance/) ) * From here, you can configure and deploy a new oracle. Make sure to do an explorer verification and submit a PR for whitelisting. 2. **Deploy the Oracle Router** * Go to the Oracle section of the Creator UI ([create.euler.finance](https://create.euler.finance/) ) * Click "Deploy New Oracle Router" and confirm the transaction. 3. **Configure Oracle Adapters** * On the router management page, add adapters for each asset/unit-of-account pair you need (e.g., DAI/USD, WETH/USD). * For ERC-4626 assets (like sDAI), you may need to "resolve" the vault so the router can price the share in terms of its underlying (e.g., sDAI/DAI). 4. **Set Resolved Vaults** * For every ERC-4626 vault you use as collateral, you must add it as a resolved vault in the Oracle Router. This enables the router to price the collateral share in terms of its underlying asset using `convertToAssets()`. * For example, if your collateral is esDAI (an ERC-4626 vault holding sDAI, which is itself an ERC-4626 vault for DAI), the router will price esDAI/sDAI, then sDAI/DAI, and finally DAI/USD, forming a complete pricing path: `esDAI/sDAI → sDAI/DAI → DAI/USD` 5. **Install the Router in Your Vault** * When deploying or configuring a vault, select your Oracle Router and unit of account. The vault will use the router for all collateral and liability pricing. 6. **Create a PR in the Euler Interfaces Repo** * If you haven't already done so, you need to: * Perform an [Explorer Verfication](https://docs.euler.finance/creator-tools/deploy-oracle-router#explorer-verification) for the adapters you deployed. * Submit a PR on the [`euler-interfaces`](https://github.com/euler-xyz/euler-interfaces) repo by adding your deployments to the `OracleAdaptersAddresses.csv` file. Adapters & Resolved Vaults -------------------------- ### Adapters[​](https://docs.euler.finance/creator-tools/deploy-oracle-router/#adapters "Direct link to Adapters") Each adapter links a token (or vault) to a unit of account (e.g., USD or WETH). You must add an adapter for every asset you want to price. ### Resolved Vaults[​](https://docs.euler.finance/creator-tools/deploy-oracle-router/#resolved-vaults "Direct link to Resolved Vaults") You must register each collateral vault as resolved so the router can use the `convertToAssets()` function to price shares in terms of the underlying asset. This is essential essential for every collateral as each collateral is an ERC-4626 vault. **Example** If your collateral is esDAI (an ERC-4626 vault holding sDAI, which is itself an ERC-4626 vault for DAI), the router must be able to resolve: * esDAI/sDAI (via `convertToAssets`) * sDAI/DAI (via `convertToAssets`) * DAI/USD (via a standard oracle adapter) **Another Example:** If your collateral is a DAI vault (eDAI), the router must be able to resolve: * eDAI/DAI (via `convertToAssets`) * DAI/USD (via a standard oracle adapter) ### Explorer Verification[​](https://docs.euler.finance/creator-tools/deploy-oracle-router/#explorer-verification "Direct link to Explorer Verification") As part of the process of whitelisting adapters, you need to make sure that the contracts for the adapters are verified through the respective block explorer. **Steps** 1. Through the Oracle Deployer UI, open the dot menu (three dots) on the oracle card 2. Download the Standard JSON Input file 3. Go to the verification form for the respective explorer (e.g., Etherscan for Ethereum mainnet) and enter the following: * Compiler Type: Solidity (Standard-Json-Input) * Compiler Version: v0.8.24+commit.e11b9ed9 * License: GNU GPLv2 4. Upload the Standard JSON Input file 5. Verify and Publish Best Practices -------------- * **Plan Your Pricing Paths:** Before deploying, map out the full pricing path for each collateral: _Vault Share → Underlying → Unit of Account_ * **Governance:** Assign a secure governor to the router for future updates. * **Consistency:** Use the same router for all vaults in a cluster to avoid pricing discrepancies. * **UI Flexibility:** You can configure the router from its dedicated page or while setting up a vault — both methods are equivalent. * [Available Oracles](https://docs.euler.finance/creator-tools/deploy-oracle-router/#available-oracles) * [Quick Start](https://docs.euler.finance/creator-tools/deploy-oracle-router/#quick-start) * [Adapters & Resolved Vaults](https://docs.euler.finance/creator-tools/deploy-oracle-router/#adapters--resolved-vaults) * [Adapters](https://docs.euler.finance/creator-tools/deploy-oracle-router/#adapters) * [Resolved Vaults](https://docs.euler.finance/creator-tools/deploy-oracle-router/#resolved-vaults) * [Explorer Verification](https://docs.euler.finance/creator-tools/deploy-oracle-router/#explorer-verification) * [Best Practices](https://docs.euler.finance/creator-tools/deploy-oracle-router/#best-practices) --- # Attack Vectors | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/attack-vectors/#__docusaurus_skipToContent_fallback) On this page When creating and managing Euler vaults, it's important to be aware of potential attack vectors and how to prevent them. The following resources provide detailed information about known attack vectors and their mitigations: Donation Attacks on ERC-4626 Vaults ----------------------------------- One of the most important security considerations when working with ERC-4626 vaults is the potential for donation attacks. These attacks can occur when a vault's exchange rate is manipulated through strategic deposits and withdrawals. For a detailed explanation of donation attacks and how to prevent them, see our [Donation Attacks](https://docs.euler.finance/security/attack-vectors/donation-attacks) documentation. * [Donation Attacks on ERC-4626 Vaults](https://docs.euler.finance/creator-tools/attack-vectors/#donation-attacks-on-erc-4626-vaults) --- # Advanced Features | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/maglev/advanced/#__docusaurus_skipToContent_fallback) On this page ### Leveraged Market-Making[​](https://docs.euler.finance/creator-tools/maglev/advanced/#leveraged-market-making "Direct link to Leveraged Market-Making") EulerSwap supports leveraged positions, such as depositing 250kUSDCtoloopborrow250k USDC to loop borrow 250kUSDCtoloopborrow650k and swap $400k USDT to build a balanced liquidity position. ### Just-in-Time (JIT) Liquidity[​](https://docs.euler.finance/creator-tools/maglev/advanced/#just-in-time-jit-liquidity "Direct link to Just-in-Time (JIT) Liquidity") Liquidity is dynamically available based on the account’s current state and vault balances. If a vault is fully utilized, the pool’s effective liquidity drops to zero. JIT liquidity allows borrowing output tokens against input token collateral to fulfill swap requests, making the protocol highly capital efficient. ### Integration with Uniswap v4 Hooks[​](https://docs.euler.finance/creator-tools/maglev/advanced/#integration-with-uniswap-v4-hooks "Direct link to Integration with Uniswap v4 Hooks") EulerSwap is compatible with Uniswap v4’s hook architecture, enabling interoperability with Uniswap’s ecosystem. Pool addresses must follow specific patterns for compatibility. ### Flash Swaps Support[​](https://docs.euler.finance/creator-tools/maglev/advanced/#flash-swaps-support "Direct link to Flash Swaps Support") EulerSwap supports flash swaps (similar to Uniswap v2), allowing advanced integrations and arbitrage strategies * [Leveraged Market-Making](https://docs.euler.finance/creator-tools/maglev/advanced/#leveraged-market-making) * [Just-in-Time (JIT) Liquidity](https://docs.euler.finance/creator-tools/maglev/advanced/#just-in-time-jit-liquidity) * [Integration with Uniswap v4 Hooks](https://docs.euler.finance/creator-tools/maglev/advanced/#integration-with-uniswap-v4-hooks) * [Flash Swaps Support](https://docs.euler.finance/creator-tools/maglev/advanced/#flash-swaps-support) --- # Configure asymmetric concentration | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/maglev/configuration/configure-asymmetric-concentration/#__docusaurus_skipToContent_fallback) On this page Asymmetric concentration in EulerSwap allows liquidity providers (LPs) to tailor liquidity distribution for each asset in a trading pair independently. This feature optimizes capital efficiency while managing impermanent loss risks, particularly in volatile markets. Below is a detailed breakdown of its mechanics, strategic use cases, and operational considerations. ![](https://telosc.gitbook.io/maglev/~gitbook/image?url=https%3A%2F%2F455866866-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXAFUNoD0AMkdbOKUOJXa%252Fuploads%252FQhiKJCblxWLtiKuv4fpX%252FConcentration.gif%3Falt%3Dmedia%26token%3D1ed3c25e-1a3e-4a17-8c5d-0937ac3c9588&width=768&dpr=4&quality=100&sign=c9e5bb3f&sv=2) ### **What is Asymmetric Concentration?**[​](https://docs.euler.finance/creator-tools/maglev/configuration/configure-asymmetric-concentration/#what-is-asymmetric-concentration "Direct link to what-is-asymmetric-concentration") Asymmetric concentration enables LPs to set different liquidity density levels for each asset in a pair. For example: * **Concentration X**: Controls liquidity density for the first asset (e.g., USDC). * **Concentration Y**: Controls liquidity density for the second asset (e.g., WETH). **Key characteristics**: * **Range**: 0% (flat, constant product, Uniswap v2-style) to 100% (hyper-concentrated, Uniswap v3-like). * **Impact**: Higher values concentrate liquidity around the equilibrium price, reducing slippage but increasing impermanent loss risk. Lower values spread liquidity broadly, mitigating risk but reducing fee earnings * * * ### **Mathematical Foundation**[​](https://docs.euler.finance/creator-tools/maglev/configuration/configure-asymmetric-concentration/#mathematical-foundation "Direct link to mathematical-foundation") The concentration parameter C defines the curve’s slope using: PriceImpact∝1C.NAVPrice Impact∝ \\frac{1}{C . \\sqrt{NAV}}PriceImpact∝C.NAV​1​ Where: * C = Concentration value (0 < C ≤ 1) * **Higher C** → Flatter price impact curve near equilibrium. * * * ### **Operational Best Practices**[​](https://docs.euler.finance/creator-tools/maglev/configuration/configure-asymmetric-concentration/#operational-best-practices "Direct link to operational-best-practices") | Scenario | Action | | --- | --- | | **Price > Equilibrium** | Broaden concentration on overvalued asset to reduce directional exposure. | | **Price < Equilibrium** | Tighten concentration on undervalued asset to capture arbitrage. | | **High Volatility** | Asymmetrically lower concentration on volatile asset (e.g., WETH). | **Critical notes**: * **Rebalancing**: Asymmetric concentrations require active monitoring. Use NAV and debt metrics to adjust strategies. * [**What is Asymmetric Concentration?**](https://docs.euler.finance/creator-tools/maglev/configuration/configure-asymmetric-concentration/#what-is-asymmetric-concentration) * [**Mathematical Foundation**](https://docs.euler.finance/creator-tools/maglev/configuration/configure-asymmetric-concentration/#mathematical-foundation) * [**Operational Best Practices**](https://docs.euler.finance/creator-tools/maglev/configuration/configure-asymmetric-concentration/#operational-best-practices) --- # Set Fees | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/maglev/configuration/fees/#__docusaurus_skipToContent_fallback) Setting swap fees is a critical step when configuring a new EulerSwap pool using Maglev. The fee parameter directly influences the earnings potential for liquidity providers, impacts trader behavior, and plays a role in managing risk and capital efficiency. ![](https://telosc.gitbook.io/maglev/~gitbook/image?url=https%3A%2F%2F455866866-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXAFUNoD0AMkdbOKUOJXa%252Fuploads%252FJnJF43EVtePjLQdof3SB%252Fezgif-5c80dc33a67dfe.gif%3Falt%3Dmedia%26token%3Dc5ada20a-7742-4090-be5b-4bee230c981c&width=768&dpr=4&quality=100&sign=439a6ed4&sv=2) Fees are from 0.001% to 3%. * * * * **Fee Collection:** Fees are automatically added to the collateral of the position or deducted from the debt position, thus increasing the NAV. * **Immutability:** Once set and the pool is deployed, the fee parameter cannot be changed. To adjust fees, you must redeploy the pool with the new configuration. * **Integration with Lending:** Because liquidity remains in Euler’s lending vaults, LPs earn both swap fees and lending yield simultaneously, maximizing capital efficiency --- # Set LTV | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/maglev/configuration/ltv/#__docusaurus_skipToContent_fallback) On this page The Loan-to-Value (LTV) ratio is a critical risk management parameter in EulerSwap's Maglev interface. It determines the maximum borrowing capacity against collateralized assets while balancing capital efficiency and liquidation risks **Adjust LTV Sliders:** * Separate sliders for each asset pair (e.g., USDC/WETH and WETH/USDC). * Real-time NAV (Net Asset Value) and debt indicators update dynamically ![](https://telosc.gitbook.io/maglev/~gitbook/image?url=https%3A%2F%2F455866866-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXAFUNoD0AMkdbOKUOJXa%252Fuploads%252FqaYKZFwpYNGg92qsdphC%252FLTV.gif%3Falt%3Dmedia%26token%3D291f26b2-2206-463b-a8da-768e81dbef00&width=768&dpr=4&quality=100&sign=1d426eb1&sv=2) * * * ### **Mathematical Foundation**[​](https://docs.euler.finance/creator-tools/maglev/configuration/ltv/#mathematical-foundation "Direct link to mathematical-foundation") LTV is calculated as: LTV\=BorrowedValueCollateralValue×100LTV=\\frac{Borrowed Value}{Collateral Value}×100LTV\=CollateralValueBorrowedValue​×100 For leveraged positions, Euler’s risk engine enforces: LTV This documentation was authored by [Telos Consilium](https://telosc.com/) > , a Web3 service provider mandated by the Euler team to create onboarding and educational materials for this product. > > If you're interested in integrating, experimenting with, or building on top of Euler Swap, feel free to reach out—we'll be happy to assist and guide you through the process. Overview ======== ![](https://telosc.gitbook.io/maglev/~gitbook/image?url=https%3A%2F%2F455866866-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXAFUNoD0AMkdbOKUOJXa%252Fuploads%252FWDenuUrtBwmY7VzLGmdf%252Fimage.png%3Falt%3Dmedia%26token%3D3b5a113f-eb6f-464d-9813-f71c31dc4621&width=768&dpr=4&quality=100&sign=c84eda65&sv=2) **Maglev** is a custom administrative interface designed for configuring and managing EulerSwap pools. It integrates with Euler’s lending protocol to enable dynamic liquidity provision while maintaining asset utilization within user accounts. Maglev is tailored for technical users—such as operators, market makers, and DAOs—who seek advanced control over their liquidity strategies and risk management **EulerSwap** is a new decentralized exchange (DEX) that leverages Euler’s lending infrastructure. Unlike traditional AMMs, funds are not locked in a shared pool but remain in the user’s account, continuing to earn lending interest and protocol rewards (e.g., rEUL tokens). This design enables greater capital efficiency and flexibility for liquidity providers Core Concepts ------------- ### Euler Maglev's key features, include:[​](https://docs.euler.finance/creator-tools/maglev/overview/#euler-maglevs-key-features-include "Direct link to Euler Maglev's key features, include:") * **Curve Configuration:** Allows setting an equilibrium price (market-aligned to minimize arbitrage losses), adjusting liquidity concentration (0-100%, where higher values mimic Uniswap v3-like concentrated ranges and lower values mimic constant product pools), and configuring adjustable swap fees. * **Swap:** Enables users to swaps with adjustable parameters (exact input/output), dynamically calculating price impact and slippage. * **Leveraged Market-Making:** Supports leveraged positions, such as depositing 250kUSDCtoloopborrow250k USDC to loop borrow 250kUSDCtoloopborrow650k and swap $400k USDT to build a balanced liquidity position. * **Contract Architecture:** Includes a Factory for deploying pools with immutable parameters, a Proxy Pattern for gas-efficient deployment, and support for JIT (Just In Time) swaps compatible with Uniswap v2-style callbacks. ### Target Audience[​](https://docs.euler.finance/creator-tools/maglev/overview/#target-audience "Direct link to Target Audience") Maglev is intended for: * **Administrators and operators** who manage liquidity pools and need fine-grained control over pool parameters. * **Market makers** who want to implement advanced strategies such as leveraged market-making and dynamic hedging. * **DAOs and token teams** seeking to bootstrap or manage protocol-owned liquidity. * **Sophisticated DeFi users** who wish to combine lending and swaps in their trading strategies * [Core Concepts](https://docs.euler.finance/creator-tools/maglev/overview/#core-concepts) * [Euler Maglev's key features, include:](https://docs.euler.finance/creator-tools/maglev/overview/#euler-maglevs-key-features-include) * [Target Audience](https://docs.euler.finance/creator-tools/maglev/overview/#target-audience) --- # Q&A Highlights | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/maglev/qa/#__docusaurus_skipToContent_fallback) On this page * Custom callbacks and flash swaps are supported for advanced integrations. * SDKs and libraries are being developed to ease integration and parameter management. * All code is open source in the [EulerSwap GitHub repo](https://github.com/euler-xyz/euler-swap) .; understanding may require familiarity with related Euler contracts (EVC, EVK). * * * ### Summary Table: EulerSwap vs Traditional AMMs[​](https://docs.euler.finance/creator-tools/maglev/qa/#summary-table-eulerswap-vs-traditional-amms "Direct link to Summary Table: EulerSwap vs Traditional AMMs") | Feature | EulerSwap | Uniswap V2/V3 | | --- | --- | --- | | Liquidity Source | User’s Euler account (not locked) | Separate pool contract | | Interest/Rewards | Earn lending interest + rewards | Only swap fees | | Curve Customization | Highly parameterizable, asymmetric | Fixed (v2), range (v3) | | Price Impact Control | Adjustable concentration parameter | Fixed (v2), user-set (v3) | | Risk Management | Vault-level LTV and liquidation | None (outside impermanent loss) | | Flash Swaps | Supported (JIT) | Supported | | Integration | Euler UI, Uniswap v4 hooks, SDK | Uniswap UI, SDK | | Gas Costs | ~2x Uniswap v3 | Lower | * [Summary Table: EulerSwap vs Traditional AMMs](https://docs.euler.finance/creator-tools/maglev/qa/#summary-table-eulerswap-vs-traditional-amms) --- # Technical Specifications | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/maglev/spec/#__docusaurus_skipToContent_fallback) On this page ### Smart Contract Architecture[​](https://docs.euler.finance/creator-tools/maglev/spec/#smart-contract-architecture "Direct link to Smart Contract Architecture") * **Factory Contract:** Deploys new swap pools with immutable curve parameters. * **Proxy Pattern:** Used for gas-efficient deployment. Each pool is a proxy instance with its own parameters and state. * **Main Swap Contract:** Handles swaps, enforces curve invariants, and supports flash swaps132. ### Gas Costs and Performance[​](https://docs.euler.finance/creator-tools/maglev/spec/#gas-costs-and-performance "Direct link to Gas Costs and Performance") * **Gas Costs:** Approximately 350,000–650,000 gas per swap (about 2x Uniswap v3), but still acceptable, especially on Layer 2 solutions132. * **Precision:** Uses direct fraction-based pricing, supporting tokens with 6–18 decimals132. ### SDK and Developer Tools[​](https://docs.euler.finance/creator-tools/maglev/spec/#sdk-and-developer-tools "Direct link to SDK and Developer Tools") * **JavaScript SDK and utilities:** Simplify integration and parameter calculation. * **Open Source:** All code is available in the EulerSwap GitHub repository * [Smart Contract Architecture](https://docs.euler.finance/creator-tools/maglev/spec/#smart-contract-architecture) * [Gas Costs and Performance](https://docs.euler.finance/creator-tools/maglev/spec/#gas-costs-and-performance) * [SDK and Developer Tools](https://docs.euler.finance/creator-tools/maglev/spec/#sdk-and-developer-tools) --- # Deployment & Management | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/vaults/euler-earn/deployment-and-management/#__docusaurus_skipToContent_fallback) On this page **EulerEarn** is a fork of MetaMorpho that provides a permissionless, role-based, and immutable way to curate yield strategies on top of ERC-4626 vaults. The recommended way to deploy and manage Earn vaults is via the [EulerEarn Creator UI](https://earn.euler.finance/) . Deployment Workflow ------------------- ![](https://docs.euler.finance/img/creator-tools/euler-earn/landing-page.png) **Figure 1:** The landing page of the EulerEarn Creator UI 1. **Dashboard & Quick Start** * Connect your wallet and set the network you want to deploy on to get started. * The landing page displays a list of all the vaults the connected address has a role (e.g., owner, curator). 2. **Vault Creation** * Click on "Deploy Vault" * Enter the asset address, vault name, symbol, and owner's address. * Click "Submit" to deploy your vault. 3. **Vault Configuration** * Once deployed, your vault will appear in the dashboard. Click on the EulerEarn vault you want to configure. * From here, you'll be able to see a quick overview of your vault and management tools at your disposal. * **Strategy**: Actions that allow you to modify how your EulerEarn strategy operates * **Roles**: Actions that allow you to set the roles * **Fee & Rewards**: Actions that allow you to define how much fees are charged and handled * **Security**: Set a timelock (by default, this is set to 0 days) Management Tools ---------------- ![](https://docs.euler.finance/img/creator-tools/euler-earn/vault-overview.png) **Figure 2:** The vault overview page ### Strategy[​](https://docs.euler.finance/creator-tools/vaults/euler-earn/deployment-and-management/#strategy "Direct link to Strategy") **Strategy Management** From here, an owner or a curator will be able to view the current strategies, add or remove strategies, and review pending removals and cap changes. If desired, they can accept or reject pending actions. If strategies have been added or removed, the supply and withdraw queues should be adjusted. **Change Supply Caps** From here, an owner or another curator can adjust caps for strategies. Useful for managing the different strategy exposures the vault. **Adjust Supply Queue** An owner or allocators will be able to adjust how user deposits will be allocated to the vault's underlying strategies. note If there is an escrow strategy, typically it should be assigned to the end of the queue. **Adjust Withdraw Queue** An owner or allocators will be able to adjust how user withdrawals will be taken from the vault's underlying strategies. note If there is an escrow strategy, typically it should be assigned to the front of the queue. **Reallocate Funds** An owner, a curator, or allocator will be able to reallocate how liquidity in the vault is allocated to the strategies. ### Roles[​](https://docs.euler.finance/creator-tools/vaults/euler-earn/deployment-and-management/#roles "Direct link to Roles") Each vault can be managed by several different addresses with a different role. **List of Roles** * **Owner**: Has global powers over the vault. This is initially set at creation-time. * **Curator**: Has the ability to add new markets, adjust supply caps, and reallocate liquidity. * **Guardian**: Has the ability to veto critical actions. * **Allocators**: Has the ability to reallocate liquidity and change withdrawal/supply queues. Vaults can have multiple allocators. ### Fee & Rewards[​](https://docs.euler.finance/creator-tools/vaults/euler-earn/deployment-and-management/#fee--rewards "Direct link to Fee & Rewards") **Performance Fee & Recipient** Under this page, the owner will be able to modify the performance fee they charge from the interest earned. Additionally, they can change where fees get sent to by changing the fee receiver. Valid fee ranges are 0% - 50%. ### Security[​](https://docs.euler.finance/creator-tools/vaults/euler-earn/deployment-and-management/#security "Direct link to Security") **Timelock** In this page, an owner can set a timelock for certain actions. Timelock lengths are represented in days and once set, cannot be set to 0. * [Deployment Workflow](https://docs.euler.finance/creator-tools/vaults/euler-earn/deployment-and-management/#deployment-workflow) * [Management Tools](https://docs.euler.finance/creator-tools/vaults/euler-earn/deployment-and-management/#management-tools) * [Strategy](https://docs.euler.finance/creator-tools/vaults/euler-earn/deployment-and-management/#strategy) * [Roles](https://docs.euler.finance/creator-tools/vaults/euler-earn/deployment-and-management/#roles) * [Fee & Rewards](https://docs.euler.finance/creator-tools/vaults/euler-earn/deployment-and-management/#fee--rewards) * [Security](https://docs.euler.finance/creator-tools/vaults/euler-earn/deployment-and-management/#security) --- # Use Case | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/maglev/use-case/#__docusaurus_skipToContent_fallback) On this page Deployment Configuration Summary -------------------------------- | Parameter | Value | Purpose | | --- | --- | --- | | **Capital** | $100k | USDC/USDT pair on Ethereum mainnet | | **Leverage** | 14.1x → 7.5x | Optimized for long liquidation horizon + bidirectional flexibility | | **Concentration** | 99.99% | Balanced price impact (less aggressive than 99.995% historical setups) | | **Fee Structure** | 0.001% (0.1bp) | Competitively undercuts Maverick while avoiding out-of-range liquidity | | **Price Anchor** | 0.999814 | Market equilibrium to prevent immediate arbitrage | Key Milestones -------------- With only **$100k NAV**: * **$2M Volume in 3 days** * **$1.35M swap facilitated**: [View on Etherscan](https://etherscan.io/tx/0xd5e5d6ddd6c78d5c5c38bea2878bf9c415968cd66abdf11a35b3156f42aa63ab) * **$700k swap facilitated**: [View on Etherscan](https://etherscan.io/address/0x3c0a7c7c090b4f1464d4ba7116e870fb41c5a8a8) ![TelosConsilium USDC/USDT Pool on Maglev UI](https://docs.euler.finance/assets/images/use-case-76a78b56ac28d8ec2644052fc450307f.png) _TelosConsilium USDC/USDT Pool on Maglev UI_ Key Technical Achievements -------------------------- ### 1\. Leverage Optimization[​](https://docs.euler.finance/creator-tools/maglev/use-case/#1-leverage-optimization "Direct link to 1. Leverage Optimization") * Initial 14.1x leverage with >1yr liquidation buffer * Mid-deployment shift to 7.5x for enhanced bidirectional swapping capacity ### 2\. Competitive Fee Strategy[​](https://docs.euler.finance/creator-tools/maglev/use-case/#2-competitive-fee-strategy "Direct link to 2. Competitive Fee Strategy") * 0.1bp fee undercut Maverick by 10x while maintaining in-range liquidity * Addressed competitor's "out-of-range" service limitation ### 3\. Anti-Arbitrage Mechanism[​](https://docs.euler.finance/creator-tools/maglev/use-case/#3-anti-arbitrage-mechanism "Direct link to 3. Anti-Arbitrage Mechanism") * Precision price anchor at 0.999814 * Zero immediate arbitrage volume post-launch (validated via Etherscan) * * * Interested in Euler Swap? ------------------------- This documentation was authored by **Telos Consilium**, a Web3 service provider mandated by the Euler team to create onboarding and educational materials for this product. If you're interested in integrating, experimenting with, or building on top of Euler Swap, feel free to reach out—we'll be happy to assist and guide you through the process. **[Contact us at Telos Consilium →](https://telosc.com/) ** * [Deployment Configuration Summary](https://docs.euler.finance/creator-tools/maglev/use-case/#deployment-configuration-summary) * [Key Milestones](https://docs.euler.finance/creator-tools/maglev/use-case/#key-milestones) * [Key Technical Achievements](https://docs.euler.finance/creator-tools/maglev/use-case/#key-technical-achievements) * [1\. Leverage Optimization](https://docs.euler.finance/creator-tools/maglev/use-case/#1-leverage-optimization) * [2\. Competitive Fee Strategy](https://docs.euler.finance/creator-tools/maglev/use-case/#2-competitive-fee-strategy) * [3\. Anti-Arbitrage Mechanism](https://docs.euler.finance/creator-tools/maglev/use-case/#3-anti-arbitrage-mechanism) * [Interested in Euler Swap?](https://docs.euler.finance/creator-tools/maglev/use-case/#interested-in-euler-swap) --- # Introduction | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/vaults/#__docusaurus_skipToContent_fallback) Vaults are the core primitive of the Euler protocol. They serve as modular, composable smart contracts that enable permissionless lending, borrowing, and yield aggregation. Each vault is an isolated pool of assets with its own risk parameters, governance, and configuration, allowing for a wide range of financial products — from simple lending pools to complex, governed credit markets and meta-vaults. Vaults can be either **governed** or **ungoverned**. Governed vaults are managed by risk curators or DAOs, who can adjust parameters and respond to market conditions. Ungoverned vaults, on the other hand, are immutable after deployment and place all risk management in the hands of users, with no external party able to intervene or change parameters. This duality allows for both curated, actively managed markets and fully permissionless, user-sovereign vaults. Vaults are designed for flexibility and security. They can be linked together to form markets or clusters, empowering developers, DAOs, and risk curators to build custom lending products, manage risk at a granular level, and innovate on top of a robust, open foundation. In Euler, vaults are not just containers for assets — they are the building blocks for the entire ecosystem, enabling new forms of DeFi composability and risk management. --- # Introduction | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/vaults/euler-earn/introduction/#__docusaurus_skipToContent_fallback) On this page **EulerEarn** is an open, permissionless protocol for curating and aggregating yield on top of ERC-4626 vaults. It is designed to make passive yield accessible to everyone, while enabling risk curators to manage strategies and allocations transparently and securely. Why Use EulerEarn? ------------------ * **Permissionless:** Curators, DAOs, and other parties can deploy and manage their own EulerEarn vault. * **Role-Based & Immutable:** Vaults are managed via granular roles, and all core contracts are immutable for maximum security. Curators can revoke roles for a fully immutable experience. * **Yield Aggregation:** Earn vaults allocate assets across multiple ERC-4626 strategies, optimizing yield and risk according to curator-defined parameters. * **User-Friendly:** The recommended [Earn Creator UI](https://earn.euler.finance/) guides you through deployment, configuration, and management. Further Reading --------------- * [**Developer Docs on EulerEarn**](https://docs.euler.finance/developers/euler-earn/) * [**User Guide on EulerEarn**](https://docs.euler.finance/user-guide/euler-earn) * [Why Use EulerEarn?](https://docs.euler.finance/creator-tools/vaults/euler-earn/introduction/#why-use-eulerearn) * [Further Reading](https://docs.euler.finance/creator-tools/vaults/euler-earn/introduction/#further-reading) --- # Overview | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/#__docusaurus_skipToContent_fallback) On this page Euler's modular and permissionless architecture gives developers, builders, and risk curators fine - tuned control over nearly every aspect of the protocol. The Creator Tools empower you to design, deploy, and manage custom financial products within the Euler ecosystem. Whether you're launching credit vaults or earn vaults, designing new governed or ungoverned credit markets, building a new oracle adapter, or deploying an EulerSwap operator, this section provides the essential documentation and tools to bring your ideas to life. What You'll Find Here --------------------- * **Vaults and Markets:** Deploy and manage credit vaults (EVK) or Euler Earn vaults, including deployment, management, and labeling. * **Oracles:** Build and deploy new oracle adapters and routers to feed accurate price data to credit vaults. * **Interest Rate Models:** Develop and customize interest rate models for vaults. * **Governance:** Tools and patterns for secure and flexible vaults governance. * **Liquidation Bot:** Deploy and operate bots to help process liquidations and secure the protocol. Each sub-section focuses on a key component of Euler's creator tools, with practical guides, code, and best practices. Continue to the relevant section to get started. Concepts -------- If you haven't already, we highly recommend you go through the [**Concepts**](https://docs.euler.finance/concepts/) section of our docs to better understand Euler and its tools. * [What You'll Find Here](https://docs.euler.finance/creator-tools/#what-youll-find-here) * [Concepts](https://docs.euler.finance/creator-tools/#concepts) --- # Overview | Euler Docs [Skip to main content](https://docs.euler.finance/developers/data-querying/#__docusaurus_skipToContent_fallback) On this page Euler V2 provides a modular architecture for accessing, analyzing, and visualizing protocol data. This section covers the technical approaches for extracting data from the protocol, whether you're developing dashboards, bots, risk assessment tools, or conducting research. Main Tools and Interfaces ------------------------- * **Lens Contracts:** On-chain read-only contracts that aggregate and expose protocol state for easy querying (e.g., balances, positions). * **Direct Contract Calls:** Query vaults, the EVC, and other core contracts directly using Solidity, web3 libraries or block explorers. * **Event Logs:** Listen to protocol events for real-time or historical data extraction. * **Subgraph & Indexers:** Use The Graph or similar tools for complex, cross-contract analytics and historical queries. What You'll Find in This Section -------------------------------- * How to use lens contracts for efficient on-chain data access * How to query vaults, the EVC, and sub-accounts directly * How to work with protocol events for analytics and monitoring * How to leverage off-chain tools (subgraph, Dune, custom indexers) * How to work with pull-based oracles like Pyth for both querying and transactions Special Considerations for Pull-Based Oracles --------------------------------------------- Some Euler V2 vaults rely on pull-based oracles like Pyth, which require special handling: * **Short staleness periods**: Prices are only valid for 2-3 minutes * **Manual updates required**: You must fetch and update prices before interactions * **Simulation for queries**: Use EVC's `batchSimulation` for data querying without executing transactions tip Euler V2's modular architecture means that data is often distributed across multiple contracts (vaults, EVC, periphery). This section will help you navigate and combine these sources for a complete picture. * [Main Tools and Interfaces](https://docs.euler.finance/developers/data-querying/#main-tools-and-interfaces) * [What You'll Find in This Section](https://docs.euler.finance/developers/data-querying/#what-youll-find-in-this-section) * [Special Considerations for Pull-Based Oracles](https://docs.euler.finance/developers/data-querying/#special-considerations-for-pull-based-oracles) --- # Contract Addresses | Euler Docs [Skip to main content](https://docs.euler.finance/developers/contract-addresses/#__docusaurus_skipToContent_fallback) On this page The contract addresses are fetched from the [euler-interfaces repository](https://github.com/euler-xyz/euler-interfaces/tree/master) you can also view them here along with their corresponding ABI and interface files. Networks -------- Select a network you would like to view contract addresses for: Loading networks... * [Networks](https://docs.euler.finance/developers/contract-addresses/#networks) --- # Deployment and Management | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/vaults/evk/deployment-and-management/#__docusaurus_skipToContent_fallback) On this page There are three main ways to deploy and manage **Euler Vault Kit (EVK)** vaults, each suited to different users and workflows: Foundry Scripts ([`euler-vault-scripts`](https://github.com/euler-xyz/euler-vault-scripts) ) -------------------------------------------------------------------------------------------- **Best for:** Power users, protocol developers, and those managing clusters or advanced configurations. * The [`euler-vault-scripts`](https://github.com/euler-xyz/euler-vault-scripts) repository provides a powerful, script-based approach for defining, deploying, and managing clusters of EVK vaults. It is ideal for advanced users who need more automation and support for complex market configurations, including governance contract integration and emergency operations. * Clusters are defined in Solidity scripts, allowing you to specify assets, LTVs, oracles, caps, IRMs, and more in a programmable way. The system supports delta management, so only changes are applied when updating an existing cluster. * The scripts are compatible with Safe multisigs, timelocks, and risk stewards, making them suitable for production deployments and DAO-managed markets. * For detailed usage, code snippets, and advanced management workflows, see the dedicated [`euler-vault-scripts` guide](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts) . Creator UI ([create.euler.finance](https://create.euler.finance/) ) ------------------------------------------------------------------- **Best for:** Quick deployments, experimentation, and non-technical users; simple clusters or single vaults. * The [create.euler.finance](https://create.euler.finance/) web interface is a bare-bones vault configurator. It lets you deploy new vaults without writing code, but each vault must be configured one by one, which can become tedious for large markets or clusters. * Not compatible with governance contracts — vaults configured to use [governor contracts](https://docs.euler.finance/developers/periphery/governors) cannot be managed via the Creator UI. * Guided forms let you select the asset, configure parameters, and deploy with a few clicks. * Ideal for testing, prototyping, or launching simple vaults or small clusters. * After deployment, you can manage the vault via the UI, but if you anticipate needing advanced features or governance integration, it's generally better to start with scripts right away—migrating from UI to script-based management can be time-consuming. Objective Labs Edge UI ([app.objectivelabs.io/edge](https://app.objectivelabs.io/edge) ) ---------------------------------------------------------------------------------------- **Best for:** Deploying simple ungoverned clusters (Edge vaults); not for governed or complex markets. * [Edge creator](https://app.objectivelabs.io/edge) is a tool for deploying and managing simple, ungoverned clusters of vaults — also known as Edge vaults. These vaults have fixed parameters and no active governor, making them suitable for "set it and forget it" use cases. * Not intended for deploying governed vaults or complex markets with advanced risk management. * Useful for DAOs, risk curators, and teams who want to quickly launch isolated, automated lending markets without ongoing governance. * For more on Edge vaults and ungoverned clusters, see [Vault Types](https://docs.euler.finance/concepts/risk/vault-types) . * [Foundry Scripts (`euler-vault-scripts`)](https://docs.euler.finance/creator-tools/vaults/evk/deployment-and-management/#foundry-scripts-euler-vault-scripts) * [Creator UI (create.euler.finance)](https://docs.euler.finance/creator-tools/vaults/evk/deployment-and-management/#creator-ui-createeulerfinance) * [Objective Labs Edge UI (app.objectivelabs.io/edge)](https://docs.euler.finance/creator-tools/vaults/evk/deployment-and-management/#objective-labs-edge-ui-appobjectivelabsioedge) --- # Objective Labs Edge UI Guide | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/vaults/evk/edge-ui/#__docusaurus_skipToContent_fallback) On this page The Objective Labs Edge UI ([app.objectivelabs.io/edge](https://app.objectivelabs.io/edge) ) provides a streamlined interface for constructing and deploying fully immutable lending vaults (Edge Markets) on Euler. While the principles are similar to the standard Creator UI, the Edge UI emphasizes simplicity, revision-based workflows, and the deployment of immutable markets. Landing Page: Quick Actions --------------------------- When you first access the Edge Deployer, you are presented with two main options: * **Create:** Start a new market configuration from scratch by selecting your target network (e.g., Ethereum, Berachain) and clicking "Create." * **Import:** Load a previously saved market configuration (revision) from a file. All your work is stored locally in your browser as "revisions," and every change is saved automatically. Market Creation Workflow ------------------------ After creating or importing a market, you enter the Edge Market draft workspace: * The top bar displays the current network, your wallet address, and navigation tabs (Edge, Oracles, Earn, Analytics). * The market is initially empty—click **Add Vaults** to select the ERC-20 tokens you want to support as vaults in your market. Vault Selection --------------- A modal allows you to search for and select tokens by symbol or address. You can add multiple vaults at once. Each selected token will appear as a vault in your market configuration. Note that once edge cluster is deployed, it is not possible to add new vaults to it. All of them must be deployed at once. Vault Configuration ------------------- For each vault, you must: * **Configure Oracle:** Set up the price feed for the vault's underlying asset. The UI will indicate if the oracle is not configured or invalid. * **Configure IRM:** Select and configure the interest rate model for the vault. _Note: Only adaptive curve IRMs are available for the Edge vaults._ * **Borrowable Toggle:** Choose whether the vault is borrowable or only available as collateral. LTV Matrix ---------- The Edge UI provides an LTV Matrix for configuring risk parameters. Set the **Liquidation LTV**. By default, the **LTV Buffer** is set to 2% making the **Borrow LTV** 2% percentage points lower that the **Liquidation LTV**. Deployment Checks & Warnings ---------------------------- Before deploying your market, the Edge UI runs a series of checks: * **Oracle Configuration:** All vaults must have valid oracles. The UI will warn you if any vault is missing or has an invalid oracle setup. * **IRM Configuration:** Each vault must have an interest rate model configured. * **LTV Checks:** The system checks for anomalies such as duplicate assets, excessively high or low LTVs, and buffer settings. You must resolve all critical warnings (e.g., `INVALID_ORACLE`) before deployment can proceed. Revision-Based Workflow ----------------------- * All changes are saved as local revisions in your browser. You can export/import configurations for backup or collaboration. * The UI is designed for rapid iteration and experimentation before finalizing and deploying your market. * [Landing Page: Quick Actions](https://docs.euler.finance/creator-tools/vaults/evk/edge-ui/#landing-page-quick-actions) * [Market Creation Workflow](https://docs.euler.finance/creator-tools/vaults/evk/edge-ui/#market-creation-workflow) * [Vault Selection](https://docs.euler.finance/creator-tools/vaults/evk/edge-ui/#vault-selection) * [Vault Configuration](https://docs.euler.finance/creator-tools/vaults/evk/edge-ui/#vault-configuration) * [LTV Matrix](https://docs.euler.finance/creator-tools/vaults/evk/edge-ui/#ltv-matrix) * [Deployment Checks & Warnings](https://docs.euler.finance/creator-tools/vaults/evk/edge-ui/#deployment-checks--warnings) * [Revision-Based Workflow](https://docs.euler.finance/creator-tools/vaults/evk/edge-ui/#revision-based-workflow) --- # Introduction | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/vaults/evk/introduction/#__docusaurus_skipToContent_fallback) On this page **The Euler Vault Kit (EVK)** is a powerful, modular framework for building credit vaults — permissionless, composable lending pools that form the foundation of the Euler protocol. EVK enables anyone to deploy and configure isolated lending vaults, each with its own risk parameters, governance, and supported assets. With the EVK, developers and risk curators can: * Launch new lending markets for any ERC-20 asset * Set custom risk parameters (LTVs, caps, oracles, IRMs) * Choose between governed or ungoverned vaults * Compose vaults into markets or clusters for cross-collateralization The modularity of EVK means you can build everything from simple, single-asset lending pools to complex, governed credit markets with advanced risk management. Whether you're a DAO, protocol, or independent builder, EVK gives you the tools to create, manage, and innovate on top of a robust, open lending infrastructure. Why Build on Euler? ------------------- One of the most powerful aspects of Euler is its flexibility: for example, both Aave and Morpho-style markets can be built on Euler, but not the other way around. With Euler, you have much more control over the product you're building. Aave, for example, is a monolithic system where adding a new collateral asset affects the risk of the entire market. This is because, unlike on Euler, you can't set the LTV (loan-to-value) level on an asset-to-asset basis (or, in Euler's case, vault-to-vault). On Euler, multiple vaults for the same asset can coexist, each with its own risk parameters. This granular control makes it trivial to create isolated pairs, as Morpho does, but with even more flexibility. Euler also makes it easier to bootstrap new markets, especially if you're willing to accept certain risks via cross-market collateral rehypothecation. For example, if you want to launch your own market on Ethereum mainnet and accept USDC as collateral, you can use the USDC vault from Euler Prime (managed by Euler DAO and Gauntlet) as collateral. This vault currently holds tens of millions in USDC and provides a stable interest rate plus incentives. As a result, borrowers in your new market can immediately offset their borrowing costs by earning a stable rate on their collateral, even if that collateral is managed by a different risk curator. Liquidations on Euler are also more nuanced. Instead of a fixed liquidation bonus, Euler uses an auction mechanism: the liquidation bonus grows as the health of a position deteriorates, so users aren't overly penalized for small violations. As a governor, you can define the maximum liquidation bonus for your vaults. Customization is another major advantage. With hooks, you can add extra access controls, KYC checks, custom accounting, and more. The hooking mechanism lets you tailor vault behavior to your needs. As a governor, you also have full control over the price source and interest rate models. If the defaults don't fit your use case, you can bring your own. Finally, you get all the benefits of the Ethereum Vault Connector (EVC) out of the box. Batching is a standout feature, allowing you to group multiple operations together—enabling things like one-click leverage, which is already live in the Euler UI. Another powerful but less-known feature is operators: users can delegate control of their account to any other Ethereum address, opening up a world of automation and advanced use cases. In short, Euler gives you the building blocks to create lending products with a level of control, composability, and innovation that simply isn't possible on other platforms. Before You Begin Successful vault deployment starts with careful planning. Decide which assets you want to support, which existing vaults (if any) you'll allow as collateral, and how your oracle/router will price assets. If you're new to Euler, review the [**core concepts**](https://docs.euler.finance/concepts/) to ensure you understand the architecture and risk model. UI Listing and Verification Only verified governed vaults and compliant ungoverned vaults are displayed on the official Euler UI. * [Why Build on Euler?](https://docs.euler.finance/creator-tools/vaults/evk/introduction/#why-build-on-euler) --- # Interest Rates | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/financial/interest-rates/#__docusaurus_skipToContent_fallback) On this page Introduction ------------ **Interest rates** are the heartbeat of Euler's lending protocol, driving the flow of capital between lenders and borrowers. Every time a transaction occurs in a block, borrowers pay interest on their outstanding loans, with this interest being compounded every second. The specific rate at any given moment is determined by an Interest Rate Model (IRM), which is unique to each credit vault in the protocol. Interest Rate Models (IRM) -------------------------- **Interest Rate Models (IRM)** are smart contracts that dynamically adjust rates based on the vault's current state. Their primary goal is to maintain a healthy balance between supply and demand, ensuring the protocol remains liquid and efficient. ### The Linear-Kink Model[​](https://docs.euler.finance/concepts/financial/interest-rates/#the-linear-kink-model "Direct link to The Linear-Kink Model") The **linear-kink model** is one of the most widely used interest rate models in Euler. It operates on a simple yet effective principle: interest rates increase gradually as utilization rises, but once utilization crosses a certain threshold, the rate spikes sharply. This design serves two important purposes: 1. It provides a smooth experience for users during normal market conditions 2. It creates a strong disincentive against over-utilization, protecting depositors' ability to withdraw their assets The model's parameters can be adjusted by risk curators to adapt to changing market conditions, making it flexible while maintaining its core protective function. ### The Reactive Rate Model[​](https://docs.euler.finance/concepts/financial/interest-rates/#the-reactive-rate-model "Direct link to The Reactive Rate Model") The **reactive rate model** takes a more dynamic approach to interest rate determination. Instead of responding only to the current utilization level, it considers the trend of utilization over time. This creates a more nuanced system where: * If utilization consistently exceeds the target threshold, interest rates will continue to rise until either borrowers repay their loans or new lenders provide additional liquidity * When utilization falls below the target, rates decrease automatically, making borrowing more attractive and encouraging capital efficiency This continuous adjustment mechanism helps maintain protocol stability while responding to market conditions in real-time. Fee Structure ------------- Euler implements a fee system that supports both the protocol's sustainability and its governance. By default, 10% of all borrowing interest is allocated as a fee, with this percentage being validated by the ProtocolConfig contract. The fee distribution is straightforward: * 5% goes to the Euler DAO * 5% goes to the vault governor What makes this fee structure particularly interesting is that fees are denominated in vault shares. This means that unwithdrawn fees continue to earn interest over time, creating a compounding effect that benefits both the protocol and its governance. Rate Dynamics in Practice ------------------------- The interaction between interest rates, utilization, and fees creates a self-balancing system. When demand for borrowing is high: 1. Utilization increases 2. Interest rates rise 3. Borrowers face higher costs 4. Lenders earn higher yields 5. The protocol collects more fees This cycle continues until either: * New lenders are attracted by the higher yields * Borrowers repay their loans due to increased costs * The market finds a new equilibrium * [Introduction](https://docs.euler.finance/concepts/financial/interest-rates/#introduction) * [Interest Rate Models (IRM)](https://docs.euler.finance/concepts/financial/interest-rates/#interest-rate-models-irm) * [The Linear-Kink Model](https://docs.euler.finance/concepts/financial/interest-rates/#the-linear-kink-model) * [The Reactive Rate Model](https://docs.euler.finance/concepts/financial/interest-rates/#the-reactive-rate-model) * [Fee Structure](https://docs.euler.finance/concepts/financial/interest-rates/#fee-structure) * [Rate Dynamics in Practice](https://docs.euler.finance/concepts/financial/interest-rates/#rate-dynamics-in-practice) --- # Risk Curators | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/risk/risk-curators/#__docusaurus_skipToContent_fallback) On this page **Risk curators** play a vital role in the Euler ecosystem, acting as guardians of protocol safety and efficiency. Their responsibilities vary depending on the type of vault they govern, but their core mission remains the same: to ensure the security and sustainability of the protocol while maximizing returns for depositors. Credit Vault Risk Management ---------------------------- In credit vaults, risk curators face the critical task of managing risk parameters to protect depositors while enabling efficient borrowing. Their primary goal is to ensure that borrowers remain over-collateralized at all times, maintaining the incentive to repay their loans in full. ### Collateral Selection[​](https://docs.euler.finance/concepts/risk/risk-curators/#collateral-selection "Direct link to Collateral Selection") The foundation of risk management begins with careful collateral selection. Risk curators must choose assets that are both liquid enough to be easily liquidated in times of distress and sufficiently correlated in price with the borrowed asset. This correlation helps prevent situations where volatile market conditions could push borrowers into under-collateralization. Poor collateral selection can expose depositors to bad debt risks, particularly if the underlying assets become difficult to price or liquidate. ### Loan-to-Value Management[​](https://docs.euler.finance/concepts/risk/risk-curators/#loan-to-value-management "Direct link to Loan-to-Value Management") Once collateral assets are selected, curators must establish appropriate loan-to-value (LTV) ratios. These ratios come in two forms: the maximum LTV, which caps how much users can borrow, and the liquidation LTV, which determines when a position becomes eligible for liquidation. The liquidation LTV is typically set higher than the maximum LTV, providing a buffer against immediate liquidations even if prices move against borrowers who have taken out maximum loans. Risk curators can adjust these LTV ratios over time through a process called LTV ramping. This mechanism allows for gradual changes to liquidation LTVs over a set duration, preventing sudden adjustments that could force immediate liquidations. The speed of these adjustments is at the curator's discretion, allowing for responsive risk management while protecting borrowers from unfair losses. ### Pricing and Oracle Selection[​](https://docs.euler.finance/concepts/risk/risk-curators/#pricing-and-oracle-selection "Direct link to Pricing and Oracle Selection") Accurate pricing is crucial for maintaining protocol safety. Risk curators must select appropriate pricing mechanisms and oracles to value both collateral and debt assets. While USD is the most common unit of account, curators can choose other units like ETH if more appropriate for the assets involved. Euler's oracle-agnostic approach gives curators flexibility in choosing their pricing providers. They can select from various options including Chainlink, Pyth, Redstone, Chronicle, and API3, and can implement either push or pull-based systems based on their specific needs. ### Supply and Borrow Caps[​](https://docs.euler.finance/concepts/risk/risk-curators/#supply-and-borrow-caps "Direct link to Supply and Borrow Caps") To manage risk exposure effectively, curators can implement supply and borrow caps. These caps limit how much of an asset can be deposited or borrowed, providing an additional layer of risk control. While these caps can be temporarily exceeded within a transaction batch, the system only allows transactions that reduce violations if the caps are exceeded at the start of a batch. ### Advanced Controls[​](https://docs.euler.finance/concepts/risk/risk-curators/#advanced-controls "Direct link to Advanced Controls") Risk curators have access to various hooks that enable additional custom rules and restrictions. These include pause guardians for crisis management, permissioned vaults for restricted access, flash loan fees, and utilization caps to prevent excessive borrowing from depleting liquidity. Earn Vault Risk Management -------------------------- In Earn vaults, risk curators take on a different role, focusing on optimizing returns while managing risk across various yield strategies. They act as intermediaries between passive lenders and yield-bearing products, both within Euler and externally. ### Strategy Management[​](https://docs.euler.finance/concepts/risk/risk-curators/#strategy-management "Direct link to Strategy Management") Risk curators have the authority to enable or disable specific yield-bearing vaults, directly influencing which yield opportunities are available to users. They must continuously monitor and assess the risk profiles of their vaults, making strategic adjustments to market allocations to optimize risk-adjusted yields. ### Liquidity Management[​](https://docs.euler.finance/concepts/risk/risk-curators/#liquidity-management "Direct link to Liquidity Management") A crucial aspect of Earn vault management is handling the flow of funds. Curators determine the order in which markets receive supply and handle withdrawals, directly affecting returns and liquidity for suppliers. This requires careful balancing of immediate returns against long-term stability. ### User Protection[​](https://docs.euler.finance/concepts/risk/risk-curators/#user-protection "Direct link to User Protection") To enhance security and trust, risk curators can implement timelocks on critical operations. These timelocks provide users with a window to react to potential changes in market parameters or roles, ensuring transparency and giving users time to make informed decisions about their positions. Security Considerations ----------------------- While risk curators have significant control over risk parameters and strategy management, it's important to note that they cannot withdraw user funds. This non-custodial nature of the vaults ensures that depositors maintain control over their assets. However, the effectiveness of risk management ultimately depends on the curator's decisions regarding collateral selection, LTV ratios, and oracle choices. Poor choices in these areas could potentially expose depositors to greater risk of bad debt. Users therefore place a degree of trust in risk curators to manage risks on their behalf through their control over risk parameters. This trust is earned through transparent decision-making, effective risk management, and consistent performance in protecting depositor interests while maximizing returns. * [Credit Vault Risk Management](https://docs.euler.finance/concepts/risk/risk-curators/#credit-vault-risk-management) * [Collateral Selection](https://docs.euler.finance/concepts/risk/risk-curators/#collateral-selection) * [Loan-to-Value Management](https://docs.euler.finance/concepts/risk/risk-curators/#loan-to-value-management) * [Pricing and Oracle Selection](https://docs.euler.finance/concepts/risk/risk-curators/#pricing-and-oracle-selection) * [Supply and Borrow Caps](https://docs.euler.finance/concepts/risk/risk-curators/#supply-and-borrow-caps) * [Advanced Controls](https://docs.euler.finance/concepts/risk/risk-curators/#advanced-controls) * [Earn Vault Risk Management](https://docs.euler.finance/concepts/risk/risk-curators/#earn-vault-risk-management) * [Strategy Management](https://docs.euler.finance/concepts/risk/risk-curators/#strategy-management) * [Liquidity Management](https://docs.euler.finance/concepts/risk/risk-curators/#liquidity-management) * [User Protection](https://docs.euler.finance/concepts/risk/risk-curators/#user-protection) * [Security Considerations](https://docs.euler.finance/concepts/risk/risk-curators/#security-considerations) --- # Labeling | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/vaults/labeling/#__docusaurus_skipToContent_fallback) On this page Labeling is an important part of the Euler ecosystem, providing human-readable metadata for vaults, entities, and markets. This metadata is used to enhance the dApp UI, making it easier for users to identify vaults, understand governance, and discover new markets. What Can Be Labeled? -------------------- * **Vaults:** Add names and descriptions to vaults for display in tables and dedicated pages. _Note: Only governed vaults can be labeled. Labeling is not supported for ungoverned or escrow vaults, as governance is required to ensure accountability and accurate metadata._ * **Entities:** Label DAOs, protocols, or organizations that govern or create vaults, including logos, descriptions, and social links. * **Products:** Group vaults under a product, with its own name, description, and logo. How to Submit Metadata ---------------------- 1. Fork the [euler-labels repository](https://github.com/euler-xyz/euler-labels) . 2. Add or update JSON files for your network (by chainId) in the appropriate directory: * `entities.json` for organizations * `vaults.json` for vaults * `products.json` for lending products * `points.json` for points programs (if applicable) 3. Add or update logos in the `logo/` directory (SVG/PNG preferred). 4. Run `npm run verify` to validate your changes. 5. Open a pull request to propose your changes for inclusion. For more details, see the [euler-labels README](https://github.com/euler-xyz/euler-labels/blob/master/README.md) . * [What Can Be Labeled?](https://docs.euler.finance/creator-tools/vaults/labeling/#what-can-be-labeled) * [How to Submit Metadata](https://docs.euler.finance/creator-tools/vaults/labeling/#how-to-submit-metadata) --- # Rewards | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/financial/rewards/#__docusaurus_skipToContent_fallback) On this page Euler offers a sophisticated rewards system that incentivizes participation in its vaults through both on-chain and off-chain mechanisms. These rewards are designed to provide additional value to participants, all while maintaining the protocol's efficiency and security. On-Chain Reward Streams ----------------------- At the heart of Euler's on-chain rewards system is the innovative Reward Streams module. This open-source solution represents a significant advancement in how DeFi protocols can distribute incentives. What makes it particularly interesting is its implementation of the billion-dollar algorithm, which enables the simultaneous distribution of multiple reward tokens in a permissionless and trustless manner. The beauty of Reward Streams lies in its flexibility and user-centric design. Unlike traditional staking mechanisms that require users to lock their assets in separate contracts, Reward Streams allows users to subscribe to their preferred rewards while maintaining full control of their positions. This means you can earn rewards while simultaneously taking out loans, creating a more dynamic and efficient way to participate in the protocol. Off-Chain Merkl Integration --------------------------- Complementing the on-chain rewards, Euler has integrated with [Merkl](https://merkl.angle.money/) to provide off-chain reward distribution. This integration offers a different approach to incentivizing participation, with campaigns that can target specific activities such as supplying assets, borrowing, or borrowing against particular collateral types. The Merkl system updates accumulated rewards approximately every 8-12 hours. What's particularly convenient is that these rewards can be claimed either through the Euler app or directly on the Merkl Dashboard, giving users flexibility in how they manage their rewards. How Rewards Work in Practice ---------------------------- When you supply or borrow from Euler vaults, if there's an active campaign, you're automatically eligible for Merkl rewards. These off-chain rewards are seamlessly integrated into your normal protocol interactions, requiring no additional steps to start earning. For Reward Streams, you'll need to actively opt-in to start receiving on-chain rewards. This opt-in process allows you to choose which reward streams you want to participate in, giving you control over your reward strategy. The rewards you earn can come from various sources and can be distributed in different tokens, depending on the specific campaigns and incentives active at any given time. This multi-token approach allows for a diverse range of incentives that can be tailored to different user preferences and market conditions. Maximizing Your Rewards ----------------------- To make the most of Euler's rewards system, it's important to understand how the different mechanisms work together. On-chain rewards through Reward Streams provide immediate, transparent distribution of incentives, while Merkl's off-chain rewards offer additional opportunities for earning through targeted campaigns. The key advantage of this dual approach is that it allows for more sophisticated reward strategies. Projects can choose the most appropriate method for their specific needs, whether that's the immediate, on-chain distribution of Reward Streams or the more flexible, campaign-based approach of Merkl. * [On-Chain Reward Streams](https://docs.euler.finance/concepts/financial/rewards/#on-chain-reward-streams) * [Off-Chain Merkl Integration](https://docs.euler.finance/concepts/financial/rewards/#off-chain-merkl-integration) * [How Rewards Work in Practice](https://docs.euler.finance/concepts/financial/rewards/#how-rewards-work-in-practice) * [Maximizing Your Rewards](https://docs.euler.finance/concepts/financial/rewards/#maximizing-your-rewards) --- # Strategy Profitability | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/financial/strategy-profitability/#__docusaurus_skipToContent_fallback) On this page Understanding the true profitability of your Euler strategies requires careful consideration of various factors beyond the surface-level returns. While the Euler interface provides clear visibility into your positions, it's crucial to understand how different costs and market dynamics can impact your actual profits. Understanding Strategy Costs ---------------------------- When you create a leveraged position on Euler, you'll encounter several types of costs that can significantly impact your strategy's profitability. The most significant of these are swap-related costs, which occur both when setting up and unwinding your position. ### Swap Costs[​](https://docs.euler.finance/concepts/financial/strategy-profitability/#swap-costs "Direct link to Swap Costs") Every leveraged position requires at least two swaps: one to convert your borrowed asset into collateral when creating the position, and another to convert collateral back to repay your loan when unwinding. These swaps come with several cost components: 1. **Price Impact**: The larger your swap size, the worse your average execution price will be. This is because you're moving the market with your trade. The Euler interface helps mitigate this by querying multiple aggregators to find the best overall quote. 2. **Swap Fees**: Each swap incurs a fee from the underlying DEX or aggregator. These fees typically range from 0.05% to 0.3% of the swap amount, depending on the protocol and pool used. Like other swap costs, these fees are amplified by your leverage. 3. **Slippage Tolerance**: This is your chosen tolerance for price movement between quote and execution. Setting this parameter requires careful consideration: * Too high: Your trade might be vulnerable to MEV bots * Too low: Your transactions might fail due to normal market fluctuations 4. **Leverage Amplification**: Remember that swap costs are applied to your position's nominal value, not just your initial capital. This means that with 5× leverage, your swap costs are effectively multiplied by 5, both when entering and exiting the position. ### Gas Costs[​](https://docs.euler.finance/concepts/financial/strategy-profitability/#gas-costs "Direct link to Gas Costs") Network conditions can significantly impact your strategy's profitability through gas costs. These costs are particularly important to consider for: * Short-term positions where gas costs might exceed profits * Positions that require frequent rebalancing * Strategies that involve multiple transactions ### Dynamic Rate Environment[​](https://docs.euler.finance/concepts/financial/strategy-profitability/#dynamic-rate-environment "Direct link to Dynamic Rate Environment") The interest rates and ROE values you see in the interface are snapshots of the current market conditions. These values can change due to: * Changes in vault utilization * Adjustments to interest rate models by governors * Modifications to reward programs * Market volatility affecting asset prices Analyzing Your Strategy ----------------------- When evaluating your strategy's performance, there are several factors to keep in mind: ### Reward Timing[​](https://docs.euler.finance/concepts/financial/strategy-profitability/#reward-timing "Direct link to Reward Timing") Merkl-distributed rewards typically lag by 8-12 hours. This means that new positions might appear less profitable than they actually are, as pending rewards haven't been processed yet. It's important to wait for a complete reward cycle before making final profitability assessments. ### Price Considerations[​](https://docs.euler.finance/concepts/financial/strategy-profitability/#price-considerations "Direct link to Price Considerations") The UI's Net Asset Value (NAV) calculations use market prices, which can differ from: * The actual prices you'll receive when executing trades * The prices used by the protocol for health checks * The pegged values of stablecoins For more accurate accounting, you can: 1. Hover over your position's dollar balance to see the precise underlying asset amounts 2. Use these underlying balances for calculations, assuming pegged values for stablecoins 3. Track interest accrual through the increasing underlying balances Best Practices -------------- To maximize your strategy's profitability: 1. **Monitor Market Conditions**: Keep track of: * Changes in interest rates * Updates to reward programs * Market volatility affecting your assets 2. **Optimize Entry and Exit**: Consider: * Market depth for your swap sizes * Gas costs relative to expected returns * The impact of leverage on swap costs 3. **Risk Management**: Always maintain: * Adequate health factor buffers * Awareness of liquidation risks * Understanding of your position's sensitivity to rate changes 4. **Long-term Perspective**: Remember that: * Short-term positions are more sensitive to setup costs * Reward programs may change over time * Market conditions can significantly impact returns * [Understanding Strategy Costs](https://docs.euler.finance/concepts/financial/strategy-profitability/#understanding-strategy-costs) * [Swap Costs](https://docs.euler.finance/concepts/financial/strategy-profitability/#swap-costs) * [Gas Costs](https://docs.euler.finance/concepts/financial/strategy-profitability/#gas-costs) * [Dynamic Rate Environment](https://docs.euler.finance/concepts/financial/strategy-profitability/#dynamic-rate-environment) * [Analyzing Your Strategy](https://docs.euler.finance/concepts/financial/strategy-profitability/#analyzing-your-strategy) * [Reward Timing](https://docs.euler.finance/concepts/financial/strategy-profitability/#reward-timing) * [Price Considerations](https://docs.euler.finance/concepts/financial/strategy-profitability/#price-considerations) * [Best Practices](https://docs.euler.finance/concepts/financial/strategy-profitability/#best-practices) --- # Return on Equity | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/financial/return-on-equity/#__docusaurus_skipToContent_fallback) On this page Introduction ------------ **Return on Equity (ROE)** is a crucial metric in Euler that helps users understand their overall yield relative to their invested capital. When you interact with Euler by depositing and borrowing assets, you earn Supply APY on your deposits while paying Borrow APY on your debts. ROE combines these factors to give you a clear picture of your position's performance. Understanding ROE ----------------- ROE is calculated by comparing your net earnings (after accounting for both supply and borrow rates) to your equity in the position. The formula is: ROE\=(Total Deposits×Net Supply APY)−(Total Debt×Net Borrow APY)Equity.\\text{ROE} = \\frac{( \\text{Total Deposits} \\times \\text{Net Supply APY}) - ( \\text{Total Debt} \\times \\text{Net Borrow APY})}{\\text{Equity}}.ROE\=Equity(Total Deposits×Net Supply APY)−(Total Debt×Net Borrow APY)​. What makes ROE particularly interesting in Euler is that it can be calculated in two different ways, depending on how you've structured your position. This flexibility allows you to evaluate your returns in the context that makes the most sense for your strategy. Ordinary Borrow Positions ------------------------- When you simply deposit collateral and borrow against it, your equity is measured as the total value of your deposits. This approach is most useful for understanding the cost of a standard loan. ### How It Works[​](https://docs.euler.finance/concepts/financial/return-on-equity/#how-it-works "Direct link to How It Works") In an ordinary borrow position, your equity is: Equity\=Total Deposits\\text{Equity} = \\text{Total Deposits}Equity\=Total Deposits Your ROE is: ROE\=Net Supply APY−Total DebtTotal Deposits×Net Borrow APY\\text{ROE} = \\text{Net Supply APY} - \\frac{\\text{Total Debt}}{\\text{Total Deposits}} \\times \\text{Net Borrow APY}ROE\=Net Supply APY−Total DepositsTotal Debt​×Net Borrow APY Since a user's Loan-to-Value (LTV) is their total debt divided by their total deposits, this simplifies to: ROE\=Net Supply APY−LTV×Net Borrow APY\\text{ROE} = \\text{Net Supply APY} - \\text{LTV} \\times \\text{Net Borrow APY}ROE\=Net Supply APY−LTV×Net Borrow APY ### Example[​](https://docs.euler.finance/concepts/financial/return-on-equity/#example "Direct link to Example") Suppose you deposit $1000 into ETH paying 6.5% Supply APY and borrow $800 USDC costing 4.5% Borrow APY. Your equity is: Equity\=$1000\\text{Equity} = \\$1000Equity\=$1000 Your ROE is: ROE\=6.5%−($800$1000)×4.5%\=2.9%\\text{ROE} = 6.5\\% - (\\frac{\\$800}{\\$1000}) \\times 4.5\\% = 2.9\\%ROE\=6.5%−($1000$800​)×4.5%\=2.9% Multiplied Positions -------------------- When you create a multiplied position, your equity is measured as the difference between your total deposits and total debts. This approach is particularly useful for evaluating yield farming strategies or long/short positions. ### How It Works[​](https://docs.euler.finance/concepts/financial/return-on-equity/#how-it-works-1 "Direct link to How It Works") In a multiplied position, your equity is: Equity\=Total Deposits−Total Debts\=Net Asset Value\\text{Equity} = \\text{Total Deposits} - \\text{Total Debts} = \\text{Net Asset Value}Equity\=Total Deposits−Total Debts\=Net Asset Value Your ROE is: ROE\=(Total Deposits×Net Supply APY)−(Total Debt×Net Borrow APY)Net Asset Value\\text{ROE} = \\frac{(\\text{Total Deposits} \\times \\text{Net Supply APY}) - (\\text{Total Debt} \\times \\text{Net Borrow APY})}{\\text{Net Asset Value}}ROE\=Net Asset Value(Total Deposits×Net Supply APY)−(Total Debt×Net Borrow APY)​ ### Example[​](https://docs.euler.finance/concepts/financial/return-on-equity/#example-1 "Direct link to Example") Suppose you deposit $200 into ETH paying 7.5% Supply APY and multiply 5× by shorting USDC, which has a 4.5% Borrow APY. Your total deposits and debts remain the same as the first example: Total Deposits\=$1000\\text{Total Deposits} = \\$1000Total Deposits\=$1000 Total Debts\=$800\\text{Total Debts} = \\$800Total Debts\=$800 Your equity is now: Equity\=$1000−$800\=$200\\text{Equity} = \\$1000 - \\$800 = \\$200Equity\=$1000−$800\=$200 Your ROE is now: ROE\=($1000×7.5%)−($800×4.5%)$200\=19.5%\\text{ROE} = \\frac{(\\$1000 \\times 7.5\\%) - (\\$800 \\times 4.5\\%)}{\\$200} = 19.5\\%ROE\=$200($1000×7.5%)−($800×4.5%)​\=19.5% Choosing the Right Calculation ------------------------------ The Euler interface allows you to toggle between these two ROE calculations because the context of your position matters. The same numbers can produce very different ROE values depending on whether you're: * Taking out a simple loan against your collateral * Creating a leveraged yield farming position * Managing a long/short strategy Best Practices -------------- When evaluating your ROE: 1. Consider your position's purpose when choosing the calculation method 2. Remember that higher leverage amplifies both gains and losses 3. Factor in all costs, including gas fees and potential liquidation risks 4. Monitor how changes in interest rates affect your ROE 5. Consider the impact of reward tokens on your overall returns 6. Be aware that ROE can change significantly as market conditions evolve * [Introduction](https://docs.euler.finance/concepts/financial/return-on-equity/#introduction) * [Understanding ROE](https://docs.euler.finance/concepts/financial/return-on-equity/#understanding-roe) * [Ordinary Borrow Positions](https://docs.euler.finance/concepts/financial/return-on-equity/#ordinary-borrow-positions) * [How It Works](https://docs.euler.finance/concepts/financial/return-on-equity/#how-it-works) * [Example](https://docs.euler.finance/concepts/financial/return-on-equity/#example) * [Multiplied Positions](https://docs.euler.finance/concepts/financial/return-on-equity/#multiplied-positions) * [How It Works](https://docs.euler.finance/concepts/financial/return-on-equity/#how-it-works-1) * [Example](https://docs.euler.finance/concepts/financial/return-on-equity/#example-1) * [Choosing the Right Calculation](https://docs.euler.finance/concepts/financial/return-on-equity/#choosing-the-right-calculation) * [Best Practices](https://docs.euler.finance/concepts/financial/return-on-equity/#best-practices) --- # Liquidations | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/risk/liquidations/#__docusaurus_skipToContent_fallback) On this page **Liquidations** are a crucial safety mechanism in Euler that helps maintain the protocol's solvency and protect lenders' deposits. When a borrower's position becomes undercollateralized, the liquidation process kicks in to ensure that debts are covered and the system remains stable. This process is automated, efficient, and designed to be fair to all participants. How Liquidations Work --------------------- When you borrow assets on Euler, you're required to maintain a certain level of collateral relative to your debt. If your position's risk-adjusted collateral value falls below its debt level, it becomes eligible for liquidation. This can happen when market prices move against your collateral, when interest accrual increases your debt, or when your health factor drops below the threshold. When a position becomes eligible for liquidation, liquidators can step in to take over the debt and receive the collateral at a discount. This discount is proportional to how undercollateralized the position is, and it's carefully set by vault creators to balance incentives without imposing excessive penalties on borrowers. The entire process is designed to maintain the protocol's stability while being fair to all participants. Liquidation Parameters ---------------------- Vault creators have several tools to fine-tune the liquidation process. The maximum discount parameter is particularly important as it determines how much incentive liquidators have to step in. This parameter needs to be set carefully - too high and it could lead to harmful liquidation spirals, too low and liquidators might not be motivated to act. An optional but recommended cool-off period can be implemented to prevent immediate liquidations after a user creates their borrow position. This period creates a short buffer that helps reduce the risk of certain attack types and stabilizes vaults, especially when using pull-based oracles. It ensures that liquidations only happen when truly needed, rather than due to momentary price shifts or market manipulation. By default, vaults have bad debt socialization enabled. This means that if a liquidated account's collateral doesn't fully cover its obligations, the remaining liability is shared across all depositors in the vault. This promotes vault-wide stability, though vault governors can disable this feature if they prefer alternative methods to manage bad debt. Important Why liquidation losses might increase when using Fixed Rate adapters? Fixed Rate adapters might value collateral differently from market prices. If collateral is priced lower than its market value, liquidation bonuses are calculated using this reduced rate. Consequently, liquidations could seize more collateral, amplifying user losses compared to market-based valuations. Liquidation Protection ---------------------- Euler offers several layers of protection against liquidations. The first layer comes from automated monitoring through MEV bots that actively search for liquidation opportunities. Euler Labs maintains an open-source liquidation bot, and partners operate additional bots for redundancy, ensuring the system remains responsive. For users who want more control, EVC operator protection provides a sophisticated way to manage liquidation risk. This system allows you to set custom stop-loss conditions, define specific reward structures, and specify slippage limits. It gives you the flexibility to manage your risk in ways that suit your specific needs and preferences. Best Practices -------------- To minimize liquidation risk, it's essential to maintain a comprehensive understanding of your position. This means keeping track of your health factor, watching market conditions that affect your collateral, and understanding how interest accrual impacts your debt over time. Maintaining adequate safety margins is crucial. This involves keeping sufficient collateral buffers, considering market volatility in your position sizing, and accounting for potential interest rate changes. Remember that the market can move quickly, and having these buffers in place can make the difference between a safe position and one that's at risk. Consider using the available protection tools to their full advantage. EVC operator protection can provide automated management (not yet available) of your position, and setting up alerts for health factor changes can give you early warning of potential issues. Always have a plan for adding collateral if needed, and make sure you understand how liquidation discounts, cool-off periods, and bad debt socialization work in your specific vault. Liquidation bot --------------- Since liquidation operations are profitable, MEV bots are incentivized to proactively search for liquidation opportunities. Euler Labs maintains an [open-source liquidation bot](https://github.com/euler-xyz/liquidation-bot-v2) operated by Euler Labs and other partners. * [How Liquidations Work](https://docs.euler.finance/concepts/risk/liquidations/#how-liquidations-work) * [Liquidation Parameters](https://docs.euler.finance/concepts/risk/liquidations/#liquidation-parameters) * [Liquidation Protection](https://docs.euler.finance/concepts/risk/liquidations/#liquidation-protection) * [Best Practices](https://docs.euler.finance/concepts/risk/liquidations/#best-practices) * [Liquidation bot](https://docs.euler.finance/concepts/risk/liquidations/#liquidation-bot) --- # Lens Contracts | Euler Docs [Skip to main content](https://docs.euler.finance/developers/data-querying/lens-contracts/#__docusaurus_skipToContent_fallback) On this page Lens contracts are specialized, read-only smart contracts designed to make it easy for developers and analysts to access and aggregate protocol data from Euler V2. They provide a convenient way to query on-chain state, combining information from multiple contracts into a single, structured response. Typically, lens contracts are meant for off-chain use only as they are not gas optimized. What Are Lens Contracts? ------------------------ In the context of Euler V2, lens contracts are part of the periphery codebase. They are not involved in protocol state changes or user funds, but instead serve as data aggregators and helpers for off-chain applications, dashboards, bots, and research tools. By using lens contracts, you can: * Retrieve comprehensive account and vault information in a single call * Access risk metrics, interest rates, caps, and configuration details * Query on-chain rewards data * Aggregate data across multiple vaults or accounts Euler provides several lens contracts, each focused on a specific aspect of the protocol: ### [`AccountLens`](https://github.com/euler-xyz/evk-periphery/blob/master/src/Lens/AccountLens.sol) [​](https://docs.euler.finance/developers/data-querying/lens-contracts/#accountlens "Direct link to accountlens") * **Purpose:** Aggregate all relevant information about a user account and its positions across vaults. * **What you can query:** * Account balances and shares in vaults * Borrowed amounts and debt positions * Collateral and controller status * On-chain reward and incentive data * Liquidity and risk metrics (e.g., time to liquidation) ### [`VaultLens`](https://github.com/euler-xyz/evk-periphery/blob/master/src/Lens/VaultLens.sol) [​](https://docs.euler.finance/developers/data-querying/lens-contracts/#vaultlens "Direct link to vaultlens") * **Purpose:** Provide detailed information about a specific vault. * **What you can query:** * Vault configuration and parameters (caps, fees, IRM, etc.) * Total assets, borrows, and shares * Collateral and their LTVs * Oracle and price data * Interest rate model details ### [`OracleLens`](https://github.com/euler-xyz/evk-periphery/blob/master/src/Lens/OracleLens.sol) [​](https://docs.euler.finance/developers/data-querying/lens-contracts/#oraclelens "Direct link to oraclelens") * **Purpose:** Expose information about price oracles and their configuration. * **What you can query:** * Oracle types and parameters ### [`IRMLens`](https://github.com/euler-xyz/evk-periphery/blob/master/src/Lens/IRMLens.sol) [​](https://docs.euler.finance/developers/data-querying/lens-contracts/#irmlens "Direct link to irmlens") * **Purpose:** Provide metadata and parameters for interest rate models (IRMs). * **What you can query:** * IRM type (e.g., Kink, Adaptive Curve) * Model parameters (base rate, slopes, kink point, etc.) ### [`UtilsLens`](https://github.com/euler-xyz/evk-periphery/blob/master/src/Lens/UtilsLens.sol) [​](https://docs.euler.finance/developers/data-querying/lens-contracts/#utilslens "Direct link to utilslens") * **Purpose:** Offer utility queries and helpers for vaults and tokens. * **What you can query:** * ERC-4626 vault info * APYs * Token balances and allowances * Indicative on-chain price lookups * Time to liquidation ### [`EulerEarnVaultLens`](https://github.com/euler-xyz/evk-periphery/blob/master/src/Lens/EulerEarnVaultLens.sol) [​](https://docs.euler.finance/developers/data-querying/lens-contracts/#eulerearnvaultlens "Direct link to eulerearnvaultlens") * **Purpose:** Specialized lens for Euler Earn vaults. * **What you can query:** * Strategy allocations and performance * Fee configuration * Reward and access control data Where to Find Lens Contracts ---------------------------- Lens contracts are part of the [EVK Periphery](https://github.com/euler-xyz/evk-periphery/src/Lens) repository. You can find their source code and deployment details there. For contract addresses, check out the [**Contract Addresses** page](https://docs.euler.finance/developers/contract-addresses) For more technical details, see the Solidity interfaces and structs in the periphery codebase, or explore the guides in this section for practical examples. * [What Are Lens Contracts?](https://docs.euler.finance/developers/data-querying/lens-contracts/#what-are-lens-contracts) * [`AccountLens`](https://docs.euler.finance/developers/data-querying/lens-contracts/#accountlens) * [`VaultLens`](https://docs.euler.finance/developers/data-querying/lens-contracts/#vaultlens) * [`OracleLens`](https://docs.euler.finance/developers/data-querying/lens-contracts/#oraclelens) * [`IRMLens`](https://docs.euler.finance/developers/data-querying/lens-contracts/#irmlens) * [`UtilsLens`](https://docs.euler.finance/developers/data-querying/lens-contracts/#utilslens) * [`EulerEarnVaultLens`](https://docs.euler.finance/developers/data-querying/lens-contracts/#eulerearnvaultlens) * [Where to Find Lens Contracts](https://docs.euler.finance/developers/data-querying/lens-contracts/#where-to-find-lens-contracts) --- # Creator UI Guide | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#__docusaurus_skipToContent_fallback) On this page Quick Start ----------- ### Deploying a Vault[​](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#deploying-a-vault "Direct link to Deploying a Vault") 1. Plan your vault architecture and collateral relationships. 2. Deploy or select an oracle router and unit of account. 3. Use the UI to create your vault(s) and point them to the oracle/router. 4. Configure LTVs, caps, and risk parameters. 5. Choose and set up governance. 6. Verify your vault for UI listing and add rewards. The **Creator UI** ([create.euler.finance](https://create.euler.finance/) ) provides a simple, web-based interface for deploying and managing EVK vaults. This guide walks you through the main screens and best practices. Landing Page ------------ When you first access the Creator UI, you'll see the **EVK Vault Manager** landing page. Here, you can choose to: * **Vault:** Manage or deploy a new EVK vault * **Oracle Router:** Manage or deploy an oracle router * **Deploy IRM:** Deploy a new interest rate model (IRM) Navigation links at the top let you switch between Oracle, Vault, Configure IRM, and Address Book. You can also select your network, view your wallet address, and check your ETH balance. Create Vault Screen ------------------- Clicking "Vault" brings you to the Create Vault screen, where you can: * **Select Underlying Asset:** Choose the ERC-20 token for your vault * **Select Oracle Router:** Choose the oracle router for price feeds * **Select Unit of Account:** Pick the unit of account (e.g., USD) Once all fields are filled, the "Create Vault" button will become active. tip The oracle router must be deployed before you can create a vault. Use the "Oracle Router" section to deploy one if needed. Cluster Best Practice If you're creating a cluster of vaults that will accept each other as collateral, use the same oracle router for all vaults in the cluster. This ensures consistent pricing and risk management. Managing an Existing Vault -------------------------- When you deploy a new vault or choose to manage an existing one, the Creator UI presents a detailed dashboard for configuring and maintaining your vault. This interface is designed to give governors the flexibility to adapt to changing market conditions, optimize risk, and ensure the vault operates safely and efficiently. Below is an overview of the main sections and parameters you can configure, along with best practices and references to the whitepaper for deeper understanding. ### Vault Info[​](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#vault-info "Direct link to Vault Info") This section displays immutable details about the vault, such as the vault symbol, address, underlying asset, oracle router, and unit of account. These parameters are set at creation and cannot be changed later. They provide essential context for the vault's operation and risk profile. ### Settings[​](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#settings "Direct link to Settings") * **Governor Admin:** The address with governance rights over the vault. Good practice is to transfer this role to a trusted multisig or governance contract after initial setup. Revoking governance (setting to `address(0)`) makes the vault immutable — do this only if you are confident no further changes will be needed. * **Fee Receiver:** The address that receives a share of the interest fees. This can be a treasury, DAO, or other beneficiary. Ensure this address is secure and under appropriate control. * **Interest Rate Model:** The contract that determines how interest rates are calculated. Choose a model that matches the risk and utilization profile of your vault. * **Supply Cap / Borrow Cap:** These parameters limit the total amount of assets that can be supplied to or borrowed from the vault. Setting reasonable caps is a key risk management tool — start conservatively and adjust as the vault grows. * **Interest Fee:** The fraction of interest allocated as protocol/governor fees. Balance protocol sustainability with curation fee; excessive fees may deter participation. * **Maximum Liquidation Discount:** Sets the upper bound on the discount offered to liquidators. Too high a discount can penalize borrowers; too low may fail to incentivize liquidations. * **Liquidation Cool Off Time:** The minimum time that must pass after a position becomes unhealthy before it can be liquidated. Use this to mitigate certain oracle manipulation attacks, but avoid setting it so high that it delays necessary liquidations. * **Debt Socialization:** If enabled, bad debt is socialized among all depositors in the event of insufficiently collateralized position that isn't liquidated in time. This can help prevent bank runs but may expose depositors to losses. ### Collaterals[​](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#collaterals "Direct link to Collaterals") **Add Collateral:** Here you can configure which other vaults' shares can be used as collateral, and set their Loan-to-Value (LTV) ratios. Only add collateral vaults that are well-audited, liquid, and have reliable price oracles. Set conservative LTVs, especially for volatile or less liquid assets. #### Adding and Configuring Collateral Assets[​](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#adding-and-configuring-collateral-assets "Direct link to Adding and Configuring Collateral Assets") When you add a new collateral to your vault, the UI will prompt you to set two key risk parameters: * **Liquidation LTV:** The maximum loan-to-value ratio at which a position can be liquidated. If a borrower's risk-adjusted collateral value falls below this threshold, their position becomes eligible for liquidation. * **Borrow LTV:** The maximum loan-to-value ratio at which new borrowing is permitted. This is typically set lower than the liquidation LTV to provide a safety buffer and reduce the risk of immediate liquidations after borrowing. #### Oracle Router Configuration[​](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#oracle-router-configuration "Direct link to Oracle Router Configuration") When adding a new collateral, it is essential that the oracle router configured for this vault can price the underlying asset of the collateral vault in terms of the vault's unit of account (for example, USD). This is managed via the **Set Oracle Configuration** option. If the oracle router cannot provide this price, borrowing against the collateral will not be possible. Additionally, the collateral vault must be "resolved" in the oracle router. This means the router must be able to price the shares of the collateral vault in terms of its underlying asset using the ERC-4626 `convertToAssets()` function. Use the **Add Resolved Vault to Oracle** option to register the collateral vault and enable this conversion. Without this step, the router cannot accurately determine the value of collateral shares. In summary: * **Set Oracle Configuration:** Ensure the oracle router can price the underlying asset of the collateral vault in the unit of account. * **Add Resolved Vault to Oracle:** Register the collateral vault so the router can convert its shares to its underlying asset using ERC-4626 logic. These steps are required for the vault to safely and accurately accept new collateral assets. By establishing both the share-to-underlying and underlying-to-unit-of-account pricing paths, the system can always determine the value of collateral shares in the unit of account. This is essential for correct risk checks, LTV calculations, and liquidations. #### Oracle Configuration[​](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#oracle-configuration "Direct link to Oracle Configuration") Before configuring oracle providers, check the [**Euler Oracles Dashboard**](https://oracles.euler.finance/) to see if there are existing oracles that meet your needs. The dashboard provides a comprehensive overview of all available oracles, their configurations, and their current status. Using an existing oracle can save time and reduce deployment complexity. ### Underlying Asset Oracle Config[​](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#underlying-asset-oracle-config "Direct link to Underlying Asset Oracle Config") The Oracle Config section allows you to configure the oracle for the underlying asset of your vault. It is essential that the router is able to price the vault's underlying asset in terms of the unit of account, such as USD. This pricing path — underlying to unit of account is fundamental for all risk management and debt valuation operations in the protocol. If the oracle router cannot provide this price, lending will not be possible. Important All oracle adapters used must conform to the `IPriceOracle` interface as described in the [**Price Oracles doc**](https://docs.euler.finance/concepts/core/price-oracles) . This ensures standardized, secure, and composable price feeds for all vault operations. ### Reward Streams[​](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#reward-streams "Direct link to Reward Streams") **Add to Reward Stream:** Permissionlessly add reward tokens to incentivize deposits in this vault. Euler supports on-chain, permissionless reward distribution directly to vault depositors. This allows anyone to incentivize participation by adding rewards in any ERC-20 token, with rewards distributed proportionally based on user balances. While this mechanism is powerful and trustless, it can be less flexible and more gas-intensive for complex or large-scale campaigns. **Recommended Approach:** It is recommended to use [Merkl](https://merkl.angle.money/) for reward distribution. Merkl is a widely adopted platform that enables flexible, gas-efficient, and transparent reward campaigns across many DeFi protocols, including Euler. It supports advanced features such as campaign scheduling, eligibility criteria, and analytics, making it easier to manage and optimize incentive programs. ### Hook Settings[​](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#hook-settings "Direct link to Hook Settings") **Hook Target & Operations:** Install a hook contract to add custom logic or restrictions to vault operations. You can selectively enable or disable hooks for operations such as `deposit`, `withdraw`, `mint`, `redeem`, `borrow`, `repay`, `transfer`, `liquidate`, and more. Hooks are powerful tools for implementing pause guardians, access controls, or custom business logic. However, poorly designed hooks can break vault functionality or introduce risk — always audit custom hooks and test thoroughly. Important By default, all operations are disabled and must be explicitly unhooked (enabled) before the vault can be used — even if no hook target is installed. If a hook target is installed, only the selected hooked operations will be customized by the external hook target logic; all other operations will follow standard vault logic. Managing Existing Vaults and Escrow ----------------------------------- * **Manage Existing Vault:** Enter a vault address to manage its configuration or view details. * **Deploy/Search Escrow:** Escrow Vaults are ungoverned vaults designed to act as simple, reusable collateral buckets (see [Vault Types](https://docs.euler.finance/concepts/risk/vault-types) ). There's usually no need to create new Escrow Vaults unless you need one for a new asset — existing Escrow Vaults can be reused by anyone in the ecosystem. note Not all non-borrowable vaults need to be ungoverned Escrow Vaults. You can also deploy governed vaults that are initially non-borrowable. If you configure such a vault with an oracle router and the appropriate unit of account, you can enable borrowing functionality later on. This provides flexibility for future upgrades or changes in vault strategy. * [Quick Start](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#quick-start) * [Deploying a Vault](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#deploying-a-vault) * [Landing Page](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#landing-page) * [Create Vault Screen](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#create-vault-screen) * [Managing an Existing Vault](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#managing-an-existing-vault) * [Vault Info](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#vault-info) * [Settings](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#settings) * [Collaterals](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#collaterals) * [Underlying Asset Oracle Config](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#underlying-asset-oracle-config) * [Reward Streams](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#reward-streams) * [Hook Settings](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#hook-settings) * [Managing Existing Vaults and Escrow](https://docs.euler.finance/creator-tools/vaults/evk/creator-ui/#managing-existing-vaults-and-escrow) --- # euler-vault-scripts Guide | Euler Docs [Skip to main content](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#__docusaurus_skipToContent_fallback) On this page The [`euler-vault-scripts`](https://github.com/euler-xyz/euler-vault-scripts) repository provides a robust, script-based framework for deploying, configuring, and managing clusters of EVK vaults. It is the recommended tool for advanced users, DAOs, and protocol developers who need automation and support for complex, governed markets. What is a Cluster? ------------------ A cluster is a collection of vaults that accept each other as collateral and share a common governor. Clusters are defined and managed in Solidity scripts, enabling programmable, auditable, and reproducible market deployments. Key Features ------------ * Automated deployment and delta management * Support for Safe multisigs, timelocks, and risk stewards * Batching, emergency operations, and governance contract integration Defining a Cluster: Example --------------------------- Below are annotated snippets from a typical cluster script (`Cluster.s.sol`). ### 1\. Define Cluster Assets[​](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#1-define-cluster-assets "Direct link to 1. Define Cluster Assets") function defineCluster() internal override { // List the assets for which vaults will be deployed cluster.assets = [WETH, USDC, USDT, sUSDS];} _This sets up the vaults in your cluster. Each asset will have its own vault. Do not define more than one vault per asset._ ### 2\. Configure Cluster Parameters[​](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#2-configure-cluster-parameters "Direct link to 2. Configure Cluster Parameters") function configureCluster() internal override { // Set the governor addresses for vaults and oracle routers cluster.oracleRoutersGovernor = getDeployer(); cluster.vaultsGovernor = getDeployer(); // Set the unit of account (e.g., USD) cluster.unitOfAccount = USD; // Set protocol-wide parameters cluster.feeReceiver = address(0); cluster.interestFee = 0.1e4; // 1% cluster.maxLiquidationDiscount = 0.15e4; // 1.5% cluster.liquidationCoolOffTime = 1; // seconds // Set hooks, config flags, etc. as needed cluster.hookTarget = address(0); cluster.hookedOps = 0; cluster.configFlags = 0;} _This block configures governance, risk, and operational parameters for the cluster. You can override parameters per asset if needed._ ### 3\. Set Oracle Providers[​](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#3-set-oracle-providers "Direct link to 3. Set Oracle Providers") // Assign oracle adapters or external vaults for each assetcluster.oracleProviders[WETH ] = "0x10674C8C1aE2072d4a75FE83f1E159425fd84E1D";cluster.oracleProviders[USDC ] = "0x6213f24332D35519039f2afa7e3BffE105a37d3F";cluster.oracleProviders[USDT ] = "0x587CABe0521f5065b561A6e68c25f338eD037FF9";cluster.oracleProviders[sUSDS] = "ExternalVault|0xD0dAb9eDb2b1909802B03090eFBF14743E7Ff967"; _Each asset must have a price source. For underlying assets being ERC-4626 vaults, use the `ExternalVault|` prefix to resolve via `convertToAssets`._ Before configuring oracle providers, check the [Euler Oracles Dashboard](https://oracles.euler.finance/) to see if there are existing oracles that meet your needs. The dashboard provides a comprehensive overview of all available oracles, their configurations, and their current status. Using an existing oracle can save time and reduce deployment complexity. ### 4\. Set Supply and Borrow Caps[​](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#4-set-supply-and-borrow-caps "Direct link to 4. Set Supply and Borrow Caps") cluster.supplyCaps[WETH ] = 10_000;cluster.supplyCaps[USDC ] = 10_000_000;cluster.supplyCaps[USDT ] = 10_000_000;cluster.supplyCaps[sUSDS] = 10_000_000;cluster.borrowCaps[WETH ] = 9_000;cluster.borrowCaps[USDC ] = 9_000_000;cluster.borrowCaps[USDT ] = 9_000_000;cluster.borrowCaps[sUSDS] = type(uint256).max; // no cap _Caps control the maximum supply and borrowable amounts for each vault._ ### 5\. Assign Interest Rate Models (IRMs)[​](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#5-assign-interest-rate-models-irms "Direct link to 5. Assign Interest Rate Models (IRMs)") uint256[4] memory irmETH = [uint256(0), uint256(194425692), uint256(41617711740), uint256(3865470566)];uint256[4] memory irmUSD = [uint256(0), uint256(399976852), uint256(39767751304), uint256(3865470566)];cluster.kinkIRMParams[WETH ] = irmETH;cluster.kinkIRMParams[USDC ] = irmUSD;cluster.kinkIRMParams[USDT ] = irmUSD; _Interest rate models are set per asset. Use the provided scripts/utilities or [Creator UI](https://create.euler.finance/configure-irm) to generate IRM parameters as needed._ ### 6\. Configure LTVs and Liquidation Parameters[​](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#6-configure-ltvs-and-liquidation-parameters "Direct link to 6. Configure LTVs and Liquidation Parameters") // Liquidation LTV matrix: columns = liability vaults, rows = collateral vaultscluster.ltvs = [ // WETH USDC USDT sUSDS [uint16(0.00e4), 0.85e4, 0.85e4, 0.00e4], // WETH [uint16(0.87e4), 0.00e4, 0.95e4, 0.00e4], // USDC [uint16(0.87e4), 0.95e4, 0.00e4, 0.00e4], // USDT [uint16(0.87e4), 0.95e4, 0.95e4, 0.00e4] // sUSDS]; ### 7\. Configure Spread LTV[​](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#7-configure-spread-ltv "Direct link to 7. Configure Spread LTV") // Set the spread LTV for the entire clustercluster.spreadLTV = 0.02e4; // 2% spread _The spread LTV represents the difference between the liquidation threshold and the maximum LTV for all assets in the cluster. This creates a buffer zone before liquidation can occur, providing protection against immediate liquidations when positions approach their maximum LTV._ Environment Setup and Running Scripts ------------------------------------- ### Prerequisites[​](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#prerequisites "Direct link to Prerequisites") 1. Install Foundry: curl -L https://foundry.paradigm.xyz | bashfoundryup 2. Clone the repository: git clone https://github.com/euler-xyz/euler-vault-scripts.gitcd euler-vault-scripts 3. Prepare the `.env` file using `.env.example` as a template. Define the RPC URLs for all the chain IDs you need. 4. Install dependencies: ./install.sh 5. Compile the contracts: forge clean && forge compile ### Running Scripts[​](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#running-scripts "Direct link to Running Scripts") Use the `ExecuteSolidityScript.sh` script to run the management script: ./script/ExecuteSolidityScript.sh script/clusters/[CLUSTER_FILE] [options] Replace `[CLUSTER_FILE]` with your cluster-specific file name (e.g., `Cluster.s.sol`). #### Important Options:[​](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#important-options "Direct link to Important Options:") * `--dry-run`: Simulates the script without executing transactions * `--rpc-url URL|CHAIN_ID`: Required if `DEPLOYMENT_RPC_URL` not defined in `.env` * `--account ACCOUNT` or `--ledger`: Required if `DEPLOYER_KEY` not defined in `.env` * `--batch-via-safe`: Creates a batch payload file for Safe multisig execution * `--safe-address SAFE_ADDRESS`: Authorized Safe multisig address * `--timelock-address`: Schedules transactions in the timelock controller * `--risk-steward-address`: Executes transactions via the risk steward contract #### Example Commands:[​](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#example-commands "Direct link to Example Commands:") Initial deployment: ./script/ExecuteSolidityScript.sh ./script/clusters/Cluster.s.sol --account DEPLOYER --rpc-url 1 Managing a deployed cluster with governance contracts: ./script/ExecuteSolidityScript.sh ./script/clusters/Cluster.s.sol --batch-via-safe --safe-address DAO --timelock-address wildcard --rpc-url 1 ### Important Notes[​](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#important-notes "Direct link to Important Notes") * Always use `--dry-run` first to simulate transactions and check for potential issues * Environment variables in `.env` take precedence over command line arguments * After deployment, commit the generated `.json` files in the scripts directory as they serve as the deployed contracts addresses cache Further Reading & References ---------------------------- * [euler-vault-scripts README](https://github.com/euler-xyz/euler-vault-scripts/blob/master/README.md) * [Cluster.s.sol example](https://github.com/euler-xyz/euler-vault-scripts/blob/master/script/clusters/Cluster.s.sol) * [What is a Cluster?](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#what-is-a-cluster) * [Key Features](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#key-features) * [Defining a Cluster: Example](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#defining-a-cluster-example) * [1\. Define Cluster Assets](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#1-define-cluster-assets) * [2\. Configure Cluster Parameters](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#2-configure-cluster-parameters) * [3\. Set Oracle Providers](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#3-set-oracle-providers) * [4\. Set Supply and Borrow Caps](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#4-set-supply-and-borrow-caps) * [5\. Assign Interest Rate Models (IRMs)](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#5-assign-interest-rate-models-irms) * [6\. Configure LTVs and Liquidation Parameters](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#6-configure-ltvs-and-liquidation-parameters) * [7\. Configure Spread LTV](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#7-configure-spread-ltv) * [Environment Setup and Running Scripts](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#environment-setup-and-running-scripts) * [Prerequisites](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#prerequisites) * [Running Scripts](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#running-scripts) * [Important Notes](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#important-notes) * [Further Reading & References](https://docs.euler.finance/creator-tools/vaults/evk/euler-vault-scripts/#further-reading--references) --- # Querying Off-Chain Prices | Euler Docs [Skip to main content](https://docs.euler.finance/developers/data-querying/off-chain-prices/#__docusaurus_skipToContent_fallback) On this page When building analytics tools, dashboards, or performing off-chain calculations (such as collateral market value), you often need up-to-date asset prices. Euler provides an internal API endpoint that can be used to fetch prices for supported assets. The Euler Price API Endpoint ---------------------------- You can query asset prices using the following endpoint: https://app.euler.finance/api/v1/price?chainId=1&assets=ASSET_ADDRESS * `chainId=1` specifies Ethereum mainnet. * `assets` is a comma-separated list of asset addresses (ERC-20 tokens) ### Example: Single Asset[​](https://docs.euler.finance/developers/data-querying/off-chain-prices/#example-single-asset "Direct link to Example: Single Asset") To get the price for wstETH (address: `0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0`): https://app.euler.finance/api/v1/price?chainId=1&assets=0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 ### Example: Multiple Assets[​](https://docs.euler.finance/developers/data-querying/off-chain-prices/#example-multiple-assets "Direct link to Example: Multiple Assets") To get prices for wstETH and WETH: https://app.euler.finance/api/v1/price?chainId=1&assets=0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0,0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 Limitations and Notes --------------------- * **Not all assets may be supported.** If the endpoint does not return a price for a given asset, you will need to use your own price source. * **Unofficial endpoint:** This API is not officially documented and may be subject to change or rate limits. * **Price units:** Prices are typically returned in USD with 18 decimals (1e18 = $1.00), but always check the response format. tip Always validate the returned prices and have a fallback in case the API does not return a value for your asset. Context: Why Use Off-Chain Prices? ---------------------------------- In some cases, protocol risk managers configure oracles that do not directly reflect the current market price. For example, they may use hardcoded values for certain assets, or rely on oracles (such as Chainlink) that are naturally lagging behind the market due to heartbeat intervals or update thresholds. This means the on-chain price used for risk management and liquidations may differ from the real-time market price. For analytics, risk assessment, or user interfaces, you may want to use a more up-to-date or market-reflective price. Off-chain prices can help you calculate the real-time market value of a collateral position and provide users with more accurate portfolio valuations. * [The Euler Price API Endpoint](https://docs.euler.finance/developers/data-querying/off-chain-prices/#the-euler-price-api-endpoint) * [Example: Single Asset](https://docs.euler.finance/developers/data-querying/off-chain-prices/#example-single-asset) * [Example: Multiple Assets](https://docs.euler.finance/developers/data-querying/off-chain-prices/#example-multiple-assets) * [Limitations and Notes](https://docs.euler.finance/developers/data-querying/off-chain-prices/#limitations-and-notes) * [Context: Why Use Off-Chain Prices?](https://docs.euler.finance/developers/data-querying/off-chain-prices/#context-why-use-off-chain-prices) --- # Developer Guide | Euler Docs [Skip to main content](https://docs.euler.finance/developers/#__docusaurus_skipToContent_fallback) On this page Welcome to the Euler V2 Developer Guide! This section is your comprehensive resource for building on top of or integrating with the Euler V2 protocol. Whether you're looking to create custom lending vaults, integrate lending capabilities into your dApp, or build advanced financial products, this guide will help you get started. Getting Started --------------- Before diving into development, we recommend: 1. Understanding the [core concepts](https://docs.euler.finance/concepts/) of Euler V2 2. Setting up your [development environment](https://docs.euler.finance/developers/getting-started) 3. Exploring the [contract addresses](https://docs.euler.finance/developers/contract-addresses) Development Resources --------------------- * [Contract Addresses](https://docs.euler.finance/developers/contract-addresses) ### Ethereum Vault Connector[​](https://docs.euler.finance/developers/#ethereum-vault-connector "Direct link to Ethereum Vault Connector") * [Overview](https://docs.euler.finance/developers/evc/) * [Integration Guide](https://docs.euler.finance/developers/evc/integration-guide) * [EVC Utils](https://docs.euler.finance/developers/evc/evc-utils) ### Euler Vault Kit[​](https://docs.euler.finance/developers/#euler-vault-kit "Direct link to Euler Vault Kit") * [Overview](https://docs.euler.finance/developers/evk/) * [Interacting with Vaults](https://docs.euler.finance/developers/evk/interacting-with-vaults) * [Creating & Managing Vaults](https://docs.euler.finance/developers/evk/creating-managing-vaults) * [Hooks & Custom Logic](https://docs.euler.finance/developers/evk/hooks-custom-logic) ### EulerSwap[​](https://docs.euler.finance/developers/#eulerswap "Direct link to EulerSwap") * [Overview](https://docs.euler.finance/developers/euler-swap/) * [Comparison with Traditional AMMs](https://docs.euler.finance/developers/euler-swap/comparison) * [How EulerSwap Works](https://docs.euler.finance/developers/euler-swap/how-it-works) * [LP Considerations](https://docs.euler.finance/developers/euler-swap/lp-considerations) ### EulerEarn[​](https://docs.euler.finance/developers/#eulerearn "Direct link to EulerEarn") * [Overview](https://docs.euler.finance/developers/euler-earn/) * [Integrator Guide](https://docs.euler.finance/developers/euler-earn/integrator-guide) * [Allocator & Manager Handbook](https://docs.euler.finance/developers/euler-earn/allocator-handbook) ### Periphery[​](https://docs.euler.finance/developers/#periphery "Direct link to Periphery") * [Factories](https://docs.euler.finance/developers/periphery/factories) * [Factory Governor](https://docs.euler.finance/developers/periphery/factory-governor) * [Governors](https://docs.euler.finance/developers/periphery/governors) * [Swaps](https://docs.euler.finance/developers/periphery/swaps) * [Orderflow Router](https://docs.euler.finance/developers/periphery/orderflow-router) ### Data Querying[​](https://docs.euler.finance/developers/#data-querying "Direct link to Data Querying") * [Data Querying Overview](https://docs.euler.finance/developers/data-querying/) * [Lens Contracts](https://docs.euler.finance/developers/data-querying/lens-contracts) * [Using Lens Contracts](https://docs.euler.finance/developers/data-querying/using-lens-contracts) * [Subgraphs](https://docs.euler.finance/developers/data-querying/subgraphs) * [Off-Chain Prices](https://docs.euler.finance/developers/data-querying/off-chain-prices) ### Oracles[​](https://docs.euler.finance/developers/#oracles "Direct link to Oracles") * [Euler Price Oracle Repositiory](https://github.com/euler-xyz/euler-price-oracle) ### Liquidations[​](https://docs.euler.finance/developers/#liquidations "Direct link to Liquidations") * [Liquidation Bot Repository](https://github.com/euler-xyz/liquidation-bot-v2) * [Getting Started](https://docs.euler.finance/developers/#getting-started) * [Development Resources](https://docs.euler.finance/developers/#development-resources) * [Ethereum Vault Connector](https://docs.euler.finance/developers/#ethereum-vault-connector) * [Euler Vault Kit](https://docs.euler.finance/developers/#euler-vault-kit) * [EulerSwap](https://docs.euler.finance/developers/#eulerswap) * [EulerEarn](https://docs.euler.finance/developers/#eulerearn) * [Periphery](https://docs.euler.finance/developers/#periphery) * [Data Querying](https://docs.euler.finance/developers/#data-querying) * [Oracles](https://docs.euler.finance/developers/#oracles) * [Liquidations](https://docs.euler.finance/developers/#liquidations) --- # Getting Lists of Verified Vaults | Euler Docs [Skip to main content](https://docs.euler.finance/developers/data-querying/perspectives/#__docusaurus_skipToContent_fallback) On this page Perspectives are on-chain contracts that encode rules for verifying and filtering Euler vaults. They are the primary tool for developers, analysts, and integrators who want to obtain lists of safe, curated, or otherwise trusted vaults for use in dashboards, analytics, or integrations. The Role of `governedPerspective` --------------------------------- While the Perspectives system is designed to support a wide range of on-chain rule checking and automated curation, in practice, the vast majority of vaults currently displayed in the Euler UI are those that have been manually verified and included in the `governedPerspective`. This perspective is maintained by the Euler Labs team and acts as the primary source of truth for which vaults are considered safe and production-ready. Other perspectives exist and can be used for custom or experimental filtering, but have seen little adoption so far. For most users and integrators, the `governedPerspective` is the main perspective to rely on for vault verification. How to Use Perspectives to Get Verified Vaults ---------------------------------------------- 1. **Get the List of Verified Vaults** * Use the `verifiedArray()` function on the `governedPerspective` contract (or any other perspective contract) to get all vaults that have been verified and approved. * Example: const verifiedVaults = await governedPerspectiveContract.verifiedArray();// Use this list to filter vaults in your queries 2. **Check if a Vault is Verified** * Use the `isVerified(vaultAddress)` function to check if a specific vault is included in the governed perspective. const isSafe = await governedPerspectiveContract.isVerified(vaultAddress); 3. **Filter Data from Subgraphs or Lenses** * When querying vaults from the subgraph or lens contracts, filter your results to only include those in the `governedPerspective` verified list. This ensures you are working with vaults that have been whitelisted either by the Euler Labs team or automatically based on encoded on-chain rules (depending on the perspective type) * [The Role of `governedPerspective`](https://docs.euler.finance/developers/data-querying/perspectives/#the-role-of-governedperspective) * [How to Use Perspectives to Get Verified Vaults](https://docs.euler.finance/developers/data-querying/perspectives/#how-to-use-perspectives-to-get-verified-vaults) --- # Vault Types | Euler Docs [Skip to main content](https://docs.euler.finance/concepts/risk/vault-types/#__docusaurus_skipToContent_fallback) On this page Introduction ------------ In the dynamic world of Euler's lending ecosystem, vault types serve as trusted classifications that help users navigate the complex landscape of lending opportunities. These classifications aren't just labels - they're verified through a sophisticated system of smart contracts called 'perspectives' that act as on-chain validators. Think of perspectives as digital inspectors that verify whether a vault, and all the vaults it's connected to through its collaterals, meet specific safety and functionality criteria. How Perspectives Work --------------------- Perspectives are smart contracts that act as on-chain validators, implementing a standardized interface to: * Verify vault configurations (`perspectiveVerify`) * Check if a vault has been verified (`isVerified`) * Keep track of all verified vaults (`verifiedArray`) The beauty of this system is that once a vault is verified, this information is cached on-chain, making it gas-efficient to check a vault's status later. Verified Vault Types -------------------- ### Governed Vaults[​](https://docs.euler.finance/concepts/risk/vault-types/#governed-vaults "Direct link to Governed Vaults") Governed vaults are actively managed by verified risk managers or curators who have undergone a KYB (Know Your Business) process. These trusted entities are responsible for setting and adjusting risk parameters, managing collateral types and their risk levels, monitoring market conditions, and ensuring the safety and stability of their vaults. The initial verification of these vaults is a manual process, where the vault configuration is evaluated and sanity-checked. Once approved, these vaults are fully subject to the risk manager's governance decisions. This model has become the standard in the ecosystem because it combines the flexibility of active management with the accountability of verified entities. These vaults are ideal for passive lenders seeking additional yield while relying on the governor's risk management expertise. ### Escrow Vaults[​](https://docs.euler.finance/concepts/risk/vault-types/#escrow-vaults "Direct link to Escrow Vaults") Escrow vaults are like secure deposit boxes in the DeFi world. They're designed to hold deposits that can be used as collateral for loans from other vaults. Since they don't allow borrowing, they don't earn interest for depositors. Their parameters are fixed and unchangeable, making them predictable and stable. These vaults can be safely reused multiple times as collateral for different vaults. ### Ungoverned Vaults - Edge[​](https://docs.euler.finance/concepts/risk/vault-types/#ungoverned-vaults---edge "Direct link to Ungoverned Vaults - Edge") Edge vaults are designed for active users who want full control over their risk exposure. With fixed parameters and no governor to make decisions, users must actively monitor and manage their positions themselves. Each vault may only accept collateral from other vaults in its market, creating a controlled risk environment that users must navigate independently. ### Earn Vaults[​](https://docs.euler.finance/concepts/risk/vault-types/#earn-vaults "Direct link to Earn Vaults") Earn vaults represent a specialized category of governed vaults designed to pool and manage passive lender assets. These vaults function as flexible investment vehicles, allowing the vault governor to allocate assets across various ERC4626 vaults, including both Euler-native vaults and external vaults such as sDAI. This structure enables dynamic portfolio management, where asset allocation can be adjusted in response to changing market conditions and opportunities. ### Unverified Vaults[​](https://docs.euler.finance/concepts/risk/vault-types/#unverified-vaults "Direct link to Unverified Vaults") Unverified vaults are the wild west of the Euler ecosystem. While they're deployed using the main EVK vault factory, they don't meet the criteria for any of the verified types. These vaults are for advanced users who are comfortable with minimal guarantees about functionality. Understanding Vault Types ------------------------- The classification of vaults into different types isn't just about putting labels on things - it's about creating a framework for understanding risk in a complex system. This is particularly important because: 1. Vaults can be highly customized with many risk parameters 2. Vaults can recognize deposits in other vaults as collateral 3. Risk exposure can come from both direct interaction and indirect exposure through collateral vaults Risk Management Considerations ------------------------------ When choosing between governed and ungoverned vaults, you're essentially choosing between two different approaches to risk management: **Governed Vaults**: These are like having a professional risk manager on your side. You need to trust the vault governor to: * Adjust vault parameters appropriately as market conditions change * Limit the vault's exposure to other risky vaults * Make timely decisions in response to changing economic conditions **Ungoverned Vaults**: These are like self-directed investing. You need to: * Proactively manage your own risks * Understand that vault parameters cannot change in response to market conditions * Be aware that you bear full responsibility for monitoring and managing your exposure Customizing Vault Classifications --------------------------------- The beauty of Euler's system is its flexibility. If the default vault type classifications don't meet your needs, you have two options: 1. Disable the default classifications in the user interface and manually add the addresses of vaults you want to use 2. Create your own perspective smart contract to define custom vault classifications (see the [EVK Periphery repository](https://github.com/euler-xyz/evk-periphery/tree/master/src/Perspectives/deployed) for examples) Euler DAO Markets ----------------- In the vast landscape of Euler's lending ecosystem, the DAO-run markets stand as carefully curated financial hubs, each serving a unique purpose in the broader DeFi landscape. These markets are the result of a strategic partnership between Euler DAO and Gauntlet, bringing together community governance and professional risk management expertise. ### Ethereum Network Markets[​](https://docs.euler.finance/concepts/risk/vault-types/#ethereum-network-markets "Direct link to Ethereum Network Markets") 1. **Euler Prime** Think of Prime as the cornerstone of Euler's lending infrastructure. It's designed with a conservative approach, much like traditional financial institutions, but with the innovation of DeFi. Prime serves as a trusted foundation where users can access high-quality lending and borrowing services, with risk parameters carefully tuned to provide optimal risk-adjusted yields. Its role extends beyond just serving users - it acts as a trusted collateral hub that other vault creators can build upon, creating a ripple effect of trust throughout the ecosystem. 2. **Euler Yield** While Prime focuses on traditional assets, Yield takes a different path, embracing the innovative world of yield-bearing strategies. It's like a specialized financial laboratory where users can leverage their yield-generating positions to access stable assets. Whether you're working with sUSDe, sdeUSD, or various Pendle PT tokens, Yield provides a dedicated space for these strategies to flourish, isolated from Prime's more conservative environment. ### Other Network Markets[​](https://docs.euler.finance/concepts/risk/vault-types/#other-network-markets "Direct link to Other Network Markets") 1. **Euler Base** As the Base network continues to grow, our Base market serves as a vital financial infrastructure, bringing Euler's lending capabilities to this vibrant ecosystem. It's designed to support the unique needs of Base's growing community while maintaining the high standards of risk management that Euler is known for. 2. **Euler Swell** The Swell market represents our commitment to supporting emerging DeFi ecosystems. By providing robust lending and borrowing facilities, we're helping to build the financial infrastructure everybody needs to thrive in the Swell ecosystem. 3. **Euler Unichain** Unichain's impressive growth in liquidity has created exciting opportunities for lending and borrowing. Our Unichain market is strategically positioned to support this growth, offering comprehensive support for key assets like USDC, WETH, and various staked ETH variants. It's designed to work harmoniously with Unichain's deep liquidity pools, creating a more efficient and accessible financial ecosystem. What makes these DAO-run markets special is the combination of professional risk management and transparent governance. Gauntlet's expertise ensures that risk parameters are regularly reviewed and adjusted in response to market conditions, while the DAO structure provides a framework for community involvement. This approach creates a robust foundation for sustainable growth across multiple networks. * [Introduction](https://docs.euler.finance/concepts/risk/vault-types/#introduction) * [How Perspectives Work](https://docs.euler.finance/concepts/risk/vault-types/#how-perspectives-work) * [Verified Vault Types](https://docs.euler.finance/concepts/risk/vault-types/#verified-vault-types) * [Governed Vaults](https://docs.euler.finance/concepts/risk/vault-types/#governed-vaults) * [Escrow Vaults](https://docs.euler.finance/concepts/risk/vault-types/#escrow-vaults) * [Ungoverned Vaults - Edge](https://docs.euler.finance/concepts/risk/vault-types/#ungoverned-vaults---edge) * [Earn Vaults](https://docs.euler.finance/concepts/risk/vault-types/#earn-vaults) * [Unverified Vaults](https://docs.euler.finance/concepts/risk/vault-types/#unverified-vaults) * [Understanding Vault Types](https://docs.euler.finance/concepts/risk/vault-types/#understanding-vault-types) * [Risk Management Considerations](https://docs.euler.finance/concepts/risk/vault-types/#risk-management-considerations) * [Customizing Vault Classifications](https://docs.euler.finance/concepts/risk/vault-types/#customizing-vault-classifications) * [Euler DAO Markets](https://docs.euler.finance/concepts/risk/vault-types/#euler-dao-markets) * [Ethereum Network Markets](https://docs.euler.finance/concepts/risk/vault-types/#ethereum-network-markets) * [Other Network Markets](https://docs.euler.finance/concepts/risk/vault-types/#other-network-markets) --- # Working with Pyth Oracles | Euler Docs [Skip to main content](https://docs.euler.finance/developers/data-querying/pyth-oracles/#__docusaurus_skipToContent_fallback) On this page Euler V2 supports pull-based oracles like Pyth, which require special handling compared to traditional push-based oracles. This guide explains how to work with these oracles effectively, both for querying data and executing transactions. Understanding Pull-Based Oracles -------------------------------- Traditional oracles (like Chainlink) are "push-based" - they automatically update prices on-chain at regular intervals. Pull-based oracles like Pyth work differently: * **Short staleness period**: Pyth prices are only valid for 2-3 minutes * **User-driven updates**: Users must fetch fresh price data and update the oracle before interacting with contracts * **Lower latency**: Prices can be updated with sub-second latency when needed * **Cost efficiency**: Updates only happen when needed, reducing overall gas costs The Challenge ------------- When working with Pyth-powered vaults, you may encounter situations where querying contract data and transactions fail because prices are stale. Solution: Update Prices Before Interactions ------------------------------------------- The solution is to update Pyth prices before any interaction that requires them. This applies to both: 1. **State-changing operations** (transactions) 2. **Data querying** (read operations) For State-Changing Operations ----------------------------- When executing transactions that involve Pyth-powered vaults, you need to: 1. **Fetch price updates from Pyth API** 2. **Include price update in your EVC batch** 3. **Execute your intended operations** ### Example: Borrowing from a Pyth-Powered Vault[​](https://docs.euler.finance/developers/data-querying/pyth-oracles/#example-borrowing-from-a-pyth-powered-vault "Direct link to Example: Borrowing from a Pyth-Powered Vault") // 1. Fetch price updates from Pyth API// Note: Price feed IDs can typically be obtained by calling the Pyth oracle adapter// that the vault relies onconst priceIds = [ '0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace', // ETH/USD // Add other price IDs as needed]// 2. Get price update data from Hermes APIconst pythApiUrl = 'https://hermes.pyth.network/v2/updates/price/latest'const response = await fetch(`${pythApiUrl}?ids[]=${priceIds.join('&ids[]=')}&encoding=hex`)const data = await response.json()const priceUpdateData = data.binary.data// Alternative using curl:// curl "https://hermes.pyth.network/v2/updates/price/latest?ids[]=0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace&encoding=hex"// 3. Prepare your batch itemsconst batchItems = [ // First: Update Pyth prices. Note that Pyth might require you to pass value as an update fee { targetContract: pythOracleAddress, onBehalfOfAccount: account, value: 0n, data: encodeFunctionData({ abi: pythAbi, functionName: 'updatePriceFeeds', args: [priceUpdateData] }) }, // Then: Your borrow operation { targetContract: vaultAddress, onBehalfOfAccount: account, value: 0n, data: encodeFunctionData({ abi: vaultAbi, functionName: 'borrow', args: [amount, receiver] }) }]// 4. Execute the batchconst result = await walletClient.writeContract({ address: evcAddress, abi: evcAbi, functionName: 'batch', args: [batchItems]}) For Data Querying ----------------- When you need to query data from contracts that rely on Pyth oracles, use the EVC's `batchSimulation` function. This allows you to simulate price updates without actually executing them. ### Example: Querying Account Health[​](https://docs.euler.finance/developers/data-querying/pyth-oracles/#example-querying-account-health "Direct link to Example: Querying Account Health") // 1. Fetch fresh price data// Note: Price feed IDs can typically be obtained by calling the Pyth oracle adapter// that the vault relies onconst priceIds = ['0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace']// Get price update data from Hermes APIconst pythApiUrl = 'https://hermes.pyth.network/v2/updates/price/latest'const response = await fetch(`${pythApiUrl}?ids[]=${priceIds.join('&ids[]=')}&encoding=hex`)const data = await response.json()const priceUpdateData = data.binary.data// 2. Prepare simulation batchconst simulationItems = [ // First: Simulate price update. Note that Pyth might require you to pass value as an update fee { targetContract: pythOracleAddress, onBehalfOfAccount: account, value: 0n, data: encodeFunctionData({ abi: pythAbi, functionName: 'updatePriceFeeds', args: [priceUpdateData] }) }, // Then: Query the data you need { targetContract: lensAddress, onBehalfOfAccount: account, value: 0n, data: encodeFunctionData({ abi: lensAbi, functionName: 'getAccountLiquidity', args: [account, vault] }) }]// 3. Simulate the batchconst { result } = await publicClient.simulate({ address: evcAddress, abi: evcAbi, functionName: 'batchSimulation', args: [simulationItems]})// 4. Extract the query result from the simulationconst [, queryResult] = resultconst accountLiquidity = decodeFunctionResult({ abi: lensAbi, functionName: 'getAccountLiquidity', data: queryResult.result}) ### Using Viem's simulateContract[​](https://docs.euler.finance/developers/data-querying/pyth-oracles/#using-viems-simulatecontract "Direct link to Using Viem's simulateContract") Viem provides a convenient wrapper for simulations: const { result } = await simulateContract(publicClient, { address: evcAddress, abi: evcAbi, functionName: 'batchSimulation', args: [simulationItems]}) > For more information about Pyth oracles, visit the [official Pyth documentation](https://docs.pyth.network/home) > . * [Understanding Pull-Based Oracles](https://docs.euler.finance/developers/data-querying/pyth-oracles/#understanding-pull-based-oracles) * [The Challenge](https://docs.euler.finance/developers/data-querying/pyth-oracles/#the-challenge) * [Solution: Update Prices Before Interactions](https://docs.euler.finance/developers/data-querying/pyth-oracles/#solution-update-prices-before-interactions) * [For State-Changing Operations](https://docs.euler.finance/developers/data-querying/pyth-oracles/#for-state-changing-operations) * [Example: Borrowing from a Pyth-Powered Vault](https://docs.euler.finance/developers/data-querying/pyth-oracles/#example-borrowing-from-a-pyth-powered-vault) * [For Data Querying](https://docs.euler.finance/developers/data-querying/pyth-oracles/#for-data-querying) * [Example: Querying Account Health](https://docs.euler.finance/developers/data-querying/pyth-oracles/#example-querying-account-health) * [Using Viem's simulateContract](https://docs.euler.finance/developers/data-querying/pyth-oracles/#using-viems-simulatecontract) --- # Subgraphs | Euler Docs [Skip to main content](https://docs.euler.finance/developers/data-querying/subgraphs/#__docusaurus_skipToContent_fallback) On this page Subgraphs are a powerful way to index and query on-chain data from Euler V2 smart contracts. They allow developers, analysts, and integrators to access protocol data efficiently using GraphQL, without needing to parse events or maintain their own indexing infrastructure. Euler maintains multiple subgraphs, each tailored to a specific network where the protocol is deployed. These subgraphs are hosted on both Goldsky and The Graph, providing reliable and fast access to historical and real-time data. Source Code ----------- The source code for all Euler subgraphs is open source and available on GitHub. It includes the GraphQL schema, entity definitions, and event handling logic for all supported networks. * [Euler Subgraphs GitHub Repository](https://github.com/euler-xyz/euler-subgraph) Available Networks and Endpoints -------------------------------- Each network where Euler is live has its own dedicated subgraph instance. Below are the main GraphQL endpoints hosted by Goldsky: #### Goldsky[​](https://docs.euler.finance/developers/data-querying/subgraphs/#goldsky "Direct link to Goldsky") | Network | GraphQL Endpoint | | --- | --- | | Mainnet | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-mainnet/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-mainnet/latest/gn) | | Base | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-base/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-base/latest/gn) | | Swell | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-swell/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-swell/latest/gn) | | Sonic | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-sonic/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-sonic/latest/gn) | | BOB | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-bob/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-bob/latest/gn) | | Berachain | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-berachain/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-berachain/latest/gn) | | Avalanche | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-avalanche/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-avalanche/latest/gn) | | Arbitrum | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-arbitrum/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-arbitrum/latest/gn) | | Unichain | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-unichain/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-unichain/latest/gn) | | Ink | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-ink/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-ink/latest/gn) | | BSC | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-bsc/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-bsc/latest/gn) | | HyperEVM | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-hyperevm/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-hyperevm/1.0.1/gn) | | Optimism | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-optimism/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-optimism/latest/gn) | | Gnosis | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-gnosis/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-gnosis/latest/gn) | | Worldchain | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-worldchain/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-worldchain/latest/gn) | | TAC | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-tac/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-tac/latest/gn) | | Plasma | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-plasma/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-plasma/latest/gn) | | Mantle | [https://api.goldsky.com/api/public/project\_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-mantle/latest/gn](https://api.goldsky.com/api/public/project_cm4iagnemt1wp01xn4gh1agft/subgraphs/euler-v2-mantle/latest/gn) | You can also find subgraphs hosted on The Graph's hosted service. For a full list, visit the [The Graph Explorer](https://thegraph.com/explorer?search=euler-v2) but keep in mind that The Graph subgraphs may not be up-to-date. How to Get Active Positions of an Account ----------------------------------------- A common question is how to retrieve all active positions (deposits and borrows) for a given account in Euler. While a dedicated API is in development, you can already do this efficiently using the subgraph and lens contracts. ### Step 1: Query the Subgraph for Active Positions[​](https://docs.euler.finance/developers/data-querying/subgraphs/#step-1-query-the-subgraph-for-active-positions "Direct link to Step 1: Query the Subgraph for Active Positions") Use the `trackingActiveAccount` query to get all positions and their associated vaults for a given address: query Accounts($address: ID!) { trackingActiveAccount(id: $address) { mainAddress deposits borrows }} This will return lists of deposits and borrows, each entry formatted as `${position}${vault}` (e.g., `0x4eda703f4D792B093cd64e452CBa7cA0ed06F6e76d671b9c618d5486814feb777552ba723f1a235c`). To parse these entries in JavaScript: const vault = `0x${entry.substring(42)}`;const subAccount = entry.substring(0, 42); * `subAccount` is the address of the sub-account holding the position * `vault` is the address of the vault ### Step 2: Fetch Detailed Data Using Lens Contracts[​](https://docs.euler.finance/developers/data-querying/subgraphs/#step-2-fetch-detailed-data-using-lens-contracts "Direct link to Step 2: Fetch Detailed Data Using Lens Contracts") Once you have the list of sub-accounts and vaults, use the [lens contracts](https://docs.euler.finance/developers/data-querying/using-lens-contracts) for detailed information: * Use **`AccountLens`** for account-level data (balances, health, rewards, etc.) * Use **`VaultLens`** for vault-specific details (configuration, caps, rates, etc.) ### Step 3: Vault Verification with `Perspectives`[​](https://docs.euler.finance/developers/data-querying/subgraphs/#step-3-vault-verification-with-perspectives "Direct link to step-3-vault-verification-with-perspectives") For the list of vaults, you can use [`Perspectives`](https://docs.euler.finance/developers/data-querying/perspectives) to check whether a vault is verified and meets your criteria. This helps filter for trusted or curated vaults. How to get information about the vaults --------------------------------------- EulerVaults =========== With that query, you get all the vault information. query Vaults { eulerVaults{ id evc evault name borrowCap supplyCap dToken decimals permit2Address perspectives interestRateModel collaterals # It's a list of vault addresses governonAdmin feeReceiver asset oracle creator symbol unitOfAccount interestFee state{ vault totalShares totalBorrows accumulatedFees cash interestAccumulator interestRate supplyApy borrowApy timestamp } } } * The state parameter will be updated with the vaultState events, and you can check the historical data directly from the raw event. query VaultStateHistory($address: ID!) { vaultStatuses(where:{vault:$address$}){ vault totalShares totalBorrows accumulatedFees cash interestAccumulator interestRate supplyApy borrowApy timestamp }} EulerEarn ========= query EulerEarnVaults { eulerEarnVaults { id name owner asset creator curator evc feeReceiver guardian pendingGuardian pendingGuardianValidAt pendingTimelock pendingTimelockValidAt performanceFee perspectives supplyQueue symbol timelock totalAllocated totalAssets totalLostAssets totalShares totalSupply transactionHash strategies { id allocatedAssets availableAssets currentAllocationCap pendingAllocationCapValidAt pendingAllocationCap pendingAllocationCapValidAt removableAt strategy # eulerVault } blockNumber blockTimestamp }} EulerSwapPools ============== With that query you can get the current pools created query EulerSwapPools { eulerSwapPools { active asset0 asset1 blockNumber blockTimestamp concentrationX concentrationY currReserve0 currReserve1 equilibriumReserve0 equilibriumReserve1 eulerAccount fee id pool priceX priceY protocolFee protocolFeeRecipient transactionHash vault0 vault1 }} Now we can show the history of the swaps query EulerSwapSwaps { eulerSwaps { amount0In amount0Out amount1In amount1Out blockNumber blockTimestamp from id pool reserve0 reserve1 sender to transactionHash }} search by pool query EulerSwapSwapsByPool($pool: Bytes!) { eulerSwaps(where:{pool: $pool }) { amount0In amount0Out amount1In amount1Out blockNumber blockTimestamp from id pool reserve0 reserve1 sender to transactionHash }} * [Source Code](https://docs.euler.finance/developers/data-querying/subgraphs/#source-code) * [Available Networks and Endpoints](https://docs.euler.finance/developers/data-querying/subgraphs/#available-networks-and-endpoints) * [How to Get Active Positions of an Account](https://docs.euler.finance/developers/data-querying/subgraphs/#how-to-get-active-positions-of-an-account) * [Step 1: Query the Subgraph for Active Positions](https://docs.euler.finance/developers/data-querying/subgraphs/#step-1-query-the-subgraph-for-active-positions) * [Step 2: Fetch Detailed Data Using Lens Contracts](https://docs.euler.finance/developers/data-querying/subgraphs/#step-2-fetch-detailed-data-using-lens-contracts) * [Step 3: Vault Verification with `Perspectives`](https://docs.euler.finance/developers/data-querying/subgraphs/#step-3-vault-verification-with-perspectives) * [How to get information about the vaults](https://docs.euler.finance/developers/data-querying/subgraphs/#how-to-get-information-about-the-vaults) --- # Using Lens Contracts | Euler Docs [Skip to main content](https://docs.euler.finance/developers/data-querying/using-lens-contracts/#__docusaurus_skipToContent_fallback) On this page This guide is for developers, analysts, and integrators who want to query protocol data efficiently and make sense of the results. We'll walk through practical examples and explain the key data types you'll encounter. The contract ABIs and deployment addresses for lens contracts are available in the [euler-interfaces](https://github.com/euler-xyz/euler-interfaces) repository. Be sure to use the correct address for your target network. Connecting to a Lens Contract ----------------------------- To interact with a lens contract, you'll typically use a web3 library like ethers.js. All lens contracts are read-only, so you can call them from any off-chain context (scripts, dashboards, bots, etc.). **Example: Connecting to `AccountLens`** const { ethers } = require("ethers");const provider = new ethers.JsonRpcProvider(RPC_URL);const accountLens = new ethers.Contract(ACCOUNT_LENS_ADDRESS, AccountLensABI, provider); Querying Account Data: `getAccountInfo` --------------------------------------- The `getAccountInfo(account, vault)` function returns a comprehensive snapshot of a user's position in a vault. The result is an `AccountInfo` struct, which contains several nested types: * **`EVCAccountInfo`:** General info about the EVC sub-account (owner, enabled controllers/collaterals, status flags) * **`VaultAccountInfo`:** Position data for the vault (balances, shares, borrowings, collateral/controller status, liquidity info) * **`AccountRewardInfo`:** On-chain reward and incentive data (balances, earned rewards, reward streams) If you want to query the same data for all enabled collaterals and controllers of an account in one call, use `getAccountEnabledVaultsInfo(evc, account)`. This function returns arrays of the same types for every enabled vault, making it efficient to fetch a user's full protocol exposure. Note that this function only returns data for vaults that are explicitly enabled as collateral or controller in the EVC - it won't return information about deposits in vaults that aren't enabled as collateral. **Example:** const account = "0x...";const vault = "0x...";const info = await accountLens.getAccountInfo(account, vault);// Accessing nested data:console.log("Owner:", info.evcAccountInfo.owner);console.log("Vault shares:", info.vaultAccountInfo.shares);console.log("Borrowed:", info.vaultAccountInfo.borrowed);console.log("Is Controller:", info.vaultAccountInfo.isController);console.log("Earned rewards:", info.accountRewardInfo.enabledRewardsInfo); ### Understanding the Types[​](https://docs.euler.finance/developers/data-querying/using-lens-contracts/#understanding-the-types "Direct link to Understanding the Types") * **`AccountInfo`**: The top-level struct, grouping all relevant data for a user/vault pair. * **`EVCAccountInfo`**: Includes the EVC address, owner, enabled controllers/collaterals, and status flags (e.g., lockdown mode). * **`VaultAccountInfo`**: Contains balances, shares, borrowings, allowances, collateral/controller status, and liquidity info (including time to liquidation and collateral values). * **`AccountRewardInfo`**: Shows reward balances and details for any enabled reward streams. > **Tip:** Many fields are nested structs or arrays. Use dot notation to access them (e.g., `info.vaultAccountInfo.liquidityInfo.timeToLiquidation`). ### Position Health, Collateral Value, and Health Score[​](https://docs.euler.finance/developers/data-querying/using-lens-contracts/#position-health-collateral-value-and-health-score "Direct link to Position Health, Collateral Value, and Health Score") When analyzing your account's risk and health, it's important to understand how the protocol evaluates your positions. Here are some key concepts and how to extract them using the lens contracts: * **Health Score (Health Rate):** * The health score is a measure of how safe your borrow position is. It is calculated as: `healthScore = collateralValueLiquidation / liabilityValueLiquidation` where both values are found in `VaultAccountInfo.liquidityInfo`. * To get the health score for a borrow position, you must query the vault from which you borrowed (the controller vault). In the context of `getAccountEnabledVaultsInfo`, this will be the vault where `isController` is true. * **Risk-Adjusted Collateral Value:** * The protocol uses different collateral values for borrowing and for liquidation: * `collateralValueBorrowing`: The value of your enabled collaterals as seen for borrowing purposes. * `collateralValueLiquidation`: The value of your enabled collaterals as seen for liquidation purposes (usually more conservative). * Both are available in `VaultAccountInfo.liquidityInfo`. * These values are aggregated across all enabled collaterals for the position, but you can also see the breakdown per collateral in the `collateralValuesBorrowing` and `collateralValuesLiquidation` arrays. * **Collateral Market Value (Raw):** * The raw market value of your collaterals, as seen by the controller vault, is given by `collateralValueRaw` in `VaultAccountInfo.liquidityInfo`. * The breakdown per collateral is available in the `collateralValuesRaw` array. * **Off-Chain Collateral Market Value:** * If you want to compute the market value of your collateral using off-chain prices, multiply your collateral **asset balance** (not shares) by the current market price of the asset. For example: `offChainCollateralValue = assetsAccount * assetPrice` where `assetsAccount` is the asset balance from `VaultAccountInfo.assetsAccount` and `assetPrice` is the off-chain price per unit of the asset. * Note: For some assets, you may need to use your own price source if the [endpoint](https://docs.euler.finance/developers/data-querying/off-chain-prices) does not return a value. > **Tip:** The `getAccountEnabledVaultsInfo` function returns an `AccountMultipleVaultsInfo` struct, which contains an array of `VaultAccountInfo` for each enabled collateral and controller. For borrow positions, focus on the vault where `isController` is true to get the health and risk data for your position. Querying Vault Data: `getVaultInfoFull` --------------------------------------- The `getVaultInfoFull(vault)` function (from `VaultLens`) returns a `VaultInfoFull` struct, which is a detailed snapshot of a vault's configuration and state. **Example:** const vaultLens = new ethers.Contract(VAULT_LENS_ADDRESS, VaultLensABI, provider);const vaultInfo = await vaultLens.getVaultInfoFull(vault);console.log("Vault name:", vaultInfo.vaultName);console.log("Total assets:", vaultInfo.totalAssets);console.log("Interest rate model:", vaultInfo.interestRateModel);console.log("Supply cap:", vaultInfo.supplyCap);console.log("Recognized collaterals:", vaultInfo.collateralLTVInfo); ### Key Types in `VaultInfoFull`[​](https://docs.euler.finance/developers/data-querying/using-lens-contracts/#key-types-in-vaultinfofull "Direct link to key-types-in-vaultinfofull") * **`VaultInfoFull`**: The main struct, with fields for vault configuration, totals, caps, fees, IRM, oracles, hooks, and more. * **`LTVInfo[]`**: An array of collateral types and their LTV (Loan-to-Value) parameters. Each `LTVInfo` includes the collateral address, borrow and liquidation LTVs, and ramping info. * **`VaultInterestRateModelInfo`**: Details about the vault's interest rate model, including type and parameters. * **`AssetPriceInfo`**: Price and oracle data for assets and collaterals. > **Tip:** Arrays like `collateralLTVInfo` are append-only, so not all entries may be active collaterals. Always check the LTV values - a collateral with zero `borrowLTV` is no longer accepted as collateral. Only iterate through entries with non-zero LTVs to display currently supported collaterals and their risk parameters. > **Tip:** > If a vault is ramping down its liquidation LTV, you can calculate the current liquidation LTV for a collateral using the following formula, based on the fields in the `LTVInfo` struct returned by the lens: > > // LTVInfo fields:// - liquidationLTV: target value (uint256)// - initialLiquidationLTV: starting value at ramp start (uint256)// - targetTimestamp: when ramping ends (uint256, unix time)// - rampDuration: total ramp duration (uint256, seconds)function getCurrentLiquidationLTV(ltvInfo) { const now = Math.floor(Date.now() / 1000); // current unix timestamp if ( now >= ltvInfo.targetTimestamp || ltvInfo.liquidationLTV >= ltvInfo.initialLiquidationLTV ) { return ltvInfo.liquidationLTV; } const timeRemaining = ltvInfo.targetTimestamp - now; return ( ltvInfo.liquidationLTV + ((ltvInfo.initialLiquidationLTV - ltvInfo.liquidationLTV) * timeRemaining) / ltvInfo.rampDuration );} > > This matches the on-chain logic: the liquidation LTV linearly ramps from `initialLiquidationLTV` to `liquidationLTV` over the period ending at `targetTimestamp`. If ramping is not active, just use `liquidationLTV`. Querying APYs for a Vault ------------------------- To quickly fetch the current borrow and supply APYs for a vault, use the `getAPYs(vault)` function from the `UtilsLens` contract. This function returns the annualized borrow and supply rates, computed based on the vault's current interest rate model and utilization. **Example:** const utilsLens = new ethers.Contract(UTILS_LENS_ADDRESS, UtilsLensABI, provider);const [borrowAPY, supplyAPY] = await utilsLens.getAPYs(vault);console.log("Borrow APY:", borrowAPY);console.log("Supply APY:", supplyAPY); The returned values are typically expressed in ray units (`1e27`), so you may need to convert them to a human-readable percentage (e.g., `Number(borrowAPY) / 1e25` gives the APY as a percent with two decimals). > **Note:** The APYs returned here only include the Euler rates from lending and borrowing activity within the protocol. They do **not** include any intrinsic APY from the underlying asset (for example, the staking yield of wstETH) or any additional rewards. To account for those, you must supplement with external data sources. Where to Find Type Definitions and More Resources ------------------------------------------------- The full definitions of all structs and types used by lens contracts can be found in the [LensTypes.sol](https://github.com/euler-xyz/evk-periphery/blob/master/src/Lens/LensTypes.sol) file in the EVK Periphery repository. * [Connecting to a Lens Contract](https://docs.euler.finance/developers/data-querying/using-lens-contracts/#connecting-to-a-lens-contract) * [Querying Account Data: `getAccountInfo`](https://docs.euler.finance/developers/data-querying/using-lens-contracts/#querying-account-data-getaccountinfo) * [Understanding the Types](https://docs.euler.finance/developers/data-querying/using-lens-contracts/#understanding-the-types) * [Position Health, Collateral Value, and Health Score](https://docs.euler.finance/developers/data-querying/using-lens-contracts/#position-health-collateral-value-and-health-score) * [Querying Vault Data: `getVaultInfoFull`](https://docs.euler.finance/developers/data-querying/using-lens-contracts/#querying-vault-data-getvaultinfofull) * [Key Types in `VaultInfoFull`](https://docs.euler.finance/developers/data-querying/using-lens-contracts/#key-types-in-vaultinfofull) * [Querying APYs for a Vault](https://docs.euler.finance/developers/data-querying/using-lens-contracts/#querying-apys-for-a-vault) * [Where to Find Type Definitions and More Resources](https://docs.euler.finance/developers/data-querying/using-lens-contracts/#where-to-find-type-definitions-and-more-resources) --- # Euler Docs [Skip to main content](https://docs.euler.finance/developers/euler-earn/#__docusaurus_skipToContent_fallback) On this page **EulerEarn** is a non-custodial, ERC-4626 compliant meta-vault that aggregates user deposits into a curated set of underlying lending vaults on Euler (and other ERC-4626 strategies). Users deposit a single asset and Earn allocates it across multiple isolated strategies to optimize yield, while preserving risk isolation per strategy. Why EulerEarn? -------------- * **Set-and-forget yield:** Professional curators and allocators handle strategy selection and rebalancing. * **Automated best rates:** Funds are steered toward higher-yield strategies within risk bounds. * **Risk isolation:** Per-strategy supply caps limit exposure; issues in one market do not contaminate others depending on the market structure. * **Simplicity:** A single ERC-4626 token represents your share of the aggregated pool; deposits/withdrawals stay permissionless and on-chain. info EulerEarn’s contracts are based on Morpho’s MetaMorpho (v1.1) and enhanced for Euler: generic ERC-4626 strategy support (esp. EVK lending vaults), EVC batching, Permit2 support, strict reentrancy protections, and removal of deprecated patterns (e.g., skim, multicall). Core Concepts and Mechanics --------------------------- ### Vault Structure & Strategies[​](https://docs.euler.finance/developers/euler-earn/#vault-structure--strategies "Direct link to Vault Structure & Strategies") * One Earn vault per underlying asset (e.g., DAI, ETH). * Up to 30 ERC-4626 strategies per vault (commonly Euler EVK lending vaults, but any approved ERC-4626 is possible). * Two ordered queues govern flows: * **Supply queue:** order in which deposits are allocated (respecting per-strategy caps). * **Withdraw queue:** order in which strategies are tapped for redemptions. * **Per-strategy caps:** curator-controlled maximum allocation for each strategy. Increases are timelocked; decreases are immediate. * **Idle funds / cash reserve:** maintain immediate liquidity via a reserve (e.g., by allocating to a non-borrowable EVK escrow vault), trading off yield for withdrawal responsiveness. ### Roles & Permissions[​](https://docs.euler.finance/developers/euler-earn/#roles--permissions "Direct link to Roles & Permissions") * **Owner:** highest-privilege governance for a vault; assigns roles, sets fees and fee recipient, manages timelock, and can transfer/renounce ownership. * **Curator:** risk configuration; adds/removes strategies, sets caps, initiates forced removals (timelocked), and can revoke pending cap changes. * **Allocator(s):** manage supply/withdraw queues and trigger reallocations within caps to optimize yield and liquidity. * **Guardian:** safety role to cancel timelocked actions before execution (circuit-breaker for risk-increasing changes). ### Timelocks & Safeguards[​](https://docs.euler.finance/developers/euler-earn/#timelocks--safeguards "Direct link to Timelocks & Safeguards") Timelocks apply to risk-increasing or sensitive changes (e.g., cap increases, forced removals, decreasing the timelock, changing guardian). Pending actions can be revoked by the Guardian or Owner before they execute. ### Fees & Yield Distribution[​](https://docs.euler.finance/developers/euler-earn/#fees--yield-distribution "Direct link to Fees & Yield Distribution") * **Performance fee:** Up to 50% of net positive yield, minted as additional vault shares to the fee recipient. * **Interest accrual:** As the underlying strategies accrue yield, the `totalAssets` of the vault gets updated on interactions (e.g., depositing, withdrawing). `totalAssets` is calculated by summing up the underlying strategies' assets. ### Loss Handling[​](https://docs.euler.finance/developers/euler-earn/#loss-handling "Direct link to Loss Handling") * **Realized losses accounting:** When a strategy incurs a realized loss (e.g., bad debt, forced removal), Earn increases `lostAssets` to reflect the shortfall, but does not socialize the loss to the depositors. The share price will not decrease, but depositors who remain may be unable to withdraw unless the bad debt is covered. ### Integrations[​](https://docs.euler.finance/developers/euler-earn/#integrations "Direct link to Integrations") Earn vaults implement ERC-4626 and ERC20Votes, support Permit2 for approvals, and integrate with EVC for advanced batching. For technical details, see the [repository](https://github.com/euler-xyz/euler-earn) ; refer to the [Integrator](https://docs.euler.finance/developers/euler-earn/integrator-guide) , and [Allocator](https://docs.euler.finance/developers/euler-earn/allocator-handbook) guides in this section for practical workflows. * [Why EulerEarn?](https://docs.euler.finance/developers/euler-earn/#why-eulerearn) * [Core Concepts and Mechanics](https://docs.euler.finance/developers/euler-earn/#core-concepts-and-mechanics) * [Vault Structure & Strategies](https://docs.euler.finance/developers/euler-earn/#vault-structure--strategies) * [Roles & Permissions](https://docs.euler.finance/developers/euler-earn/#roles--permissions) * [Timelocks & Safeguards](https://docs.euler.finance/developers/euler-earn/#timelocks--safeguards) * [Fees & Yield Distribution](https://docs.euler.finance/developers/euler-earn/#fees--yield-distribution) * [Loss Handling](https://docs.euler.finance/developers/euler-earn/#loss-handling) * [Integrations](https://docs.euler.finance/developers/euler-earn/#integrations) --- # Euler Docs [Skip to main content](https://docs.euler.finance/developers/euler-swap/#__docusaurus_skipToContent_fallback) On this page Overview -------- **EulerSwap** is Euler's decentralized exchange (DEX) built on top of Euler V2. It introduces an automated market maker (AMM) design where liquidity is directly integrated with Euler’s vaults. This unified approach allows users to earn swap fees and lending yield on the same assets, while enabling advanced strategies like leverage and dynamic hedging. Unlike traditional AMMs, EulerSwap doesn’t lock funds in a standalone pool contract; instead, an LP’s funds remain in their Euler position and continue accruing interest and rewards. By bringing together a DEX with lending, EulerSwap aims to maximize capital efficiency for users, offering deeper liquidity and more flexibility. It is also designed to be compatible with Uniswap v4 hooks, meaning EulerSwap pools can plug into Uniswap’s routing/aggregator ecosystem for broad accessibility. Key Features and Advantages of EulerSwap ---------------------------------------- EulerSwap introduces several key advantages that make it attractive to LPs, token projects, and traders: ### Dual Yield (Swap Fees + Lending Interest)[​](https://docs.euler.finance/developers/euler-swap/#dual-yield-swap-fees--lending-interest "Direct link to Dual Yield (Swap Fees + Lending Interest)") Unlike normal AMMs where LPs only earn trading fees, EulerSwap LPs continue earning lending interest and protocol rewards on deposited assets in addition to swap fees. ### Capital Efficiency via Rehypothecation[​](https://docs.euler.finance/developers/euler-swap/#capital-efficiency-via-rehypothecation "Direct link to Capital Efficiency via Rehypothecation") Liquidity isn’t siloed. Assets supplied to EulerSwap remain in your Euler position, meaning a single deposit can serve multiple purposes. This rehypothecation (re-using collateral) leads to capital efficiency. Just-in-time (JIT) liquidity further amplifies this efficiency, allowing deep liquidity with a fraction of the capital by borrowing on demand. ### Deep Effective Liquidity (Up to 50×)[​](https://docs.euler.finance/developers/euler-swap/#deep-effective-liquidity-up-to-50 "Direct link to Deep Effective Liquidity (Up to 50×)") Through dynamic borrowing, EulerSwap can simulate liquidity depths that are orders of magnitude larger than the LP’s net deposit. In stablecoin pools or tightly pegged assets, where the protocol can safely leverage up to 50x higher liquidity by borrowing up to the max LTV. This deep liquidity leads to low slippage trading, improving trader experience and attracting volume. ### Built-In Leverage and Hedging[​](https://docs.euler.finance/developers/euler-swap/#built-in-leverage-and-hedging "Direct link to Built-In Leverage and Hedging") EulerSwap gives sophisticated tools to LPs to enhance or protect their positions. LPs can borrow additional assets from Euler to leverage their LP position and earn more fees on a larger pool (essentially taking on a leveraged LP stance). Conversely, they can borrow one side of the pair to hedge impermanent loss, maintaining a balanced exposure (delta-neutral strategy) while still earning fees and interest. This flexibility to manage exposure is something traditional AMMs don’t natively offer – normally an LP must accept the full market risk of the LP position. EulerSwap enables more professional market-making strategies on-chain, where you can treat your LP position almost like a margin position – adjusting leverage or hedges as market conditions change. ### Customizable Curves & Fees[​](https://docs.euler.finance/developers/euler-swap/#customizable-curves--fees "Direct link to Customizable Curves & Fees") EulerSwap uses a customizable formula that serves full-range liquidity while allowing different levels of concentration around an equilibrium price. At low concentration levels, EulerSwap behaves like a traditional constant-product AMM. As concentration goes up, liquidity is increasingly concentrated around the equilibrium price, offering lower price impact similar to Stableswap. Fees are earned on the entire swap volume, including borrowed liquidity. This gives users fine-grained control to minimize arbitrage losses and maximize fee earnings. ### Single-LP Management[​](https://docs.euler.finance/developers/euler-swap/#single-lp-management "Direct link to Single-LP Management") Each pool is controlled by one LP account by design. The LP is in control of all pool parameters, and can add or remove liquidity, rebalance, or update their strategy as they wish. This is a big advantage for treasury managers and protocol-owned liquidity: you maintain full autonomy over your liquidity. For example, if market conditions change, you could withdraw funds or adjust parameters to avoid losses – something not possible if your liquidity was combined in a public pool. This “curated liquidity” model also eliminates the risk of other LPs diluting your fees or introducing toxic liquidity. It aligns incentives for market makers to manage their own pool parameters and provide liquidity in a sustainable fashion, while managing risks. ### Risk Management via Vault Mechanisms[​](https://docs.euler.finance/developers/euler-swap/#risk-management-via-vault-mechanisms "Direct link to Risk Management via Vault Mechanisms") EulerSwap brings in Euler’s robust risk controls. Each vault has configurable LTV limits and is subject to Euler’s liquidation framework. Risk curators manage the risk parameters of the Euler vaults which provide lending liquidity to EulerSwap pools. While liquidation risk is something LPs must mind (especially if using high leverage or in volatile markets), it also means there’s an automated safety net — if an LP’s position becomes too under-collateralized, liquidators will step in to restore solvency. Traditional AMMs can lose a large portion to impermanent loss without experiencing liquidation. In EulerSwap, the position health factor acts as a real-time risk gauge, providing transparency. An EulerSwap which uses JIT liquidity combines features and risks of both a borrow position and DEX position. ### Ecosystem Integration[​](https://docs.euler.finance/developers/euler-swap/#ecosystem-integration "Direct link to Ecosystem Integration") EulerSwap is built to integrate into the DeFi stack. It can be accessed through Euler’s UI or via Uniswap-compatible interfaces thanks to the Uniswap v4 hook compatibility. This means aggregators and wallets can route trades through EulerSwap pools just like they would through Uniswap, tapping its liquidity without needing a custom integration. All contracts are open source and have undergone multiple audits (five separate security firms reviewed EulerSwap prior to launch). For developers and partners, EulerSwap offers both cutting-edge functionality and confidence in security, making it a compelling platform to build on or integrate with. * [Overview](https://docs.euler.finance/developers/euler-swap/#overview) * [Key Features and Advantages of EulerSwap](https://docs.euler.finance/developers/euler-swap/#key-features-and-advantages-of-eulerswap) * [Dual Yield (Swap Fees + Lending Interest)](https://docs.euler.finance/developers/euler-swap/#dual-yield-swap-fees--lending-interest) * [Capital Efficiency via Rehypothecation](https://docs.euler.finance/developers/euler-swap/#capital-efficiency-via-rehypothecation) * [Deep Effective Liquidity (Up to 50×)](https://docs.euler.finance/developers/euler-swap/#deep-effective-liquidity-up-to-50) * [Built-In Leverage and Hedging](https://docs.euler.finance/developers/euler-swap/#built-in-leverage-and-hedging) * [Customizable Curves & Fees](https://docs.euler.finance/developers/euler-swap/#customizable-curves--fees) * [Single-LP Management](https://docs.euler.finance/developers/euler-swap/#single-lp-management) * [Risk Management via Vault Mechanisms](https://docs.euler.finance/developers/euler-swap/#risk-management-via-vault-mechanisms) * [Ecosystem Integration](https://docs.euler.finance/developers/euler-swap/#ecosystem-integration) --- # Euler Docs [Skip to main content](https://docs.euler.finance/developers/euler-earn/integrator-guide#__docusaurus_skipToContent_fallback) On this page EulerEarn vaults are standard ERC-4626 vaults with meta-allocation logic. Users get a simple deposit/redeem experience; integrators get a familiar interface with extras like Permit2 and EVC batching. Integrator guide ---------------- ### ERC-4626 Interface[​](https://docs.euler.finance/developers/euler-earn/integrator-guide#erc-4626-interface "Direct link to ERC-4626 Interface") * `deposit(uint256 assets, address receiver)` * `mint(uint256 shares, address receiver)` * `withdraw(uint256 assets, address receiver, address owner)` * `redeem(uint256 shares, address receiver, address owner)` Vaults also expose `totalAssets()` and `totalSupply()`; compute exchange rate as `convertToAssets(1e18 shares)` or `totalAssets/totalSupply`. ### Approvals & Permit2[​](https://docs.euler.finance/developers/euler-earn/integrator-guide#approvals--permit2 "Direct link to Approvals & Permit2") Support Uniswap’s Permit2 for gasless approvals if your wallet/app supports it; otherwise request a standard ERC-20 approval flow. ### Batching via EVC[​](https://docs.euler.finance/developers/euler-earn/integrator-guide#batching-via-evc "Direct link to Batching via EVC") Advanced flows can batch actions atomically with Euler’s Ethereum Vault Connector (EVC). For simple Earn usage, direct vault calls suffice. ### APY & Analytics[​](https://docs.euler.finance/developers/euler-earn/integrator-guide#apy--analytics "Direct link to APY & Analytics") Derive APY from share price growth over time. Consider using subgraphs or Euler APIs where available. Display total assets, exchange rate, strategy allocations, and historical returns. ### Withdraw UX[​](https://docs.euler.finance/developers/euler-earn/integrator-guide#withdraw-ux "Direct link to Withdraw UX") Surface potential partial-liquidity cases for very large withdrawals. Typical partial withdrawals are rare if an idle reserve is maintained. ### Discovery & Listing[​](https://docs.euler.finance/developers/euler-earn/integrator-guide#discovery--listing "Direct link to Discovery & Listing") List verified Earn vaults by querying the factory or a registry endpoint. Present underlying, APY, caps, and current strategy set for transparency. ### Security Notes[​](https://docs.euler.finance/developers/euler-earn/integrator-guide#security-notes "Direct link to Security Notes") Highlight non-custodial design, role-based governance with timelocks, and per-strategy risk isolation. Link to Security and Advanced docs from this section. * [Integrator guide](https://docs.euler.finance/developers/euler-earn/integrator-guide#integrator-guide-1) * [ERC-4626 Interface](https://docs.euler.finance/developers/euler-earn/integrator-guide#erc-4626-interface) * [Approvals & Permit2](https://docs.euler.finance/developers/euler-earn/integrator-guide#approvals--permit2) * [Batching via EVC](https://docs.euler.finance/developers/euler-earn/integrator-guide#batching-via-evc) * [APY & Analytics](https://docs.euler.finance/developers/euler-earn/integrator-guide#apy--analytics) * [Withdraw UX](https://docs.euler.finance/developers/euler-earn/integrator-guide#withdraw-ux) * [Discovery & Listing](https://docs.euler.finance/developers/euler-earn/integrator-guide#discovery--listing) * [Security Notes](https://docs.euler.finance/developers/euler-earn/integrator-guide#security-notes) --- # Allocator & Manager Handbook | Euler Docs [Skip to main content](https://docs.euler.finance/developers/euler-earn/allocator-handbook#__docusaurus_skipToContent_fallback) On this page This guide covers deploying an Earn vault and operating it safely and efficiently. Deploying an Earn vault ----------------------- Deploy via the `EulerEarnFactory`, specifying: underlying asset, share token name/symbol, initial performance fee (0–50%), and smearing period. After deployment: * Assign roles: set Curator, add Allocators, and optionally a Guardian. Use a multi-sig or DAO for Owner where possible. * Configure timelock: start low for bootstrapping; raise to ≥24h for production with user funds. Decreasing the timelock later is itself timelocked. * Add strategies and submit cap increases (timelocked). Start with conservative caps and raise as confidence grows. * Set supply and withdraw queues. Include all strategies with non-zero caps or balances in the withdraw queue. * Seed liquidity and consider an idle reserve (e.g., escrow/non-borrowable EVK vault) to improve instant withdrawals. Managing strategy caps and risk ------------------------------- * Cap increases are timelocked; cap decreases are immediate. Lower caps or set to zero on risk signals. * To remove a strategy: set cap to zero, reallocate funds out, then drop it from queues once balance is zero. * Forced removal (timelocked) exists for broken/reverting strategies; any trapped funds are treated as lost until recoverable. Rebalancing and reallocation ---------------------------- * Allocators update queues and call `reallocate` to move funds between strategies within caps. * Rebalance to pursue higher APYs and to maintain withdrawal liquidity (e.g., preemptively reduce exposure to highly utilized markets). * Consider automation via bots/scripts observing on-chain rates and utilization. Fees, harvesting, and smearing ------------------------------ * Performance fee: up to 50% of net positive yield, minted in shares to the fee recipient. * Harvest on a cadence that balances gas with freshness (e.g., when accrued yield surpasses a threshold). Yield is released to share price via smearing over a configured duration. Emergency scenarios ------------------- ### Strategy becomes unsafe[​](https://docs.euler.finance/developers/euler-earn/allocator-handbook#strategy-becomes-unsafe "Direct link to Strategy becomes unsafe") 1. Revoke any pending cap increases; set cap to zero. 2. Reallocate available liquidity out; keep it early in the withdraw queue to prioritize repayment to users. 3. Remove from queues once balance is zero. ### Strategy reverts and freezes[​](https://docs.euler.finance/developers/euler-earn/allocator-handbook#strategy-reverts-and-freezes "Direct link to Strategy reverts and freezes") 1. Revoke pending cap changes and set cap to zero. 2. Submit forced removal (timelocked), then remove from withdraw queue after delay. Treat trapped funds as lost until recoverable. ### Curator or allocator misbehavior[​](https://docs.euler.finance/developers/euler-earn/allocator-handbook#curator-or-allocator-misbehavior "Direct link to Curator or allocator misbehavior") * Replace Curator (Owner action), revoke pending actions, and revert risky changes (lower caps, reallocate). * Remove misbehaving Allocators and restore sensible queues and allocations. Best practices -------------- * Diversify: keep single-strategy caps well below 100% of vault assets. * Prefer liquid strategies early in the withdraw queue; highest APY first in supply queue. * Maintain an idle buffer proportional to withdrawal patterns. * Communicate changes and rationales; use timelocks transparently. * Use multi-sigs for privileged roles; audit role assignments periodically. * [Deploying an Earn vault](https://docs.euler.finance/developers/euler-earn/allocator-handbook#deploying-an-earn-vault) * [Managing strategy caps and risk](https://docs.euler.finance/developers/euler-earn/allocator-handbook#managing-strategy-caps-and-risk) * [Rebalancing and reallocation](https://docs.euler.finance/developers/euler-earn/allocator-handbook#rebalancing-and-reallocation) * [Fees, harvesting, and smearing](https://docs.euler.finance/developers/euler-earn/allocator-handbook#fees-harvesting-and-smearing) * [Emergency scenarios](https://docs.euler.finance/developers/euler-earn/allocator-handbook#emergency-scenarios) * [Strategy becomes unsafe](https://docs.euler.finance/developers/euler-earn/allocator-handbook#strategy-becomes-unsafe) * [Strategy reverts and freezes](https://docs.euler.finance/developers/euler-earn/allocator-handbook#strategy-reverts-and-freezes) * [Curator or allocator misbehavior](https://docs.euler.finance/developers/euler-earn/allocator-handbook#curator-or-allocator-misbehavior) * [Best practices](https://docs.euler.finance/developers/euler-earn/allocator-handbook#best-practices) --- # Comparison with Traditional AMMs | Euler Docs [Skip to main content](https://docs.euler.finance/developers/euler-swap/comparison#__docusaurus_skipToContent_fallback) On this page EulerSwap’s design contrasts with conventional AMMs in a few notable ways: Liquidity Location ------------------ * **Traditional AMMs**: LP funds sit in a dedicated pool contract, idle except for swaps. * **EulerSwap**: Liquidity stays in the LP’s Euler vault (user account) and is not locked away. This means funds can earn lending interest and even be utilized elsewhere simultaneously, improving capital use. Revenues -------- * **Traditional AMMs**: LPs earn only swap fees (plus any external incentives). * **EulerSwap**: LPs earn swap fees + lending interest + protocol rewards on their assets at the same time. This multi-source yield can substantially increase LP returns. AMM Curve --------- * **Uniswap v2**: fixed invariant (x\*y=k, 50/50 liquidity). * **Uniswap v3**: concentrated ranges set by LPs (active management but manual). * **Stableswap**: concentration is adjustable via amplification factor. * **EulerSwap**: fully parameterizable curves at pool creation which means that users can replicate a constant-product, stable-swap, or custom shape by tuning the concentration parameter. Users also set the equilibrium price explicitly, which avoids initial mispricing. Once set, the curve is fixed for that pool, but users have flexibility to choose it and redeploy if needed. Price Impact & Depth -------------------- * EulerSwap’s dynamic borrowing allows it to reduce price impact for a given amount of liquidity far more than traditional AMMs. In EulerSwap, depth can be boosted by lending market liquidity – effectively tapping the wider ecosystem liquidity. With an EulerSwap pool that has $100k in a vault could facilitate a $1m swap, by borrowing against that $100k to facilitate the trade. The trade-off is potential temporary borrowing and slightly higher gas (see below). Integration & Composability --------------------------- * EulerSwap is built for maximum integration. Its compatibility with Uniswap v4 hooks means that as aggregators and the next-gen Uniswap roll out, EulerSwap pools can be discovered and used by traders seamlessly. In effect, EulerSwap could become a specialist liquidity source within larger networks (for instance, providing deep stablecoin liquidity that aggregators tap into). EulerSwap is positioned to slot into the routers of dex aggregators by design. Furthermore, EulerSwap benefits from Euler’s composability: Users can bundle lending and swap actions together in one transaction using batch transactions. * For ideas and inspirations we recommend checking our finalists to Encode Hackathon [here](https://www.youtube.com/watch?v=BSSnAI8DnxQ) . Simply put, EulerSwap maintains the core function of an AMM but builds upon it with Euler’s lending capabilities to create a more capital-efficient, flexible, and integratable DEX. * [Liquidity Location](https://docs.euler.finance/developers/euler-swap/comparison#liquidity-location) * [Revenues](https://docs.euler.finance/developers/euler-swap/comparison#revenues) * [AMM Curve](https://docs.euler.finance/developers/euler-swap/comparison#amm-curve) * [Price Impact & Depth](https://docs.euler.finance/developers/euler-swap/comparison#price-impact--depth) * [Integration & Composability](https://docs.euler.finance/developers/euler-swap/comparison#integration--composability) --- # Borrow | Euler Docs [Skip to main content](https://docs.euler.finance/user-guide/borrowing-assets#__docusaurus_skipToContent_fallback) On this page ![](https://docs.euler.finance/img/user-guide/general/borrowGeneral.png) **Figure 1:** The Borrow page of Euler Borrowing assets on Euler allows you to use your deposited collateral to access additional liquidity. This guide will walk you through the process of borrowing assets from Euler Vaults. Why Borrow Assets? ------------------ Borrowing assets can be useful for various purposes, such as accessing liquidity without selling your collateral, leveraging your position for potential gains, or participating in specific strategies. Borrowers pay interest based on the vault's [**Interest Rate Model (IRM)**](https://docs.euler.finance/concepts/financial/interest-rates#interest-rate-models-irm) , which is distributed to suppliers. warning Borrowing involves risks, including the potential for liquidation if your health score falls below a certain threshold. It's crucial to monitor your position and maintain a healthy collateral ratio. Finding Borrow Pairs -------------------- The "Borrow" page in the Euler app ([app.euler.finance/borrow](https://app.euler.finance/borrow) ) lists all available borrow pairs. 1. **Navigate:** Go to the "Borrow" page. 2. **Browse Pairs:** Each row in the table displays: * **Collateral Asset:** The asset you will supply as collateral (with market name) * **Debt Asset:** The asset you wish to borrow (with market name) * **Supply APY:** The annual percentage yield for supplying the collateral asset (may include rewards) * **Borrow APY:** The annual percentage yield for borrowing the debt asset (may include rewards) * **Max ROE:** The maximum potential Return on Equity for the pair * **Max Multiplier:** The highest leverage multiplier available for this pair * **LLTV:** The liquidation loan-to-value ratio for the pair * **Liquidity:** The available liquidity for borrowing, shown in both USD and asset units You can sort and filter by any of these columns. Click on a pair to view more details and open a borrow position. info Each APY value is inclusive of intrinsic yield (e.g., staking yield) and available rewards campaigns. Hover over the value for a breakdown. ![](https://docs.euler.finance/img/user-guide/apyBreakdown.png) Risk Considerations Borrowing involves risks, including smart contract risk and the risk of liquidation. Understand the specific risks associated with the pair before borrowing. Understanding the Borrow/Multiply Position Page ----------------------------------------------- When you select a borrow pair, you're taken to a detailed page that is shared by both Borrow and Multiply actions. The only difference is the form shown, depending on whether you select "Borrow" or "Multiply" at the top. **Key Metrics and Sections:** * **Overview:** At the top, you'll see the collateral and debt assets, the market, and a summary of key metrics. * **Key Metrics:** These include: * **Supply APY:** Yield for supplying the collateral asset. * **Borrow APY:** Cost (or reward) for borrowing the debt asset. * **Max ROE:** Maximum potential Return on Equity. * **Max Multiplier:** Highest leverage available for this pair. * **LLTV:** Liquidation Loan-to-Value ratio. * **Liquidity:** Available liquidity for borrowing, in both USD and asset units. * **Oracle Section:** This section shows which price oracle is used for the pair, providing transparency on how prices and risk are determined. * **Tabs for Collateral and Debt:** You can switch between the "Collateral" and "Debt" tabs to see more details about each vault, including risk parameters, governor, exposure, utilization, and more. tip The same page is used for both Borrow and Multiply. Simply select the desired action at the top to switch between the two forms. The Borrowing Process --------------------- Once you have chosen a pair on the "Borrow" tab: 1. **Specify Amount:** In the borrow interface, enter the amount of the debt asset you wish to borrow. You can often see your wallet balance and use a "Max" button. 2. **Collateral Selection:** Choose the source of your collateral. If you have the required asset in your wallet, you can supply it directly. If you already have the asset supplied in your Savings (account 0), you can select it as the collateral source using the drop-down menu that appears. This allows you to use existing deposits or supply new collateral as needed. 3. **Confirm Borrow:** After approval (or if already granted), click the "Borrow" button and confirm the transaction in your wallet. This transfers the borrowed asset to your wallet and requires a gas fee. 4. **Approve (if necessary):** If this is your first time using a particular asset as collateral, you will need to approve the Euler smart contracts to interact with your collateral token. Euler uses Permit2 by default for token approvals, which allows for more gas-efficient approvals and revocations. You can disable Permit2 usage in the settings if preferred. If your wallet supports EIP-7702, it will be automatically detected and approvals will be batched with the borrow transaction, eliminating the need for a separate approval transaction or message signature. note The Net APY in the transaction summary takes into account the impact your position has on the vaults, reflecting where the new interest rates will be at. This does not consider impact on rewards. tip ou can either supply directly by clicking "Open position" or use "Add to batch" if you want to build a more complex transaction (for example, batching multiple actions together before submitting). Batching can help save on gas and streamline your workflow when performing several actions at once. After Borrowing --------------- * **Portfolio Update:** Your borrowed assets will appear under the "Positions" tab within your "Portfolio" section. You will see your borrow balance and the corresponding Borrow APY. * **Managing Your Position:** Monitor your health score and collateral ratio regularly. Adjust your position as needed to maintain a healthy collateral ratio and avoid liquidation. * **Repaying:** You can repay your borrowed assets at any time from the Portfolio section. You may choose to repay your debt from your position's collateral, savings, or wallet. * [Why Borrow Assets?](https://docs.euler.finance/user-guide/borrowing-assets#why-borrow-assets) * [Finding Borrow Pairs](https://docs.euler.finance/user-guide/borrowing-assets#finding-borrow-pairs) * [Understanding the Borrow/Multiply Position Page](https://docs.euler.finance/user-guide/borrowing-assets#understanding-the-borrowmultiply-position-page) * [The Borrowing Process](https://docs.euler.finance/user-guide/borrowing-assets#the-borrowing-process) * [After Borrowing](https://docs.euler.finance/user-guide/borrowing-assets#after-borrowing) --- # EulerSwap | Euler Docs [Skip to main content](https://docs.euler.finance/user-guide/euler-swap#__docusaurus_skipToContent_fallback) On this page Overview -------- EulerSwap's liquidity provision interface guides you through a simple 5-step process to create your liquidity positions. Getting Started --------------- * Connect your wallet to the EulerSwap interface * Ensure you have assets in supported Euler vaults * Follow the 5-step flow to create your position * Monitor and adjust your position as needed Step-by-Step Guide ------------------ ### Step 1: Choose Your LP Strategy[​](https://docs.euler.finance/user-guide/euler-swap#step-1-choose-your-lp-strategy "Direct link to Step 1: Choose Your LP Strategy") Select from three position types optimized for different goals. Leveraged and Just-in-Time (JIT) Liquidity are most suitable for correlated pairs. * **Ordinary LP**: Traditional liquidity provision with lending yield benefits * **JIT Liquidity LP**: Maximize capital efficiency with Just-in-Time liquidity provision * **Leveraged LP**: Amplify your position through collateral looping ### Step 2: Select Vaults[​](https://docs.euler.finance/user-guide/euler-swap#step-2-select-vaults "Direct link to Step 2: Select Vaults") Choose the vaults that will form your liquidity position. * The interface shows compatible vaults based on your selections * Funds must be allocated to these vaults before proceeding ### Step 3: Choose Liquidity Amounts[​](https://docs.euler.finance/user-guide/euler-swap#step-3-choose-liquidity-amounts "Direct link to Step 3: Choose Liquidity Amounts") Configure your position by setting: * Deposit amounts for each asset * Single-sided or balanced liquidity options * Maximum borrowing limits for enhanced depth Real-time USD values help you understand your total position size. ### Step 4: Choose Concentration Factor[​](https://docs.euler.finance/user-guide/euler-swap#step-4-choose-concentration-factor "Direct link to Step 4: Choose Concentration Factor") The concentration factor determines the distribution across the entire liquidity range. While EulerSwap always provides full-range liquidity, a low concentration factor means liquidity is spread more evenly. A concentration factor of 0 is equivalent to a Uniswap-v2 liquidity position. As the concentration factor increases, liquidity is distributed more tightly around the equilibrium price, supported higher volume in concentrated pairs. At a concentration factor of 1, there is no price impact, meaning most pools will want to use a concentration factor below 1. Note carefully the prices served by the majority of your liquidity distribution, as you hover over the ends of the liquidity graph. ### Step 5: Review and Deploy[​](https://docs.euler.finance/user-guide/euler-swap#step-5-review-and-deploy "Direct link to Step 5: Review and Deploy") Before confirming, review your complete position details: * Total liquidity value * Expected rewards APR * Concentration parameters * Health metrics One click deploys your position and begins earning fees immediately. * [Overview](https://docs.euler.finance/user-guide/euler-swap#overview) * [Getting Started](https://docs.euler.finance/user-guide/euler-swap#getting-started) * [Step-by-Step Guide](https://docs.euler.finance/user-guide/euler-swap#step-by-step-guide) * [Step 1: Choose Your LP Strategy](https://docs.euler.finance/user-guide/euler-swap#step-1-choose-your-lp-strategy) * [Step 2: Select Vaults](https://docs.euler.finance/user-guide/euler-swap#step-2-select-vaults) * [Step 3: Choose Liquidity Amounts](https://docs.euler.finance/user-guide/euler-swap#step-3-choose-liquidity-amounts) * [Step 4: Choose Concentration Factor](https://docs.euler.finance/user-guide/euler-swap#step-4-choose-concentration-factor) * [Step 5: Review and Deploy](https://docs.euler.finance/user-guide/euler-swap#step-5-review-and-deploy) ---