Uniswap v4 Hook · ETH / STRING

StringTheory

Every trade leaves a string.
The market is not only price and volume.

fig.0 — the liquidity well

01 — The Idea

A market is
made of strings

Each trade deposits part of its own input as permanent liquidity in the range it traded through — a string. Trade after trade, the strings pile up until they are the structure of the market.

↑ price rises

Buy

A buy pushes the price up and leaves a string below the price — single-sided, in the currency that was paid in.

↓ price falls

Sell

A sell pushes the price down and leaves a string above the price — a mirror trail on the opposite side.

∞ over time

Accumulation

Zones that trade a lot become dense liquidity. Zones nobody touches stay thin. The tape becomes terrain.


fig.1 — market structure
02 — The Structure

Sell strings above.
Buy strings below.

Read the book from the middle out. Everything the market bought sits as a lattice of liquidity beneath the current price; everything it sold hangs above. The current price is just the seam where the two halves meet.

Because each string is single-sided and never withdrawn, the structure only ever thickens. Support and resistance stop being lines someone drew — they become liquidity that is actually there.


03 — The Hook

How a string
is woven

It is a single Uniswap v4 beforeSwap hook. No new AMM, no token tax — just an interception on the way into every swap.

  1. Intercept the swap

    On every exact-input swap, the hook reads the current tick and takes a small, fixed share of the input — the string fee.

  2. Pick the side behind the trade

    A rising price gets a band just below it; a falling price gets a band just above. The band is chosen so the position is entirely one-sided — made of exactly the currency that was paid in.

  3. Mint it as permanent liquidity

    That share is added as concentrated liquidity owned by the hook. The take and the mint cancel out inside the swap, so no external capital is ever needed.

  4. Never pull it back

    The hook has no withdraw path for principal. Strings at the same band compound; only the swap fees they earn can be swept. The liquidity is there for good.

StringTheoryHook.sol · _beforeSwap
// take the string's worth of the input ...
uint256 string = amountIn * stringFeeBps / 1e4;

// ... on the side the trade came from
if (zeroForOne) {
  // price falls → string ABOVE, single-sided
  (lower, upper) = bandAbove(currentTick);
} else {
  // price rises → string BELOW, single-sided
  (lower, upper) = bandBelow(currentTick);
}

// mint it — permanent, owned by the hook
poolManager.modifyLiquidity(key, add(lower, upper, string));

// the take and the mint net to zero inside the swap
return toBeforeSwapDelta(int128(string), 0);

04 — The Loop

Trade → String → Structure

Trade
String
Structure

Venue Uniswap v4
Mechanism beforeSwap
+ return delta
Liquidity Permanent
single-sided
Tests 10 / 10
foundry, on a live pool