Overview
Multiliquid V2 keeps the protocol’s NAV-based exchange model while consolidating the integration surface and adding delegated execution, atomic batching, and automatic liquidity management. This page collects the V1-to-V2 comparison in one place; the other Core Components pages describe the current protocol directly.Unified execution
One quote function and one swap function cover every exact-in and exact-out
route.
Delegated workflows
Standing allowances and EIP-712 permits support operators, relayers, and
institutional execution.
Atomic batches
One signed transaction can execute multiple independently specified legs.
Integrated liquidity
LPs can opt into automatic prefunding and sweeping with a designated
liquidity stablecoin.
At a glance
Unified pricing and execution
V1 exposed separate functions for each route direction and amount mode. Quote functions mirrored the execution functions, so integrations selected both a route-specific calculation method and its matching swap method. V2 represents every route with the sameSwapInputs structure:
Even route IDs are exact-in and odd route IDs are exact-out. The unified pricing
engine applies the same decimal normalization, NAV conversion, fee accounting,
and conservative rounding rules across route families.
User, operator, and receiver separation
V1 usedmsg.sender as the economic user and output recipient. V2 names each
role independently:
userowns the input assets, protocol permissions, and yield credits.operatorismsg.sender, the account that submits the transaction.receiverreceives the requested output assets.
Fee model
V1 charged the user a global protocol fee tier based on the size of an individual transaction. V2 separates protocol economics from LP pricing:SwapResolved and the unified Swap event expose the amounts as
issuerFeeAmt, spreadFeeAmt, and lpFeeAmt.
Worked RWA-to-stablecoin example
Assume:- Gross RWA value:
$1,000(500tokens at$2.00) - LP discount:
10% - RWA redemption fee used to measure the LP spread:
20% - Protocol share of that spread:
5% - LP-funded protocol fee:
10 bps
5% × 0.35 = 1.75%. Applied to the gross value,
that is $17.50.
The LP-funded fee is reported separately and does not reduce the user’s
$882.50 output. For a balance-sheet delegate, the LP domain settles the
user output and both protocol fee amounts. Mint-and-burn delegates mint the same
resolved amounts to their respective recipients.
Durable swap allowances
V2 adds protocol-level standing permissions:- Authorization is scoped to one user, operator, and input asset.
- The allowance is spent by the resolved input amount, including on exact-out routes.
type(uint256).maxacts as an infinite allowance.- A standing allowance can be used only when
receiver == user. - ERC-20 approval to the relevant stablecoin delegate is still required for token movement.
One-shot EIP-712 permits
V2 also supports “sign once, execute once” authorization with independent user, operator, and receiver addresses. The user owns the inputs and signs the permit, the operator submits the transaction, and the receiver receives the output. All three roles can use different addresses. The signedSwapInputs[] can contain one requested leg or an ordered multi-leg
batch. Batch execution is supported, but identity separation is the permit’s
primary purpose. The permit binds:
- The user, operator, and receiver
- The full ordered
SwapInputs[]array - Every route ID, asset ID, delegate ID, amount, and execution bound
- The user’s current nonce
- The signature deadline
- The chain ID and
MultiliquidSwapverifying contract
MultiliquidSwap and its version is 2.
Signatures support standard ECDSA, compact EIP-2098, ERC-1271 contract accounts,
and EIP-7702 delegated EOAs.
A successful swap consumes one nonce for the complete signed execution. If any part of
settlement reverts, the nonce change reverts with it. This authorization mode
supports gas-sponsored flows, delayed execution, market-maker fills, and
institutional signing policies without creating a durable protocol allowance.
Ordered multi-leg swaps
V2 accepts an ordered array of requested legs in oneswap call. Every leg can
use a different route, asset pair, LP delegate, and exact-in or exact-out
mode.
The complete batch is atomic and is limited by the protocol’s configured maximum
leg count. Legs do not implicitly feed their outputs into the next leg.
Applications that want chained execution calculate the intermediate bounded
amounts offchain and submit those legs explicitly.
This structure supports portfolio rebalancing, multi-order execution, batch
optimization, and signed workflows that must either settle completely or not at
all.
Automatic liquidity prefund and sweep
V2 lets a stablecoin LP configure anautoLiquidityStablecoinID, typically
selecting a yield-bearing stablecoin held by its custody account.
Prefund
Prefunded routes8–11 express that the requested stablecoin-output leg can
derive an internal stablecoin-to-stablecoin exact-out leg immediately before
execution. The derived leg:
- Calculates the stablecoin amount needed for the requested swap.
- Uses the LP custody account as the LP user and receiver.
- Converts the configured auto-liquidity stablecoin into the required output stablecoin.
- Spends the LP’s standing swap allowance to
MultiliquidSwap. - Settles atomically with the user’s requested leg.
Sweep
After eligible stablecoin-input routes, the contract can measure stablecoin inventory received by the LP custody account and convert that balance into the configured auto-liquidity stablecoin. A sufficient standing allowance from the custody account opts into the sweep; without one, the requested user leg can still proceed without the derived sweep. Together, prefund and sweep let an LP hold working liquidity in a designated yield-bearing asset while making other accepted stablecoins available at execution time.Integration migration checklist
- Replace route-specific quote calls with
quoteSwap(user, inputs). - Replace route-specific execution calls with
swap(user, receiver, inputs[], permit). - Map each direction and exact-in or exact-out mode to route IDs
0–11. - Build exact-in bounds as an exact
assetInAmtand minimumassetOutAmt; build exact-out bounds as a maximumassetInAmtand exactassetOutAmt. - Handle
issuerFeeAmt,spreadFeeAmt, andlpFeeAmtin quotes and events. - Choose direct execution, a standing input allowance, or an EIP-712 one-shot permit.
- Treat multi-leg inputs as an ordered atomic batch without implicit chaining.
- Continue managing ERC-20 approvals separately from protocol operator authorization.
- Index the unified
Swapevent for both requested and internally derived liquidity legs.
Next: Integration Guide
Build quotes, approvals, permits, and swaps with the Multiliquid EVM SDK.