Skip to content

Add StableSwapHooks hook on base - #1629

Open
hooklist-generator[bot] wants to merge 1 commit into
mainfrom
hooks/base/0x37ca10c307fa8caa772f3583b3fd1e923dee2aa8
Open

Add StableSwapHooks hook on base#1629
hooklist-generator[bot] wants to merge 1 commit into
mainfrom
hooks/base/0x37ca10c307fa8caa772f3583b3fd1e923dee2aa8

Conversation

@hooklist-generator

Copy link
Copy Markdown
Contributor

Summary

A Uniswap v4 hook implementing a Curve-style StableSwap AMM with full custom accounting. Supports 2–4 currencies with optional rate oracles and dynamic amplification coefficient (ramp). Executes swaps entirely in beforeSwap via BeforeSwapDelta, collecting LP, hook, and protocol fees. Issues its own ERC20 LP token (SSLP).

Flags

Flag Value
beforeInitialize true
afterInitialize false
beforeAddLiquidity true
afterAddLiquidity false
beforeRemoveLiquidity true
afterRemoveLiquidity false
beforeSwap true
afterSwap false
beforeDonate true
afterDonate false
beforeSwapReturnsDelta true
afterSwapReturnsDelta false
afterAddLiquidityReturnsDelta false
afterRemoveLiquidityReturnsDelta false

Properties

Property Value
dynamicFee false
upgradeable false
requiresCustomSwapData false
vanillaSwap false
swapAccess none

Warnings

  • Submitter-proposed name "StableSwap Hooks (Revert)" rejected: "(Revert)" implies brand affiliation with "Revert Finance" not substantiated by the verified source. Using "StableSwapHooks".
  • Submitter-proposed description rejected: contains brand claim "Revert Finance" not verifiable from the source code. Using AI-generated description.

Closes #1625

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hooklist Ready Ready Preview Aug 31, 2026 2:50pm

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: hooks/base/0x37ca10c307fa8caa772f3583b3fd1e923dee2aa8.json

Address Flags

Address suffix 0x2aa8 = 0010 1010 1010 1000 (16-bit), lowest 14 bits:

Bit Flag Expected File
13 beforeInitialize true true ✓
12 afterInitialize false false ✓
11 beforeAddLiquidity true true ✓
10 afterAddLiquidity false false ✓
9 beforeRemoveLiquidity true true ✓
8 afterRemoveLiquidity false false ✓
7 beforeSwap true true ✓
6 afterSwap false false ✓
5 beforeDonate true true ✓
4 afterDonate false false ✓
3 beforeSwapReturnsDelta true true ✓
2 afterSwapReturnsDelta false false ✓
1 afterAddLiquidityReturnsDelta false false ✓
0 afterRemoveLiquidityReturnsDelta false false ✓

Also independently confirmed by getHookPermissions() in Base.sol.

Properties

  • dynamicFee: false ✓ — _beforeSwap returns 0 as the fee override (return (this.beforeSwap.selector, delta, 0)). LP fee is set as an immutable at construction. No updateDynamicLPFee() call anywhere.

  • upgradeable: false ✓ — No proxy pattern, no SELFDESTRUCT, no delegatecall to mutable addresses. factory and poolManager are immutable. The _getRate oracle calls use Address.functionStaticCall (read-only), which is a rate feed, not an upgrade mechanism.

  • requiresCustomSwapData: false ✓ — _beforeSwap accepts bytes calldata as its fourth parameter but does not reference it at all. Swaps work correctly with empty hookData.

  • vanillaSwap: false ✓ — beforeSwapReturnsDelta is true and the hook executes the entire StableSwap (Curve-style) AMM computation in _beforeSwap, returning a BeforeSwapDelta that fully replaces the standard v4 AMM swap. This definitively makes it non-vanilla.

  • swapAccess: "none" ✓ — _beforeSwap calls only _validatePoolId(_poolKey), which checks that the pool is one managed by this hook instance (not a per-user access control). Any caller can swap without restriction.

Metadata

  • verifiedSource: true ✓ — confirmed by source_meta.json ("verified": true).
  • chainId: 8453 ✓ — matches "base" in chains.json.
  • name: "StableSwapHooks" ✓ — matches contractName in source_meta.json.
  • description ✓ — All claims are substantiated by the source:
    • "Curve-style StableSwap AMM" — StableSwapMath uses the StableSwap invariant.
    • "full custom accounting" — swap is fully handled in beforeSwap via BeforeSwapDelta.
    • "Supports 2–4 currencies" — MIN_CURRENCIES = 2, MAX_CURRENCIES = 4 in Base.sol.
    • "optional rate oracles" — RateOracleConfig with address(0) for static rate in Base.sol.
    • "dynamic amplification coefficient (ramp)" — startAmpRamp/stopAmpRamp in Amp.sol.
    • "collecting LP, hook, and protocol fees" — fee logic in Fees.sol.
    • "Issues its own ERC20 LP token (SSLP)" — ERC20("StableSwap LP Token", "SSLP") constructor in Liquidity.sol.

No promotional, audit, safety, or endorsement language in the name or description. All metadata is accurate and substantiated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hook: StableSwap Hooks (Revert)

0 participants