redline $REDLINE
Pre-launch · not deployed
Mechanic

The ratchet

Four questions decide everything about this pool: what counts as a lap, which fee your swap pays, what happens when one swap is big enough to cross several milestones at once, and why the tier can never move back up. Answers below, each traceable to a line of the contract.

Channel
01

What counts as a lap

One number drives the whole thing: the cumulative ETH that has moved through the pool. Every swap has two sides — ETH and $REDLINE — and the pool adds the size of the ETH side to a running total.

A lap is complete when that running total crosses the next milestone. The four milestones are fixed when the pool's hook is deployed and are constructor arguments to an immutable contract: they cannot be edited, re-tuned, or reordered afterwards, and the contract refuses to deploy at all unless they are strictly increasing.

What counts

  • Buys and sells both count. The pool takes the size of the ETH side, not its direction. A sell moves the ratchet exactly as a buy of the same size does.
  • Exact-input and exact-output both count, and both are measured the same way — from what actually settled, not from what was requested.
  • The measurement happens after the swap has settled, so it is the real ETH that changed hands. A price move part-way through a swap cannot inflate or shrink it.

What does not count

  • Adding or removing liquidity. Only swaps move the counter.
  • Ordinary $REDLINE transfers between wallets — those never touch the pool.
  • Swaps in any other pool. The hook only recognises one exact pool key: native ETH paired with $REDLINE, dynamic-fee, tick spacing 200. Anything else it leaves untouched.
src/RedlineHook.sol — _afterSwap reads the settled ETH-leg delta; _ours() pins the pool key.
Channel
02

Which fee your swap pays

The tier that is live when your swap begins is the tier your swap pays. The volume your swap creates is then added to the total, and if that pushes the total past a milestone, the step happens after you — the next swap gets the cheaper tier.

This ordering is deliberate and it is the honest one. You always know the price of your own trade before you make it; you can never be surprised mid-swap by a tier change, in either direction. And the person who completes a lap is not the person who benefits from it, which is exactly what makes the mechanic a shared cost rather than a private trick.

SWAP BEGINS fee = current tier locked for this swap SWAP SETTLES ETH leg added to total measured, not estimated MILESTONE CROSSED? tier latches one step down applies from the NEXT swap ONE SWAP, IN ORDER THE STEP NEVER HAPPENS INSIDE YOUR OWN SWAP
Order of operations for a single swap. Diagram, not data.
Channel
03

One very large swap

A swap can be big enough to vault more than one milestone at once. When that happens the tier does not creep forward one notch and lose the rest — it advances all the way to the tier the new total actually deserves, in that same transaction. A trade large enough to clear all four milestones lands the pool on the floor immediately.

That swap still pays the tier it started at. It is, in the most literal sense, someone buying the cheaper fee for everybody who comes after them.

LAP 0LAP 1LAP 2 LAP 3LAP 4 5.0%3.0%2.0% 1.0%0.5% ONE SWAP LARGE ENOUGH TO CROSS THREE MILESTONES CHARGED AT 5.0% — THE TIER IT STARTED AT. THE POOL IS NOW AT 1.0%.
Illustrative sizing. The distance between milestones is not to scale.
Channel
04

Why it cannot go back up

The tier is one small counter. The only line of code that writes to it assigns a value that has already been proven greater than the one it replaces, and the fee itself is a lookup into a table of five constants compiled into the contract. Put together, that leaves nowhere for a reversal to come from:

  • No owner control. The hook has no owner. Its single privileged function names the one contract allowed to create the pool, can be called exactly once by the deploying address, and is dead thereafter. Nobody can set the tier, and nobody can set the fee.
  • No setter on the ladder. The five percentages are compile-time constants. Changing them would mean deploying a different contract to a different address, with a different pool.
  • No decrement path. The counter is only ever assigned a strictly larger value. There is no branch that lowers it.
  • No timer. Nothing decays, expires, or resets. A pool that goes quiet for a year is still at the tier it reached.
  • Bounded. The advance is capped at four steps, so it always terminates and always lands on a real tier.
The pool is fixed to one key. The hook only accepts the canonical pool: native ETH as one side, $REDLINE as the other, the dynamic-fee flag set, tick spacing 200. It also permits exactly one contract to create that pool, once, in the same transaction that seeds its first liquidity — so the pool cannot be brought into existence at a price nobody chose, or with its ratchet already spent.
Channel
05

The obvious question

Can somebody just trade against themselves to force the fee down? Yes — and it costs them the current tier every time they do it. Pushing a lap through at 5% means paying 5% of everything they push, to the liquidity providers, on the way. There is no free way to move the counter, because the counter measures the exact quantity the fee is charged on.

So self-trading the ratchet forward is possible, it is expensive, and it is a gift to the pool. That is the intended shape: the only lever anyone has is to pay the fee, and paying the fee is what makes it cheaper for everyone else.

The reverse — stalling the ratchet, or nudging it backwards — is not available to anyone at any price.