Skip to content

feat: add Buffet PropAMM UniswapV4 hook - #1197

Open
dascapytal1559 wants to merge 2 commits into
VeloraDEX:masterfrom
dascapytal1559:feat/buffet-propamm
Open

feat: add Buffet PropAMM UniswapV4 hook#1197
dascapytal1559 wants to merge 2 commits into
VeloraDEX:masterfrom
dascapytal1559:feat/buffet-propamm

Conversation

@dascapytal1559

@dascapytal1559 dascapytal1559 commented Jun 19, 2026

Copy link
Copy Markdown

Summary

  • add Base Buffet PropAMM support as a UniswapV4 hook
  • add hook-aware pricing/top-pool handling for the configured ETH/USDC PropAMM pool
  • preserve hook addresses in multi-hop UniswapV4 calldata
  • tighten hook pool registration so unsupported same-hook pools fall back safely

Verification

  • PATH=/tmp/codex-node22/bin:$PATH ./node_modules/.bin/jest src/dex/uniswap-v4/encoder.test.ts src/dex/uniswap-v4/hooks/buffet/buffet-hook.test.ts --runInBand
  • PATH=/tmp/codex-node22/bin:$PATH ./node_modules/.bin/tsc --noEmit
  • PATH=/tmp/codex-node22/bin:$PATH ./node_modules/.bin/eslint "src/**/.ts" --ignore-pattern=".test.ts"
  • PATH=/tmp/codex-node22/bin:$PATH ./node_modules/.bin/prettier --check
  • git diff --check
  • Base smoke test against https://mainnet.base.org: PropAMM pool discovered and ETH/USDC quote directions returned non-zero prices with hook address preserved

Note: local Husky pre-commit could not run because git-secrets is not installed in this environment, so equivalent checks were run manually.


Note

Medium Risk
Changes swap quoting, routing liquidity, and on-chain calldata for hook pools on Base; incorrect hook math or registration could misprice or break multi-hop Buffet routes.

Overview
Adds Buffet PropAMM on Base as a Uniswap V4 hook for the configured native ETH/USDC pool, with off-chain quoting from the price engine and hook balances instead of standard tick math.

UniswapV4 now uses optional getPricesVolume / getTopPoolsForToken on hooks when present, rejects BUY quotes when the largest amount tier is zero, and merges hook-reported liquidity with subgraph results (deduped, hook-only fallback if subgraph fails). Hook registration returns a boolean so only the exact Buffet pool key is tied to BuffetHook; other pools sharing the hook address are ignored. Multi-hop swap encoding writes each hop’s hooks from the path key (previously forced to zero), which hook swaps require.

Reviewed by Cursor Bugbot for commit 9d5d85d. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e547e27. Configure here.

Comment thread src/dex/uniswap-v4/uniswap-v4.ts
Comment thread src/dex/uniswap-v4/uniswap-v4.ts
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.

2 participants