NexusHook · Uniswap v4 on X Layer

Fees decided by circuits, not by an admin.

FeeRouteHook is a generic Uniswap v4 hook. Two taped-out circuits pick each swap's LP fee tier from volatility and depth (measured against the pool's own baseline), and two more pick where a 5 bps route fee goes. Every circuit's full output was computed once at deploy, so a TapeOut upgrade cannot change the fee or its destination. There is no owner and no setter.

Hook (v2, live)0xfd77af872A8f590680Fd27D79319e2e4E08E80c4
LP fee tiers0.05% / 0.30% / 0.60% / 1.00%, chosen per swap by VOL_GUARD and DEPTH_GUARD
Route fee5 bps; all four routes go to the pool's in-range LPs
Hook fee recipient0x934d315C0a9C0866D393B722C1805F2B6b20b816 (Nandout deploy wallet)
Hook fee

1000 pips (0.10%), Uniswap v4's protocol-fee cap, taken with the mechanics of v4-core's FeeTakingHook: on the swap's unspecified side and on the amount that actually filled (the output of an exact-input swap, the input of an exact-output swap), paid to the Nandout deploy wallet. This is a different denomination from v4's own protocol fee, which is always taken from the input. Everything else goes to the pool's own in-range LPs.

Worked example, a 1,000-token exact-input swap in the 0.30% tier: 3.000 LP fee to in-range LPs, 0.996 hook fee to the Nandout deploy wallet, 0.498 route fee to in-range LPs (both in the output token); the trader receives 994.51.

Our own demo poolliquidity supplied by us · no swaps by us
This is Nandout's own demo pool, not organic activity. We supplied the liquidity and we have made no swaps in it: the hackathon rules void self-trading. Tier evidence is read-only (below), a fork of mainnet at this pool's state, and the fork test suite. Any swap listed below was made by someone else.
Pairnative OKB / XCAT XCAT (a graduated Ignix launch)
Pool ID0x806bfd9c404564f6f26de8355dc9a54dfab0064af57841d872124a8185a32671
Liquidity0.0614 OKB + 1,649,399.07 XCAT at creation, full range; position NFT #12817 owned by the Nandout deploy wallet
The XCATbought once on the open market for this demo and our test lock (0x0c9162c7…bb0a); not traded again
Planwithdraw the liquidity after judging (Oct 6, 04:00 UTC)
Live read-only tier (block 75356843)facts 0 → tier 0 → LP fee 0.05%
Position liquidity now318256150290818546924

Fork of mainnet at the live pool's state (swaps on the fork only, then discarded): calm 0.05% → volatile 0.60% → volatile and thin 1.00%. Reproduce: XCAT_EVIDENCE=true forge test --mc XcatPoolEvidenceForkTest in hook/.

Swaps in the demo pooleverything the PoolManager has recorded since block 71,815,113
BlockTxSwapper (router)LP fee applied
718571650x515a4f49…62590xacb0f4…0.05%
720224860xc21010df…e8a40xacb0f4…0.05%
720659450xf3c214e5…a3360xacb0f4…0.05%
724179360x53577a4e…e0840xfc84ad…0.05%
724530400x144ca39d…06d30xacb0f4…0.05%
724531210xf3969d45…1b1b0xacb0f4…0.05%
724531380xf92cef09…16170xacb0f4…0.05%
724531470xff77c84f…0d5c0xc1e5ac…0.05%
724531480xfb01816a…515f0xacb0f4…0.05%
724532830x7392afcf…ec900xc1e5ac…0.60%
724532840xa88b49f2…b0370xacb0f4…0.60%
724537060x9f0fdce8…39200xacb0f4…0.05%
724548210x867422a3…82420xacb0f4…0.05%
725301990xadc924bf…f51e0xacb0f4…0.05%
725357420xcb0ccaa5…b8f70xacb0f4…0.05%
730485290x5cf79f91…a8dd0xacb0f4…0.05%
730487440x52540fb0…80a40xacb0f4…0.05%
738111380xced7082b…4eb10xacb0f4…0.05%
738111390xdcbf5db8…52170x54c0bd…0.05%
742614170xc688ee54…37f20xacb0f4…0.05%
742628010x1a78113f…80e40xacb0f4…0.05%
Our own test lock

LatchLock lock #1: 1,666,059.66 XCAT requested, 1,657,729.37 XCAT actually locked (after LatchLock's 0.5% fee), one tranche, 100% on UNLOCK_T1, beneficiary the Nandout deploy wallet. LATCH_LOCKED stays off for XCAT, because we are not its creator: this tests the lock path, it is not a creator lock. Lock page

Deprecated: v1

FeeRouteHook v1 0x9553B82Baf7EB83e155b33F003d89Aa1D1b040cc is deprecated. It charged the exact-input hook fee in beforeSwap on the amount the trader specified, not the amount that filled, so a partially filled swap (price-limited, or running out of in-range liquidity) paid the fee on input that never swapped, and very large specified amounts reverted. It stays on-chain because it is immutable (no owner, no upgrade path). No pool ever used it. v2 takes the fee in afterSwap on the actual fill; regression test test_partialFillPaysHookFeeOnlyOnFilledAmount.