Revert Finance - StableSwap Hooks

Revert Finance - StableSwap Hooks

@revert-finance
Live

Total reward

$50,000

No deposit required

Status

Live

Findings submitted

38

Start date

30 Apr 2026

End date

7 May 2026

StableSwap Hooks is a Uniswap v4 hook implementation that brings Curve-style StableSwap AMM behavior to v4 pools. It targets stable assets (stablecoins, LSTs, etc.) to provide low-slippage swaps around the 1:1 price, while supporting configurable fees, rate oracles, and amplification (A) ramping.

The StableSwap invariant blends constant-sum and constant-product behavior with an amplification coefficient (A): near balance it behaves closer to constant-sum for tighter pricing, and as the pool becomes imbalanced it shifts toward constant-product to preserve liquidity. The benefit is concentrated liquidity around the peg without relying on external oracles for pricing, which improves capital efficiency for LPs and reduces price impact for traders.

The hook does not rely on Uniswap's position manager or concentrated liquidity NFTs; it manages liquidity internally with Uniswap v2-style ERC20 LP tokens. Deposits and withdrawals are proportional across all pool assets; there is no range-based liquidity and no NFT positions.

A factory deploys StableSwap hooks via CREATE2 with off-chain salt mining, validates the hook bytecode against a known hash, and configures protocol and hook fee collectors for all pools created through it. Pools support configurable LP, hook, and protocol fees; per-asset rate oracles for non-1:1 pegs (e.g. wstETH/WETH); and amplification (A) ramping over time to smooth pricing transitions.

A periphery contract (StableSwapZapIn) enables single-token (zap-in) deposits by internally swapping the input across pool currencies before adding proportional liquidity, accounting for swap fees during the calculation.

Prize Distribution and Scoring

  • Total Prize Pool: $50,000
  • Only High and Medium severity findings will be rewarded in this competition.
  • Scoring described in the competition scoring page.
  • Findings Severities described in detail on our docs page.

Documentation

Scope

  • Repository: revert-finance/stableswap-hooks
  • Branch: main
  • Commit: cf0c30e576f144809df9819f4d3ad49e0b7fe2d7
  • In scope: All Solidity (.sol) files under the src/ directory. Files outside src/ (including test/, script/, and lib/) are out of scope.
  • Total nSLOC: ~1,348 across 12 .sol files

The 12 in-scope files are:

FilenSLOC
src/periphery/StableSwapZapIn.sol462
src/Liquidity.sol175
src/libraries/StableSwapMath.sol140
src/Base.sol126
src/Swap.sol124
src/Fees.sol93
src/factories/StableSwapHooksFactory.sol79
src/Amp.sol75
src/StableSwapHooks.sol37
src/interfaces/IStableSwapHooks.sol20
src/interfaces/IStableSwapHooksFactory.sol10
src/libraries/Actions.sol7

Build Instructions

Foundry. See the README.

forge buildforge test

Mandatory POC Rule

  • The mandatory POC rule applies to this competition.
    • All High/Medium findings require a valid coded POC before the end of the competition.

Out of Scope

  • Any files outside the src/ directory (test/, script/, lib/)
  • Centralization risks
  • MEV, gas griefing, frontrunning
  • Frontend or off-chain components
  • Off-chain salt mining demo (script/hookMiner.demo.js)
  • Third-party fixtures under test/testUtils/external/
  • Issues in the underlying Uniswap v4 PoolManager or Universal Router

Contact Us

For any issues or concerns regarding this competition, please reach out to the Cantina core team through the Cantina Discord.