Euler 백서

Euler

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 26쪽 중 9쪽

for debt amounts, making debt modifications visible in block explorers and trackable by tax-accounting software #### 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 curator who can adjust parameters like accepted collateral, borrowing limits, and pricing models as market conditions evolve. This approach can reduce the amount of parameter management a user performs directly, but it also means users depend on the curator's decisions and operating process. Finalized vaults have their vault-level governor revoked, so EVault parameters controlled by that governor can no longer be changed. Other authority is deployment-specific: a separately governed oracle router or connected collateral vault can still change, and a vault deployed behind an upgradeable beacon can still depend on the factory's upgrade administrator. Review the deployed contracts and every connected role before treating a vault as fixed. ### Earn vaults Earn vaults are designed for users who want one position with allocation across configured strategies instead of manually moving assets among individual lending vaults or other ERC-4626 strategies. Built on the ERC-4626 standard, they accept one deposited asset and issue shares that represent the user's claim on the Earn vault. Curators and allocators manage the strategy set, caps, queues, rebalancing, and liquidity plan within the vault's configured permissions. This delegates day-to-day allocation decisions while keeping allocations and role addresses visible onchain. Users still need to choose the Earn vault and evaluate its manager, strategies, fees, and withdrawal liquidity. #### Key features Earn vaults provide a single deposit and withdrawal interface while allocation happens inside the vault. Configured roles can manage allocations only through actions authorized by the deployed contracts. Outcomes still depend on strategy performance, fees, liquidity, allocation decisions, role permissions, and market conditions. ### Vault composition One of Euler's main vault design features 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, cross-collateralized clusters. Curators and asset managers can layer Earn vaults on top of EVK vaults to allocate deposits across selected strategies. This composability enables more complex products, but each layer adds dependencies that users and curators should review. 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). ## Hooks Hooks are optional policy checks attached to an EVK vault. They let a vault apply additional rules to selected operations—such as deposit, withdraw, transfer, borrow, repay, or liquidation—without changing the vault's core accounting logic. Common uses include access control, emergency pauses, exposure limits, and other market-specific invariants. A vault's hook configuration contains a **hook target** contract and a bitfield identifying the **hooked operations**. When a selected operation runs, the vault calls the hook target with the operation's calldata and caller context. If the hook returns successfully, the vault continues; if it reverts, the entire operation reverts. Operations not selected in the bitfield bypass the hook. A separate vault-status hook can check post-transaction conditions when the EVC completes a batch. The hook target becomes part of the vault's security and availability boundary. Users and integrators should review which operations are hooked, the target's code and privileged roles, whether it can be upgraded or paused, and whether a failure could block repayments, withdrawals, or liquidations. ### Common patterns <div className="hook-use-cases" aria-label="Common hook use cases"> <section className="hook-case-card"> <div className="hook-case-card__copy"> <span>Access policy</span> <strong>Permissioned deposits or borrows</strong> <p>Restrict selected actions to approved users, institutions, market makers, or borrowers with an assigned credit line.</p> </div> <svg className="hook-case-card__map" viewBox="0 0 430 172" role="img" aria-label="Allowlisted access hook"> <defs> <marker id="hook-arrow-access" markerWidth="4" markerHeight="4" refX="3.6" refY="2" orient="auto"> <path d="M0 0 L4 2 L0 4 Z" /> </marker> </defs> <rect className="hook-case-card__box" x="18" y="54" width="92" height="56" rx="8" /> <text className="hook-case-card__label" x="64" y="78" textAnchor="middle">Deposit</text> <text className="hook-case-card__sublabel" x="64" y="98" textAnchor="middle">or borrow</text> <rect className="hook-case-card__box hook-case-card__box--hook" x="150" y="54" width="122" height="56" rx="8" /> <text className="hook-case-card__label" x="211" y="78" textAnchor="middle">Allowlist</text> <text className="hook-case-card__sublabel" x="211" y="98" textAnchor="middle">Role check</text> <rect className="hook-case-card__box hook-case-card__box--allow" x="312" y="54" width="96" height="56" rx="8" /> <text className="hook-case-card__label" x="360" y="78" textAnchor="middle">Proceed</text> <text className="hook-case-card__sublabel" x="360" y="98" textAnchor="middle">If approved</text> <path className="hook-case-card__line" d="M110 82 H150" markerEnd="url(#hook-arrow-access)" /> <path className="hook-case-card__line" d="M272 82 H312" markerEnd="url(#hook-arrow-access)" /> <circle className="hook-case-card__dot" r="2.5"> <animateMotion path="M110 82 H150" dur="2.8s" begin="-0.4s" calcMode="paced" repeatCount="indefinite" /> </circle> <circle className="hook-case-card__dot" r="2.5"> <animateMotion path="M272 82 H312" dur="2.8s" begin="-1.8s" calcMode="paced" repeatCount="indefinite" /> </circle> </svg> <p className="hook-case-card__note">A hook can enforce an onchain allowlist or credential state, but it does not itself verify identity or establish legal eligibility.</p> </section> <section className="hook-case-card"> <div className="hook-case-card__copy"> <span>Emergency response</span> <strong>Pause or circuit breaker</strong> <p>Block risky operations during an oracle incident, liquidity stress event, exploit response, or asset-specific disruption.</p> </div> <svg className="hook-case-card__map" viewBox="0 0 430 172" role="img" aria-label="Pause guardian hook"> <defs> <marker id="hook-arrow-pause" markerWidth="4" markerHeight="4" refX="3.6" refY="2" orient="auto"> <path d="M0 0 L4 2 L0 4 Z" /> </marker> <marker id="hook-arrow-pause-block" markerWidth="4" markerHeight="4" refX="3.6" refY="2" orient="auto"> <path d="M0 0 L4 2 L0 4 Z" /> </marker> </defs> <rect className="hook-case-card__box" x="18" y="54" width="92" height="56" rx="8" /> <text className="hook-case-card__label" x="64" y="78" textAnchor="middle">Borrow</text> <text className="hook-case-card__sublabel" x="64" y="98" textAnchor="middle">or withdraw</text> <rect className="hook-case-card__box hook-case-card__box--warning" x="150" y="54" width="122" height="56" rx="8" /> <text className="hook-case-card__label" x="211" y="78" textAnchor="middle">Risk signal</text> <text className="hook-case-card__sublabel" x="211" y="98" textAnchor="middle">Guardian state</text> <rect className="hook-case-card__box hook-case-card__box--block" x="312" y="54" width="96" height="56" rx="8" /> <text className="hook-case-card__label" x="360" y="78" textAnchor="middle">Revert</text> <text className="hook-case-card__sublabel" x="360" y="98" textAnchor="middle">If paused</text> <path className="hook-case-card__line" d="M110 82 H150" markerEnd="url(#hook-arrow-pause)" /> <path className="hook-case-card__line hook-case-card__line--block" d="M272 82 H312" markerEnd="url(#hook-arrow-pause-block)" /> <circle className="hook-case-card__dot" r="2.5"> <animateMotion path="M110 82 H150" dur="2.8s" begin="-0.4s" calcMode="paced" repeatCount="indefinite" /> </circle> <circle className="hook-case-card__dot hook-case-card__dot--block" r="2.5"> <animateMotion path="M272 82 H312" dur="2.8s" begin="-1.8s" calcMode="paced" repeatCount="indefinite" /> </circle> </svg> <p className="hook-case-card__note">Design pauses narrowly when possible so de-risking actions, such as repay, can remain available.</p> </section> <section className="hook-case-card"> <div className="hook-case-card__copy"> <span>Market invariant</span> <strong>Utilization or exposure caps</strong> <p>Run a post-condition check at vault status time to prevent utilization, exposure, or concentration from moving beyond a configured bound.</p> </div> <svg className="hook-case-card__map" viewBox="0 0 430 172" role="img" aria-label="Utilization cap hook"> <defs> <marker id="hook-arrow-invariant" markerWidth="4" markerHeight="4" refX="3.6" refY="2" orient="auto"> <path d="M0 0 L4 2 L0 4 Z" /> </marker> </defs> <rect className="hook-case-card__box" x="18" y="54" width="92" height="56" rx="8" /> <text className="hook-case-card__label" x="64" y="78" textAnchor="middle">Batch</text> <text className="hook-case-card__sublabel" x="64" y="98" textAnchor="middle">User action</text> <rect className="hook-case-card__box hook-case-card__box--hook" x="150" y="54" width="122" height="56" rx="8" /> <text className="hook-case-card__label" x="211" y="78" textAnchor="middle">Status hook</text> <text className="hook-case-card__sublabel" x="211" y="98" textAnchor="middle">Utilization \<= cap</text> <rect className="hook-case-card__box hook-case-card__box--allow" x="312" y="54" width="96" height="56" rx="8" /> <text className="hook-case-card__label" x="360" y="78" textAnchor="middle">Settle</text> <text className="hook-case-card__sublabel" x="360" y="98" textAnchor="middle">If valid</text> <path className="hook-case-card__line" d="M110 82 H150" markerEnd="url(#hook-arrow-invariant)" /> <path className="hook-case-card__line" d="M272 82 H312" markerEnd="url(#hook-arrow-invariant)" /> <circle className="hook-case-card__dot" r="2.5"> <animateMotion path="M110 82 H150" dur="2.8s" begin="-0.4s" calcMode="paced" repeatCount="indefinite" /> </circle> <circle className="hook-case-card__dot" r="2.5"> <animateMotion path="M272 82 H312" dur="2.8s" begin="-1.8s" calcMode="paced" repeatCount="indefinite" /> </circle> </svg> <p className="hook-case-card__note">Useful for utilization ceilings, per-account limits, issuer exposure, or collateral-count limits.</p> </section> <section className="hook-case-card"> <div className="hook-case-card__copy"> <span>Position quality</span> <strong>Minimum debt or dust prevention</strong> <p>Reject transactions that would create positions too small to monitor, repay, or liquidate economically.</p> </div> <svg className="hook-case-card__map" viewBox="0 0 430 172" role="img" aria-label="Minimum debt hook"> <defs> <marker id="hook-arrow-dust" markerWidth="4" markerHeight="4" refX="3.6" refY="2" orient="auto"> <path d="M0 0 L4 2 L0 4 Z" /> </marker> <marker id="hook-arrow-dust-block" markerWidth="4" markerHeight="4" refX="3.6" refY="2" orient="auto"> <path d="M0 0 L4 2 L0 4 Z" /> </marker> </defs> <rect className="hook-case-card__box" x="18" y="54" width="92" height="56" rx="8" /> <text className="hook-case-card__label" x="64" y="78" textAnchor="middle">Borrow</text> <text className="hook-case-card__sublabel" x="64" y="98" textAnchor="middle">New debt</text> <rect className="hook-case-card__box hook-case-card__box--warning" x="150" y="54" width="122" height="56" rx="8" /> <text className="hook-case-card__label" x="211" y="78" textAnchor="middle">Debt size</text> <text className="hook-case-card__sublabel" x="211" y="98" textAnchor="middle">Above minimum?</text> <rect className="hook-case-card__box hook-case-card__box--block" x="312" y="54" width="96" height="56" rx="8" /> <text className="hook-case-card__label" x="360" y="78" textAnchor="middle">Block dust</text> <text className="hook-case-card__sublabel" x="360" y="98" textAnchor="middle">If too small</text> <path className="hook-case-card__line" d="M110 82 H150" markerEnd="url(#hook-arrow-dust)" /> <path className="hook-case-card__line hook-case-card__line--block" d="M272 82 H312" markerEnd="url(#hook-arrow-dust-block)" /> <circle className="hook-case-card__dot" r="2.5"> <animateMotion path="M110 82 H150" dur="2.8s" begin="-0.4s" calcMode="paced" repeatCount="indefinite" /> </circle> <circle className="hook-case-card__dot hook-case-card__dot--block" r="2.5"> <animateMotion path="M272 82 H312" dur="2.8s" begin="-1.8s" calcMode="paced" repeatCount="indefinite" /> </circle> </svg> <p className="hook-case-card__note">Avoid broad rules that accidentally block repayments, liquidations, or account cleanup flows.</p> </section> <section className="hook-case-card hook-case-card--wide"> <div className="hook-case-card__copy"> <span>Permissioned asset</span> <strong>RWA transfer and redemption controls</strong> <p>For tokenized asset markets, hooks can enforce specified onchain conditions supplied by an allowlist, credential contract, issuer, or other system.</p> </div> <svg className="hook-case-card__map" viewBox="0 0 620 172" role="img" aria-label="RWA controls hook"> <defs> <marker id="hook-arrow-rwa" markerWidth="4" markerHeight="4" refX="3.6" refY="2" orient="auto"> <path d="M0 0 L4 2 L0 4 Z" /> </marker> </defs> <rect className="hook-case-card__box" x="24" y="54" width="102" height="56" rx="8" /> <text className="hook-case-card__label" x="75" y="78" textAnchor="middle">Transfer</text> <text className="hook-case-card__sublabel" x="75" y="98" textAnchor="middle">Vault shares</text> <rect className="hook-case-card__box hook-case-card__box--hook" x="174" y="54" width="132" height="56" rx="8" /> <text className="hook-case-card__label" x="240" y="78" textAnchor="middle">Eligibility</text> <text className="hook-case-card__sublabel" x="240" y="98" textAnchor="middle">Sender and receiver</text> <rect className="hook-case-card__box hook-case-card__box--warning" x="354" y="54" width="112" height="56" rx="8" /> <text className="hook-case-card__label" x="410" y="78" textAnchor="middle">Asset event</text> <text className="hook-case-card__sublabel" x="410" y="98" textAnchor="middle">Issuer state</text> <rect className="hook-case-card__box hook-case-card__box--allow" x="514" y="54" width="82" height="56" rx="8" /> <text className="hook-case-card__label" x="555" y="78" textAnchor="middle">Allow</text> <text className="hook-case-card__sublabel" x="555" y="98" textAnchor="middle">or revert</text> <path className="hook-case-card__line" d="M126 82 H174" markerEnd="url(#hook-arrow-rwa)" /> <path className="hook-case-card__line" d="M306 82 H354" markerEnd="url(#hook-arrow-rwa)" /> <path className="hook-case-card__line" d="M466 82 H514" markerEnd="url(#hook-arrow-rwa)" /> <circle className="hook-case-card__dot" r="2.5"> <animateMotion path="M126 82 H174" dur="3s" begin="-0.4s" calcMode="paced" repeatCount="indefinite" /> </circle> <circle className="hook-case-card__dot" r="2.5"> <animateMotion path="M306 82 H354" dur="3s" begin="-1.5s" calcMode="paced" repeatCount="indefinite" /> </circle> <circle className="hook-case-card__dot" r="2.5"> <animateMotion path="M466 82 H514" dur="3s" begin="-2.6s" calcMode="paced" repeatCount="indefinite" /> </circle> </svg> <p className="hook-case-card__note">Whether the condition source satisfies KYC, KYB, sanctions, accreditation, jurisdiction, issuer, or transfer-agent requirements depends on the offchain process and responsible parties. A hook does not itself establish legal or regulatory compliance.</p> </section> </div> ### Designing hook policies Hook policies should be specific about which operation they control and what happens when the policy fails. Common patterns include: * **Deposit-only restrictions**: allow anyone to withdraw or repay, but restrict new deposits or borrows to approved accounts. * **Borrow restrictions**: allow public supply while limiting debt creation to approved borrowers or configured credit lines. * **Transfer restrictions**: restrict vault-share transfers when the share token represents exposure to a permissioned or RWA-backed product. * **Status-check restrictions**: enforce post-transaction invariants such as utilization ceilings, exposure limits, or per-account concentration limits. * **Emergency restrictions**: temporarily block risky actions while allowing de-risking actions such as repay or withdraw where appropriate. Operators should test hooks against normal user flows, liquidations, EVC batches, sub-accounts, and integrator assumptions. A hook that is too broad can accidentally block required actions or make a vault behave differently from a standard ERC-4626 integration. ### Implementation details When a hooked operation runs, the vault calls the hook target with the same `msg.data` and trailing caller context. Ordinary operation hooks receive the EVC-authenticated caller; the final vault-status hook receives `address(evc)` and therefore carries no authenticated-account identity in that trailer. The hook target must satisfy `IHookTarget.isHookTarget()`; it can handle selected selectors in explicit functions or a fallback and return successfully or revert. It does not need to implement the full vault interface. 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). ### Read next * [Advanced concepts](/introduction) * [RWA Vaults](/build/rwa-vaults) * [Hooks and custom logic](/curate/vaults/evk/hooks-custom-logic) * [Build](/build) * [Curate](/curate) ## Interest Rate Models Interest rates are how Euler balances lenders who want yield with borrowers who want liquidity. Borrowers pay interest on outstanding debt, lenders receive yield from that interest, and each vault uses its configured Interest Rate Model (IRM) to decide the current borrow rate. The most important input is usually utilization: how much of the supplied liquidity is currently borrowed. When utilization rises, liquidity becomes scarcer, so borrowing normally becomes more expensive. ### The common pattern <div className="irm-overview" aria-label="Interest rate model inputs and outputs"> <div className="irm-overview__panel"> <strong>Vault state</strong> <span>Supply, borrows, utilization, and the current point in time.</span> </div> <div className="irm-overview__arrow" aria-hidden="true"> <span /> </div> <div className="irm-overview__panel irm-overview__panel--model"> <strong>Interest Rate Model</strong> <span>The vault's configured rule for turning state into a borrow rate.</span> </div> <div className="irm-overview__arrow" aria-hidden="true"> <span /> </div> <div className="irm-overview__panel"> <strong>Market rates</strong> <span>Borrow cost, lender yield, and any configured vault-level fee.</span> </div> </div> ### IRM types Euler supports several IRM styles. The diagrams below use utilization on the horizontal axis and borrow rate on the vertical axis, except the cyclical model, which changes by time instead of utilization. <div className="irm-diagram-grid"> <section className="irm-diagram" aria-label="Linear kink interest rate model"> <div className="irm-diagram__copy"> <span>Linear Kink</span> <strong>Gentle until the kink, steep after it</strong> <p>Rates climb steadily while a vault has normal spare liquidity. After the kink, the slope gets much steeper to discourage over-utilization.</p> </div> <div className="irm-chart irm-chart--kin
프로젝트로 돌아가기