bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 26쪽 중 15쪽
meters while using a single wallet.
#### How sub-accounts work
In the EVC, every Ethereum address is associated with 256 accounts, which includes the primary account (referred to as the owner). These accounts are identified by IDs ranging from 0 to 255, with ID 0 specifically assigned to the owner account. To generate sub-account addresses, the system performs an XOR operation between the account ID and the Ethereum address. Additionally, the EVC keeps track of sub-account ownership through a look-up mapping called `ownerLookup`, which helps resolve sub-accounts back to their respective owner addresses.
##### Important considerations
* Sub-account addresses are internal to the EVC and compatible vaults
* Ordinary ERC-20 contracts cannot authenticate EVC ownership of a derived sub-account. Use an address that actually controls the token balance and allowance unless the exact external flow is EVC-aware and reviewed.
* The EVC maintains a look-up mapping to resolve sub-accounts to their owner addresses
* Sub-accounts are the only way an account can hold multiple Vault borrows concurrently in the EVK
### Risk management
#### Health checks
Vaults implement two critical health check methods:
* `checkAccountStatus`: Verifies account solvency
* `checkVaultStatus`: Ensures vault-level limits are respected
These methods are invoked by the EVC at appropriate times, typically after all operations in a batch have been performed.
#### LTV (loan-to-value)
Each collateral vault is configured with an LTV that determines the maximum borrow amount against collateral. The system supports separate borrowing and liquidation LTVs. The borrowing LTV is used to limit new borrows, while the liquidation LTV is used when liquidating existing positions. This gap helps compensate for pricing delays and uncertainty, requiring larger price movements to get liquidated right after the position was created. The liquidation LTV can be smoothly ramped down by the vault governor when a collateral needs to be phased out.
#### Liquidations
When an account's risk-adjusted collateral value reaches or falls below its liability value, the account becomes eligible for liquidation. The liquidation system uses a reverse Dutch auction mechanism that scales the discount proportionally with how deeply in violation the position is. The mechanism has several practical effects:
* Slightly unhealthy positions may not be profitable to liquidate
* As prices move against the position, the discount increases
* A liquidator may execute when the discount covers execution, pricing, gas, and market risk
The liquidation discount is limited by a maximum liquidation discount parameter that vault creators must set appropriately. The discount is proportional to how far below the threshold the account is, which means that in some cases a liquidator may prefer many small liquidations rather than one large liquidation.
#### Bad debt socialization
When enabled, bad debt socialization cancels uncollateralized debt and socializes the loss to all depositors. This can reduce first-withdrawer advantage during bad debt events, but it still means depositors absorb losses. Vault governors who do not want debt socialization can disable this functionality.
### Advanced features
#### Hooks system
The hooks system lets vault governors apply onchain conditions to selected vault operations. It can pause operations, require an onchain allowlist or attestation, add flash-loan fees, enforce utilization caps, or set minimum debt sizes. A hook does not itself perform identity verification, sanctions screening, legal review, or make a vault compliant; document its data freshness, failure, upgrade, bypass, and emergency behavior.
For a full technical reference, see the [EVK whitepaper](https://github.com/euler-xyz/euler-vault-kit/blob/master/docs/whitepaper.md) or the [EVK repository](https://github.com/euler-xyz/euler-vault-kit).
### Read next
* [Interact with EVK vaults](/build/evk/interacting-with-vaults)
* [EVK security](/curate/vaults/evk/security)
* [Euler SDK](/build/sdk)
* [Launch toolkit](/launch)
## Security Considerations
The [**Euler Vault Kit (EVK)**](/curate/vaults/evk/overview) is designed with security as a priority, but there are inherent limitations and risks that developers and users should be aware of. This document outlines key security considerations when working with EVK vaults.
### Known Limitations
#### Governance Risk
Vaults can be configured in different combinations of upgradeable/immutable and governed/finalised. Each combination presents different risk profiles:
* **Upgradeable + Governed**: Subject to both factory admin and governor risks
* **Immutable + Governed**: Subject only to governor risks
* **Upgradeable + Finalised**: Subject only to factory admin risks
* **Immutable + Finalised**: Removes the configured vault-governor and factory-upgrade change paths. Risks can remain in oracles, collateral vaults, tokens, hooks, external integrations, and other governed dependencies.
There are also risks to creating immutable/finalised vaults:
* If market conditions change, making a formerly safe collateral asset or price oracle unsafe, only governed vaults can be reconfigured
* If critical bugs are found in the Vault Kit code, the factory admin will only be able to fix upgradeable vaults
#### Collateral Validation
Using vaults with illiquid or manipulable underlying assets could threaten the safety of depositors. It's critical to evaluate the smart contract code that implements each collateral vault. A badly coded or malicious vault could:
* Refuse to release funds in a liquidation event
* Lie about the value of its holdings
* Have dangerous configurations that might encounter bad debt situations
#### Hooks Security Concerns
Hooks can implement condition checks that (maliciously or not) could prevent liquidations from succeeding. Vaults with hooks installed should be carefully audited to ensure they don't interfere with critical functions like liquidations.
#### Exchange Rate Manipulation
While EVK implements several protections against exchange rate manipulation (virtual deposits, internal balance tracking), these protections are not perfect for external vaults and assets accepted as collateral. In particular, empty or near-empty external collateral vaults may still be susceptible to manipulation attacks, which could affect the security of any vault accepting them as collateral. Vault governors should carefully evaluate the risk profile of each external vault before accepting it as collateral. Refer to [Donation attacks](/curate/vaults/evk/donation-attacks) for more information.
#### Overflows
There are several potential overflow conditions that could affect vault operations:
* If values such as total supply, borrows, and cash approach their upper limits, the accounting logic of the vault becomes undefined
* The interest accumulator could eventually overflow if interest rates remain extremely high for extended periods
#### Price Oracle Risks
While the oracle adapters themselves (at least those developed by Euler) are immutable, vaults that use a governed oracle router can update their pricing source as long as governance over the router is retained. If the router is finalized or governance is revoked, the oracle configuration becomes immutable. If a price oracle becomes unreliable or compromised and the router is still governed, it can be updated to point to a new, secure adapter. Vaults rely on their configured oracle (or router) for pricing collateral and liabilities, so robust governance and timely updates are critical for security.
#### Nested Vault Limitations
A nested vault is a vault whose underlying asset is the share token of another Euler vault. Using a nested vault as collateral for the vault that issued that underlying share token can cause liquidation to fail due to re-entrancy issues when pricing the nested collateral. While some EVK deployments attempted to prevent this at the code level, this approach introduced operational challenges and is being reconsidered. The risk remains low-severity and is best addressed through careful governance. Vault governors should be aware that using nested vaults as collateral in this configuration may result in failed liquidations and should evaluate this risk when configuring vaults.
### Security Best Practices
#### Vault Configuration
When configuring vaults:
1. Carefully select appropriate LTVs based on both the underlying asset's risk and the vault containing it
2. Consider using both borrowing and liquidation LTVs to protect against oracle price delays and manipulation
3. Configure a non-zero liquidation cool-off period to prevent certain types of price oracle attacks
4. Use LTV ramping when reducing the liquidation LTV to avoid unfair liquidations
#### Collateral Validation
Before accepting a vault as collateral:
1. Verify it was created by a trusted factory by calling the factory's `isProxy()` function
2. Evaluate the security of its underlying asset, price oracle, and configuration
3. Verify that its `transfer` method doesn't invoke any external contracts that could run attacker code
4. Be cautious with vaults that have hooks installed, as they may interfere with liquidations
#### Oracle Security
When selecting price oracles:
1. Use reliable and decentralized oracle solutions when possible
2. Consider using oracles with a non-zero bid-ask spread to communicate real-time pricing risks
3. For cross pricing, ensure that all price sources in the chain are reliable
#### Risk Management
For ongoing risk management:
1. Monitor positions for unhealthy debt-to-collateral ratios
2. Implement robust liquidation systems to ensure unhealthy positions are liquidated efficiently
3. Consider the implications of using a vault as collateral that itself accepts risky collateral
#### Governance Practices
If governing a vault:
1. Make governance actions transparent and predictable to users
2. Use timelocks for sensitive operations like changing LTVs or price oracles
3. Consider using limited governor contracts that can only perform specific actions
4. Have clear procedures for emergency responses to market events or discovered vulnerabilities
### Vault Security Features
#### Liquidation Cool-Off Period
The cool-off period prevents an account from being liquidated inside a block where it was previously healthy. This protection helps prevent certain types of price oracle attacks by forcing attackers to keep positions open between blocks, exposing them to potential risk.
#### LTV Ramping
When reducing liquidation LTVs, a ramp duration can be specified to linearly decrease the LTV over time. This protects borrowers from sudden LTV changes that could cause unfair liquidations.
#### Bad Debt Socialisation
Vaults have bad debt socialisation enabled by default to handle cases where a liquidation still leaves an account with outstanding debt. This prevents bank-run scenarios as it socializes losses to all depositors.
#### Internal Balance Tracking
Vaults track balances internally rather than depending on direct token balance checks. This prevents certain types of donation-based exchange rate manipulations.
## Allocator automation
The [Euler Allocator Bot](https://github.com/euler-xyz/euler-allocator-bot) can monitor Earn vault strategies and submit reallocations according to an operator's policy. Automation should implement an approved allocation mandate rather than choose the mandate itself.
### What to automate
An allocator can evaluate strategy returns, utilization, available liquidity, current allocations, caps, and queue order, then propose or execute moves within configured limits. Reallocation decisions should account for withdrawal capacity and concentration, not APY alone.
### Controls
Keep strategy allowlists, concentration and liquidity limits, transaction-size limits, key management, monitoring, and escalation procedures outside the optimizer. Simulate each transaction against current state and stop automation when inputs are stale, a strategy behaves unexpectedly, or execution repeatedly fails.
For the underlying roles, caps, queues, and reallocation mechanics, see the [allocator handbook](/curate/vaults/euler-earn/allocator-handbook).
## Allocator and manager handbook
This guide covers the onchain controls used to operate an EulerEarn vault. Allocation policy remains vault-specific: strategy selection, concentration, queue order, liquidity reserves, and return objectives should follow the vault's published mandate.
### Roles
* **Owner:** manages all vault settings and inherits Curator, Allocator, and Guardian powers.
* **Curator:** enables strategies, manages caps, and inherits Allocator powers.
* **Allocator:** updates queues and reallocates assets within the configured caps.
* **Guardian:** can revoke specific pending actions.
Monitor current role holders and pending actions onchain. Use multisignature or other controlled accounts where appropriate to the vault's operating model.
### Strategy acceptance and caps
A strategy must be accepted by the selected factory before it can be enabled or receive a cap increase. Acceptance is checked again when a pending cap increase completes.
* Cap decreases, including zero, are immediate.
* Cap increases wait for the current timelock and can be revoked while pending.
* The first accepted positive cap enables the strategy and adds it to the withdrawal queue.
* A zero cap stops new allocation but does not withdraw the existing balance or remove queue entries.
Track both cap headroom and the strategy's current `maxDeposit`. A strategy may be unable to accept the full remaining cap.
### Supply and withdrawal queues
Both queues support up to 30 entries.
**Supply queue:** deposits try strategies in order, bounded by cap headroom and `maxDeposit`. Reverting entries are skipped, but the deposit fails if the complete amount cannot be placed. Reject duplicate entries even though the contract permits them.
**Withdrawal queue:** withdrawals try strategies in order, bounded by tracked assets and `maxWithdraw`. Limited liquidity reduces `maxWithdraw`. During execution, a reverting withdrawal is skipped, but the transaction fails if the remaining strategies cannot provide the requested amount.
Set queue order from the vault's strategy and liquidity policy rather than APY alone. Consider utilization, current liquidity, correlated exposure, withdrawal demand, gas, and failure behavior.
### Reallocate assets
`reallocate` moves listed strategies toward specified target balances. Withdrawals earlier in the list fund supplies later in the list, targets must remain within caps, and the total supplied must equal the total withdrawn.
Before execution:
1. read current balances, caps, queues, pending actions, `maxDeposit`, and `maxWithdraw`;
2. build and simulate the exact ordered allocation;
3. check it against allowed-strategy, concentration, liquidity, and transaction policies;
4. submit and monitor confirmation; and
5. reconcile events with final balances and withdrawal capacity.
### Remove a strategy
#### Normal removal
1. Revoke any pending cap increase.
2. Set the cap to zero.
3. Reallocate recoverable assets to other enabled strategies.
4. Remove the strategy from the supply queue.
5. Once its tracked balance is zero, omit it from the withdrawal queue.
The empty-balance check uses the vault's tracked strategy balance rather than the strategy token's raw `balanceOf` value.
#### Forced removal
Use forced removal only when a strategy persistently reverts and cannot be emptied. With the cap at zero and no pending cap, Owner or Curator submits the removal. Owner, Curator, or Guardian can revoke it. After the timelock, Owner, Curator, or Allocator removes the strategy by omitting it from the withdrawal queue.
Forced removal excludes remaining tracked assets from the active strategy set. It does not transfer or recover them. Quantify the effect on represented assets and withdrawal capacity before proceeding, and communicate the impact to users.
### Fees
The Owner configures the fee separately after deployment. For a nonzero fee, set a nonzero recipient before setting the fee. The maximum is `0.5e18` (50%). Set the fee to zero before clearing the recipient.
Fee-setting calls accrue fees under the previous configuration before applying the change. The documented implementation does not have a separate harvest or yield-smearing operation.
### Monitoring and incident response
Monitor roles, pending actions, factory acceptance, caps, queues, strategy balances, conversions, `maxDeposit`, `maxWithdraw`, transaction failures, fees, and `lostAssets`.
* **Strategy risk signal:** revoke pending cap increases, reduce the cap to zero, simulate and reallocate recoverable assets, then update queues when removal checks pass.
* **Persistently reverting strategy:** stop new allocation, assess normal withdrawal, and use forced removal only if continued operation justifies its accounting impact.
* **Role or key compromise:** stop affected automation, use available uncompromised roles to revoke pending actions or replace roles, rotate keys, and reconcile every change made by the affected address.
### Automate allocation
Reallocation within the controls above can be automated with the [Euler Allocator Bot](https://github.com/euler-xyz/euler-allocator-bot); see [Allocator automation](/curate/vaults/euler-earn/allocator-automation) for what to automate and the guardrails to keep around it.
## Deployment and management of EulerEarn vaults
**Curator → Earn** in the [Toolbox](/curate/toolbox) deploys EulerEarn vaults and manages their strategies, allocations, governance and fees. It needs only a wallet, no sign-in.
For scripted deployments or advanced operations, see the [allocator and manager handbook](/curate/vaults/euler-earn/allocator-handbook).
### Open a vault
Choose the network, then the vault: signed in as a curator, search your labelled Earn vaults; without a session, paste the vault's address. **Open vault** opens it, and **Create vault** starts a new one. **Recent** lists the Earn vaults you've opened; it's saved in this browser only.
The network is part of each Earn page's address: choosing another network changes the address, so a shared link or a reload opens on the same network.
### Deploy a vault
1. Choose **Create vault**.
2. Under **Core settings**, choose the network and enter the **Underlying asset address**, the **Vault name** and the **Vault symbol**. The connected wallet owns the vault, and the initial timelock is 0 days.
3. Choose **Build deployment plan**, then **Review deployment**.
4. Sign in your wallet. Once the receipt arrives, the Toolbox opens the new vault.
The initial timelock is always 0. With no delay, every owner and curator change applies at once, so you can configure the vault first; then set a timelock of 1 to 14 days under **Governance → Change timelock**. Once set, it can't go back to zero.
### The vault page
A vault has seven sections: **Overview**, **Strategies**, **Allocations**, **Governance**, **Fees**, **Assessments** and **Changes**. The header reads like a market's: the network and the block the page was read at (**Exact at block** N), the vault's published label as its title (its on-chain name until it has one), and the address it was opened from. A published description shows under the header, and a deprecated label or a notice shows as a warning. The header also shows the roles your wallet holds on the vault, and **Refresh** reads the vault again.
Under the header, a guide says where the vault stands and what to do next, as on a market page. It reads **Vault created** until the vault has a strategy (**Add strategies**) and **Strategies set** until the supply caps and queues are in place (**Set supply caps**, **Set the queues**). It reads **Vault configured** while the app do프로젝트로 돌아가기