Concepts

Invariants and trust

What always holds, and how it's proven.

What always holds, and how it is proven.

#InvariantProven by
I1A swap never reverts because of a precompile readunit + invariant (failure injection)
I2fee ∈ [minFee, maxFee], or fee == fallbackFee with reason ≠ OKfuzz + invariant
I3The override flag is set on every beforeSwap returnintegration
I4The hook never holds tokens and returns ZERO_DELTAinvariant (balances 0)
I5No state-changing external function except beforeInitialize / beforeSwapcode review + slither
I6previewFee(key, d).fee == fee charged for the same pre-stateintegration
I7Solidity compute == TypeScript compute on every vectordifferential (10k vectors)
I8FeeComputed inputs are enough to recompute the fee exactlylive verifier
I9Anchor and top-of-block only change under their rulesunit + invariant
I10A pool with other currencies or a static fee can't initialize with the hookunit

Trust#

  • No owner, setters, proxy, receive or token handling in the hook.
  • Our PoolManager has owner address(0): nobody can ever turn on a protocol fee.
  • Prices come from HyperCore consensus. Aven trusts Hyperliquid's oracle and mark, nothing else.

Limits

LPs still carry directional risk; Aven doesn't hedge. Splitting an arb across blocks lowers its fee somewhat. Parameters are calibrated, not optimised.
Aven · MIT · ETHGlobal MumbaiEdit on GitHub ↗