EulerSwap on Ethereum
Uniswap v4 Hook Contract 0x0a661ae62d9e3912bae0947122b751a9f814e8a8 on Ethereum · Custom pricing · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 2
What it does
A custom-curve EulerSwap AMM that prices trades with its own invariant and settles them against Euler lending vaults, so traders swap against vault-backed reserves and LPs earn fees that accrue in those vaults.
How it works step by step
- Prices swaps with a custom EulerSwap curve (f and fInverse) defined by fixed equilibrium reserves, prices and concentration parameters.
- Settles swaps against Euler vaults: deposits received tokens and withdraws or borrows the output on behalf of the eulerAccount.
- Blocks v4 liquidity adds, donations and non-EulerSwap initializations to keep the pool usable only through the custom curve.
- Charges the swap fee on input and optionally forwards a protocol fee share to a recipient.
- Tracks reserves in its own storage and enforces the curve invariant after each swap.
- Swap behaviour
- On each swap the hook computes the output with its own curve (exact in or exact out), takes the input from PoolManager into the Euler vault, pays the output from vault balance or by borrowing, and returns a before-swap delta so the pool uses these amounts.
- Liquidity behaviour
- No liquidity callbacks in use for position management: beforeAddLiquidity is reverted by design so no v4 positions can be created. Reserves are backed by Euler vault deposits held by the eulerAccount, not by v4 liquidity.
- Fee behaviour
- Fee is a per-instance parameter p.fee (WAD scale) applied to the input amount inside QuoteLib and FundsLib.depositAssets; a protocolFee share can be forwarded to protocolFeeRecipient. The pool key is initialized with fee = p.fee / 1e12 pips, but actual fee collection is done by the curve logic, not by the Uniswap pool fee.
- Owner & admin controls
- Hook instances are deployed per pool by an operator; activate() is callable by anyone once (status 0 to 1) and sets the curve parameters, which are fixed in the Params struct appended to calldata, so there is no owner-set parameter. No owner, pause, or upgrade function is present in the implementation; the proxy itself may have an upgrade path not visible from the decoded functions. The eulerAccount holder controls the EVC operator authorization that gates swaps.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeAddLiquidity, beforeSwap, beforeDonate, beforeSwapReturnDelta
beforeInitialize: reverts unless initialization came through activateHook, preventing other pairs using this hook. beforeAddLiquidity: reverts intentionally to block v4 concentrated positions. beforeDonate: reverts to block irrecoverable donations. beforeSwap: computes the custom curve quote, takes input from PoolManager into Euler vaults, pays output from vaults to PoolManager, and returns a before-swap delta that overrides the pool's AMM math. beforeSwapReturnDelta: allows the hook to return that delta so the hook, not the v4 pool curve, sets swap amounts.
Security & trust assessment
Risk level: medium (verified source, medium confidence).
Who controls it: No privileged owner key is visible. The eulerAccount operator authorization and the vault configuration (controllers, caps, governance of the underlying Euler vaults) determine whether swaps can proceed; changes to those vaults by their governors can affect liquidity and quotes, and the curve params are fixed once activated.
Risk to user funds: The hook takes input tokens from PoolManager into Euler vaults and pays output from vaults, so it holds LP and swapper funds in external vaults. Funds can be affected by vault borrow caps, liquidity availability and the external vault governance; the hook itself has no admin withdrawal path visible in the decoded source.
Security findings
- [medium] Funds routed through external Euler vaults: Swaps move user and LP funds through Euler vault deposits and borrows on the eulerAccount. The hook borrows from the vault to pay output when balance is insufficient, so pool solvency depends on external vault health and caps.
- [medium] Custom curve math is the pricing source: The hook returns a before-swap delta and overrides v4 pricing, so correctness of the custom curve math (CurveLib.f and fInverse) is critical; any rounding or overflow bug would directly mis-price swaps.
- [medium] Upgradeable proxy pattern: The contract is deployed behind a proxy per the heuristic tags; the implementation can potentially be replaced by whoever controls the proxy admin, which would change swap logic for all funds in the instance.
- [low] Permissionless one-time activation: activate() is open to any caller once and sets the reserves, curve, and approvals; a deployer that does not activate atomically with setup could let a third party initialize an instance with arbitrary parameters.
- [info] Infinite approvals to vaults: Vaults are given max approvals, and EVC collateral is enabled for the eulerAccount, so a compromised vault or EVC path could drain the account.
Contract details
- Verified source
- Yes (EulerSwap)
- Compiler
- solc 0.8.27+commit.40a35a09
- Bytecode size
- 438 bytes
- Upgradeable proxy
- Yes
- Detected patterns
- erc20, moves-currency, return-delta, upgradeable
Pools using EulerSwap
- USDe / USDC (0.0049% fee) — 24h volume $0, TVL $0, 0 swaps today