Uniswap v4 Hook · ETH / ROCK

Bedrock

Every trade lays bedrock.
The market is not only price and volume.

fig.0 — the liquidity well

01 — The Idea

A market is
made of bedrock

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

↑ price rises

Buy

A buy pushes the price up and lays bedrock below the price — single-sided, in the currency that was paid in.

↓ price falls

Sell

A sell pushes the price down and lays bedrock 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 layers above.
Buy layers 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 layer 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 bedrock
is laid

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 layer 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. Layers at the same band compound; only the swap fees they earn can be swept. The liquidity is there for good.

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

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

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

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

04 — The Loop

Trade → Layer → Structure

Trade
Layer
Structure

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