Order flow router
The Euler Order Flow Router is an offchain meta-aggregator used by Euler swap and Multiply flows. It queries configured routing strategies, compares eligible responses, and returns route details and calldata that an application can place into an EVC batch.
This allows a user to open, rebalance, or close a position in one transaction while still reviewing the route, slippage bound, and resulting position before signing.
How it fits into a swap
A router response can provide data for Swapper and SwapVerifier:
Swapperexecutes the encoded external route and, in target-debt mode, performsrepayor_repayAndDeposit.- The selected
SwapVerifierfunction checks the configured minimum output or maximum remaining debt and deadline. - For regular output paths, a verifier function can also skim and deposit or transfer output after the amount check.
- The EVC completes the required vault and account status checks for the batch.
The router builds a quote and payload; it does not execute the user's transaction. Applications should validate the returned chain, tokens, vaults, accounts, recipients, targets, calldata, amounts, approvals, slippage, and deadline.
See Periphery swaps for the execution and verification flow.
Strategies and pipelines
Requests pass through a chain-specific pipeline. A strategy can answer a request, modify it, combine routes, or invoke another stage.
Current source includes:
StrategyAggregators(aggregators): gathers quotes from configured aggregators and compares eligible responses.StrategyCombinedUniswap: combines an aggregator exact-input leg with a Uniswap exact-output remainder where configured.- ERC-4626 and asset wrappers: compose deposits, redemptions, or direct conversion routes with other quote legs.
- Connection strategies: join routes through an intermediary token or another strategy stage.
Provider and pipeline configuration varies by chain and can change over time. Check the current router repository and API for the intended request.
Multiply entry and exit
A typical Multiply entry batch can:
- supply the initial margin;
- borrow while the required liquidity check is deferred;
- swap into the collateral asset;
- route output through the selected verifier path; and
- finish the verifier and EVC status checks.
A typical unwind withdraws collateral, executes a target-debt swap, lets Swapper repay the debt, and uses verifyDebtMax to enforce a maximum remaining balance. The exact batch depends on the quote, token behavior, existing account state, and periphery version.
Debt-target routing
Debt continues to accrue between quote and execution. Depending on configuration, the router can:
- combine an aggregator exact-input route with an exact-output remainder; or
- size an exact-input quote with a buffer, then use target-debt post-processing to repay and handle any surplus.
The caller should set a deadline and remaining-debt maximum that account for interest, fees, slippage, rounding, liquidity, and token behavior.
Integration checklist
- Decode and validate returned targets and calldata according to the application's policy.
- Confirm input and output amounts and token decimals.
- Verify the output destination expected by the selected verifier flow.
- Keep approvals scoped to the intended spender and amount.
- Simulate the complete EVC batch against current state.
- Show the provider, route, fees, slippage bound, deadline, and resulting position to the signer.
- Handle no-quote, stale-quote, and provider-error responses.