← Protocols
Euler
01Description

Modular, permissionless lending built on the Euler Vault Kit (EVK) and Ethereum Vault Connector (EVC). Each market is an ERC-4626 vault that can be wired together as collateral via the EVC. Post-2023-exploit relaunch as Euler v2.

02Best for
  • 01permissionless lending markets
  • 02isolated risk vaults
  • 03cross-vault collateralization (EVC)
  • 04custom IRMs and oracles
  • 05advanced DeFi credit products
03Install
  • pnpm add viem
  • git clone https://github.com/euler-xyz/euler-interfaces
04Environment variables
VariableScopeDescription
NEXT_PUBLIC_EULER_EVCClientEthereum Vault Connector (EVC) address; resolve from euler-interfaces (per-chain).
NEXT_PUBLIC_EULER_VAULT_LENSClientVaultLens / AccountLens periphery address used to read vault and account state.
05Prompt snippet
Integrate Euler v2. The protocol is built around two primitives: the EVC (Ethereum Vault Connector) at a singleton address per chain, and EVK vaults (`EVault`) that are ERC-4626 lending markets. Always route writes through the EVC: call `EVC.call(targetVault, onBehalfOfAccount, value, data)` or `EVC.batch(BatchItem[])` to defer health checks and combine ops. Common vault calls: `EVault.deposit(assets, receiver)`, `EVault.withdraw(assets, receiver, owner)`, `EVault.borrow(assets, receiver)`, `EVault.repay(assets, receiver)`. Enable a vault as collateral with `EVC.enableCollateral(account, vault)` and as the active controller with `EVC.enableController(account, vault)`. Read state with the periphery `VaultLens` / `AccountLens` (`getVaultInfoFull`, `getAccountInfo`). Resolve current addresses from the `euler-xyz/euler-interfaces` repo (per-chain JSONs).
06Gotchas
  • Every borrow path MUST go through the EVC — calling `EVault.borrow` directly without `EVC.enableController` will revert; UIs that forget this break silently.
  • Each EVK vault is permissionless and IMMUTABLE — anyone can deploy a vault with any oracle, IRM, or LTV; verify the governor, oracle, and unitOfAccount before depositing.
  • Oracle dependency is per-vault — a vault can use Pyth, Chainlink, or a custom router; bad oracle config (stale price, untrusted source) leads to bad-debt liquidations.
  • Sub-accounts are derived from `address ^ uint8(subAccountId)` — when calling `onBehalfOfAccount`, don't confuse a sub-account address with the EOA, or signature-checks/permits will fail.
  • Health checks are deferred inside `EVC.batch` — a position can be temporarily unhealthy mid-batch but MUST be healthy at the end, otherwise the entire batch reverts.
  • Governed vaults can pause borrows or change LTVs; ungoverned vaults cannot — choose vault type to match your risk model.
  • Euler v1 was exploited in March 2023 for ~$197M (since fully recovered) — v2 is a complete rewrite, do not reuse v1 ABIs or addresses.
07Alternatives