Mechanism

_exposureGate1D runs after the swap-pricing instruction. At or below maxExposureBps it does nothing. Between max and halt it scales the fill down linearly. At haltExposureBps or above it reverts. There is no branch where it can make the fill bigger.

Simulation · same math as ExposureGate.sol (lib/xyc.ts)

Move the reading. Watch the gate.

1inch SwapVMUniswap v4AQUA STRATEGY · MAKER LIQUIDITY →_exposureGate1Donly ever lowersDOWNSTREAM FILL 50%
SAFEDERATED0%50%100%0%25%50%75%100%exposure →
selected · exposure 70.0% → fill 50.0%
Reference swaptokenIn
Ungated curve
…
Gated fill
…

Loading Strategy A's live Aqua reserves… Gated is never above ungated, whatever the reading.

Gate band

◐ Derated — smaller fill

v4 dynamic fee

7888 pips · 0.789%

Illustrative profile. The live maker uses 50/90. Click the curve to set a reading.

The pipeline

The risk calculation stays off the swap path, and only its result lands on-chain. The gate trusts the oracle only to make fills smaller.
  1. 1

    on-chain

    Aqua

    The maker commits balances to every strategy via ship / pull.

  2. 2

    subgraph

    The Graph

    ExposurePosition joins commitments, oracle readings and v4 swaps.

  3. 3

    off-chain

    Keeper

    keeper/pushExposure.ts sums the maker's commitments and pushes one reading.

  4. 4

    on-chain

    ExposureOracle

    Only the keeper can write. Stale readings revert. The maker can pause.

  5. 5

    SwapVM opcode

    _exposureGate1D

    Derates or halts the fill. Never improves it.

→ 1inch SwapVM

Direct swap, no pool. The maker's program runs with the gate inside it.

→ Uniswap v4 · AquaV4Hook

The pool holds no liquidity of its own. Every fill is sourced live from the same strategy.

Strategy P · a sophisticated position

One live program stacks three SwapVM instructions. The order matters: the derate applies on top of the price adjustment, so a favorable price reading can never get past a halt.
Instruction 1=

_xycSwapXD

prices the swap

constant product from live Aqua reserves

Instruction 2↑

_oraclePriceAdjuster1D

can only improve

toward Chainlink ETH/USD, capped at +3%

Instruction 3↓

_exposureGate1D

can only worsen

toward the maker's real risk, down to a halt

curve price+3% caphalt

Schematic, not to scale. Proof: test/SophisticatedPosition.t.sol · live strategy hash 0xe3f9…cd88

Why it isn't just a v4 hook

A normal hook bakes its logic into one pool. Here the risk limit lives at the Aqua strategy layer, so the same policy gates any venue that reaches that liquidity.

Aqueduct

risk policyAqua strategy / SwapVMSwapVMUniswap v4future venue

A normal hook

Uniswap poolhard-coded hook logicdies with this one pool