Introducing Knot: a reserve-aware price boundary for Uniswap v4→

Uniswap v4 hook

UHI10HK-UHI10-1087live on unichain sepolia

One pair.Several pools.One price boundary.

KNOT gives every participating pool a second price boundary: its own curve and a virtual curve built from the federation’s aggregate reserves. A trade may never take the better of both quotes.

What does the hook actually do?

Every swap is quoted twice. The taker gets the worse one.

exact input · minexact output · max

Shallow pool

bound binds
local quote
18.993189
aggregate quote
6.315922
enforced
6.315922
withheld → LPs
12.677266

Deep pool

bound inert
local quote
4.960273
aggregate quote
6.315922
enforced
4.960273
withheld → LPs
0

Same trade size and manifest seed, reproduced by the contract tests. In this skewed fixture the aggregate quote binds; in the proportional control the local quote remains untouched.

Live on Unichain Sepolia · chain 13016,674 bps boundary in the documented 4×-skew fixtureConstructed cross-pool round trip: +13.5843 without the bound, -0.0298 with it204 passing Foundry cases · 99.32% source line coverage5 stateful invariants · 163,840 high-depth callsOn-chain preview reproduces the documented fixture to the weiNo oracle · no keeper · no off-chain component

boundary in 4× fixture

0bps

coalition weakening

0bps

passing Foundry cases

0

source line coverage

0.00%

How it works

Arithmetic, not a prediction.

No model to be wrong, no oracle to read, no classifier deciding who looks like an attacker. Both reserve states are read before the trade settles, and the taker is held to whichever is less favourable.

exact inputoutput = min(local, aggregate)
exact outputinput = max(local, aggregate)
TWO QUOTES

The problem

Why one pair can quote two realities

01

Pools price in isolation

The same token pair can sit behind different depths and reserve ratios.

02

One quote can be generous

A local curve may offer the taker more than the combined reserve curve would.

03

KNOT sets a ceiling

The hook compares both references and enforces the less favourable quote.

Contracts

view all →

Stack

ProtocolUniswap v4
BaseBaseCustomCurve
AccountingERC-6909
Solidity0.8.26
ChainUnichain Sepolia
Clientwagmi · viem
DocsMintlify
Oraclenone

Try it

Connect a wallet and watch the bound bind.

Quotes are read from preview() on the deployed federation, the same call a swap executes against.

unaudited · testnet only