Aqua0
Product

How it works

A conceptual view of the two execution flows.

Mental model

Aqua0 routes traders through one of two execution venues, both backed by the same shared LP capital sitting in the on-chain SharedLiquidityPool (SLP) on each chain. The SLP itself is a custody vault: it holds tokens, verifies signatures, and emits events. All accounting (per-LP balances, strategy commitments, attribution) lives in the off-chain brain.

Aqua SwapVM, single-chain

sequenceDiagram
  participant LP as LP wallet
  participant Be as Backend (brain)
  participant Op as Operator
  participant SLP as SLP
  participant Aqua as 1inch Aqua
  participant Tr as Trader
  participant Rt as 1inch SwapVM Router

  LP->>SLP: deposit (event indexed; brain credits LP)
  LP-->>Be: signed Commitment (off-chain only)
  Be-->>Op: validates aggregates, orders ship
  Op->>SLP: shipStrategy(bytes, tokens, amounts)
  SLP->>Aqua: ship(swapVMRouter, bytes, tokens, amounts)
  Tr->>Rt: swap(order, tokenIn, tokenOut, amountIn, takerData)
  Rt->>Aqua: pull tokenOut from SLP, push tokenIn to SLP
  Rt-->>Be: emit Swapped
  Be->>Be: pro-rata deltas across swap_strategy_commitments
  1. An LP deposits into the SLP. The deposit event is indexed; the brain credits the LP in its DB.
  2. The LP signs an off-chain Commitment allocating part of their balance to a strategy. The commitment never goes on chain.
  3. Once aggregate commitments cover a target ship size, the operator EOA calls slp.shipStrategy(bytes, tokens, amounts). The SLP forwards into 1inch Aqua's 4D virtual ledger, with the SLP as the maker.
  4. A trader hits AquaSwapVMRouter.swap. The router pulls tokenOut from the SLP and pushes tokenIn to the SLP, atomically inside Aqua's virtual ledger.
  5. The router emits Swapped. The brain reads it and pro-rata-distributes the deltas across every LP committed to that strategy.

No on-chain attribution writeback happens. The SLP's role ends at the swap.

Uniswap V4 JIT, cross-chain

sequenceDiagram
  participant T as Trader
  participant Be as Backend (brain)
  participant PM as PoolManager (chain B)
  participant Hk as Aqua0Hook
  participant SLPB as SLP_B
  participant Wk as Repayment-worker
  participant SLPA as SLP_A (chain A)
  participant LZ as LayerZero OFT

  Be-->>T: signed JITPayload + ranges (hookData)
  T->>PM: swap(poolKey, params, hookData)
  PM->>Hk: beforeSwap
  Hk->>SLPB: verifyJIT(payload, ranges)
  Hk->>PM: modifyLiquidity (range injected)
  PM->>Hk: afterSwap
  Hk->>SLPB: recordSwapSettlement → emit SwapSettled
  Be-->>Wk: signed RepaymentWithdrawPayload
  Wk->>SLPA: withdrawForRepayment(payload)
  SLPA->>LZ: forwardOut to OFT adapter
  LZ-->>SLPB: bridged delivery → tokens in SLP balance
  1. The backend signs an EIP-712 JITPayload referencing chain-A LP capital that will back a chain-B swap.
  2. The trader submits a Uniswap V4 swap on chain B with the payload as hookData.
  3. Aqua0Hook.beforeSwap validates the signature against the SLP's backendSigner and injects a temporary range backed by SLP_B capital.
  4. The swap executes against the injected range.
  5. Aqua0Hook.afterSwap removes the range and emits SwapSettled.
  6. The brain's settlement poller picks up SwapSettled and queues a repayment obligation. The repayment-worker drains the source LP via slp.withdrawForRepayment against a backend-signed RepaymentWithdrawPayload, then dispatches a LayerZero V2 OFT message. Tokens land directly in the destination SLP's balance via OFT delivery; the brain credits the destination filler off-chain.

There is no Composer hop, no CCTP path, no on-chain attribution writeback for the bridge.

On this page