Patterns & decision tree

A Strategy is the ABI-encoded form of a SwapVM Order. The Order wraps a Program (an ordered sequence of instructions) that SwapVM, the Aqua swap engine, executes on every quote() and swap() call. Aqua does not interpret the Strategy body; it treats it as opaque bytes and only manages balance accounting. All pricing and execution logic lives inside the Program.

See Program Model for how programs are structured, and Modifiers for cross-cutting extensions.

Two routers. The stateful AMM archetypes (constant product, concentrated, pegged, decay) and the advanced access and branching patterns run on the Aqua swap router, AquaSwapVMRouter, whose deployed opcode set is Controls, XYCSwap, XYCConcentrate, Decay, Fee, PeggedSwap, Extruction. The fixed-rate archetypes (limit order, RFQ, TWAP/DCA, Dutch auction) belong to the 1inch Limit Order and Fusion product, which shares the SwapVM engine but runs on a separate limit-order router with its own opcode sets (Invalidators, SeriesEpochManager). Each section below notes which router applies.


Decision tree

Is liquidity stateless (fixed rate, one direction)?
  └─ Yes → Fixed-rate strategies            [Limit Order / Fusion router]
       ├─ One-shot execution needed?        → Limit Order (bitmap invalidator)
       ├─ Partially fillable?               → Limit Order (token-out invalidator)
       ├─ Off-chain quoted price?           → RFQ
       ├─ Price decays over time?           → Dutch Auction
       └─ Drip over a fixed schedule?       → TWAP / DCA

Is liquidity stateful (bidirectional AMM)?
  └─ Yes → AMM strategies                   [Aqua router]
       ├─ Volatile pair (x*y=k)?            → Constant Product
       ├─ Concentrated into a range?        → Concentrated Liquidity
       ├─ Pegged / stable pair?             → Pegged Swap
       └─ MEV protection needed?            → Decay AMM

Need runtime branching or access control?
  └─ Yes → Advanced strategies              [Aqua router]
       ├─ Gate by holder status?            → Conditional Access
       └─ Pick best of N sub-strategies?    → Best Route Selector

Fixed rate (Limit Order / Fusion router)

Single-direction swaps from a fixed set of embedded balances. These archetypes are part of the 1inch Limit Order and Fusion product, a separate backend that shares the SwapVM engine but runs on its own limit-order router. Fusion adds only a Dutch-auction price modifier. RFQ and resolver-inventory fills route through the Aggregation Router and Limit Order Protocol, not Aqua pools. Order-level partial fills belong to this product, not to Aqua strategies.

Strategy Formula Invalidation Use case
Limit Order _limitSwap1D Bit or token-out Fill once or partially fill to exhaustion
RFQ _limitSwap1D Bit Off-chain quoted price, single fill
Dutch Auction _limitSwap1D + balance decay Token-out Price improves over time until filled
TWAP / DCA _twap Built-in Drip liquidity over a schedule

AMM (Aqua router)

Stateful bidirectional pools; balances persist across swaps in SwapVM storage.

Strategy Formula Key feature
Constant Product _xycSwapXD Classic x × y = k
Concentrated Liquidity _xycConcentrateGrowLiquidity2D + _xycSwapXD Capital-efficient price range
Pegged Swap _peggedSwapGrowPriceRange2D Low-slippage stable pairs
Decay AMM _decayXD + _xycSwapXD Virtual-balance spread, MEV-resistant

v1.0 ships two-token strategies only, and one router serves all three AMM types; the strategy type is set by the Program bytes, not by a separate app address. Concentrated liquidity is efficient, not leveraged: any effective-depth multiplier is a theoretical ceiling capped by the maker's real wallet balance, and tokens are never borrowed.


Advanced (Aqua router)

Runtime branching, external delegation, and access gating.

Strategy Key instruction Use case
Conditional Access _onlyTxOriginTokenBalanceNonZero Restrict fills to token/NFT holders
Best Route Selector _extruction Pick best of N sub-strategies at execution time

Conditional Access is enforced by the Controls opcode set. The deployed launch gate is _onlyTxOriginTokenBalanceNonZero(token), which reverts unless balanceOf(tx.origin) > 0; because it checks tx.origin, smart accounts, multisigs, and 4337 bundlers cannot pass it. Per-strategy taker allow-lists exist in source but are not registered on-chain today. Best Route Selector uses the Extruction opcode (IExtruction): the external pricing target must be non-upgradeable, and quote() and swap() must return identical amounts.


  • Program Model — registers, bytecode format, ordering rules, invariants

  • Modifiers — fees, MEV protection, rate guards, access control

  • Instruction set overview — full instruction reference

Did you find what you need?