Documentation

How the fee is computed, who pays it, where it goes, and what is bounded. Written before anything is deployed, so it can be checked against the code later.

The fee that prices the gap between books.

A Uniswap v4 hook for tokenized equities on Base.

Version 0.1 · Status: pre-launch, nothing deployed

01The problem

One share of Apple has one price. A tokenized share of Apple has as many prices as there are venues quoting it.

That is not a flaw anyone introduced on purpose. It is what happens when the same asset trades in more than one book: each book has its own liquidity, its own flow, its own last trade. They drift apart between arbitrages, by a few basis points, all day long.

BOOK A BOOK B 232.41 232.19 9.5 bps the same share, quoted in two places the gap is a profit, and someone collects it
Two books quoting the same share. The bracket is the deviation, and it is a profit.

Someone always collects that drift. Today it is whoever arbitrages it, and the liquidity providers who were holding the stale quote pay for it without being asked.

RIFT does not try to stop the drift. Drift is how two markets stay connected. It prices it, and sends the price to the people who were carrying the risk.

02What just changed on Base

Base shipped B20 on 8 July 2026: a native token standard implemented as Rust precompiles, ERC-20 and ERC-2612 compatible, with transfer policies, roles, memos and supply caps built in.

Tokenized equities followed. As of this writing the following are live as B20 Assets on Base, 8 decimals, multiplier at 1.0:

AAPLc   Apple Inc.        0xb200000000000000000000c2e324d24d7eecd1fb
GOOGLc  Alphabet Inc.     0xb2000000000000000000002d0ba3164cc74f58b7
METAc   Meta Platforms    0xb2000000000000000000008bc8786b856e61707c

Read them yourself. name(), symbol(), contractURI() all answer.

Be clear about the state of it. At the time of writing these tokens trade in no pool at all. Not on Aerodrome, not on Aerodrome's concentrated factory at any tick spacing, not anywhere we could find. Supplies are small: 334, 295 and 172 shares respectively.

So RIFT is not arriving to arbitrage an existing fragmentation. It is arriving before there is one. That is the honest version, and it is the reason to build now rather than later.

03The mechanism

A pool running the RIFT hook knows about other venues quoting the same asset. Before each swap it reads their prices, and computes the deviation between its own price and the reference.

deviation = |poolPrice - referencePrice| / referencePrice

The fee it charges is then

fee = baseFee                       when the trade widens the gap or leaves it alone
fee = baseFee + premium             when the trade closes the gap

minFee <= fee <= maxFee <= HARD_MAX_FEE
a trade that widens the gap gap → wider baseFee a trade that leaves it alone gap → unchanged baseFee a trade that closes the gap gap → zero baseFee + premium
Three trades, three outcomes. Only one of them is collecting the spread.

Why the closing trade pays

This is the part that reads backwards at first.

The trade that closes the gap is the profitable one. It is the arbitrage: someone buying the cheap book and selling the expensive one, capturing the deviation as profit. That trader is not doing the pool a favour, they are collecting a payment the pool's liquidity providers funded by quoting a stale price.

Charging them a premium hands part of that back to the LPs who carried it. Charging the ordinary buyer or seller instead would be charging the wrong person: they did not create the gap and they are not capturing it.

Where the premium goes

To the liquidity providers, through Uniswap's own fee accounting. All of it.

arbitrageur takes the spread premium the pool uniswap fee accounting 100% liquidity providers who held the stale quote no treasury, no protocol cut, no path out of the pool
The premium leaves the arbitrageur and stops at the pool. There is no next box.

RIFT takes nothing. There is no protocol fee in v1, no treasury address in the hook, and no code path that routes any part of the fee anywhere other than the pool.

04The venue registry

The hook needs to know which other books to compare against. That set lives in a registry, and it is immutable once set for a market.

This is deliberate and it is a real constraint. A mutable venue set would let whoever controls it point the reference at a book they also control, and manufacture a deviation on demand. Freezing it means the reference cannot be moved after people have committed liquidity against it.

The cost is that a market cannot adopt a venue that launches later. The answer to that is a new market, not a new registry.

05What is bounded

A hard maximum in the bytecode. A constant, not a storage variable, checked when a market is configured and clamped again on every fee computation. Both checks exist on purpose: the first is the promise, the second is what makes the promise hold if the first is ever removed.

HARD MAX a constant in the bytecode baseFee unreachable checked when a market is configured, and clamped again on every computation
The market's own maximum sits under a constant no configuration can raise.

The hook holds nothing. It moves no tokens, has no balance, and has no withdraw function. It answers callbacks and returns a number.

A disabled market still trades. Turning RIFT off on a pool returns a zero fee override rather than reverting, so the pool falls back to its own fee instead of becoming untradeable. Switching the hook off must never be able to take a market down.

No oracle, no keeper. The reference prices are read from the venues themselves, inside the swap. Nothing has to be posted, nobody has to be paid to keep it fresh, and there is no round to be late.

06What this is not

It is not a claim that the drift is large. On Robinhood's chain we measured 35 basis points across ten books of a single tokenized equity. That number is from there, not from Base, and it does not transfer. On Base the honest number today is unmeasurable, because there is one book at most.

It is not an oracle. RIFT reads venues to price a fee. It does not publish a price, and nothing should consume it as one.

It is not protection from being arbitraged. A pool running RIFT still gets arbitraged, and should. The difference is that the arbitrageur pays the LPs for the privilege instead of taking it for free.

It is not audited. Nothing here has been reviewed by anyone outside the people who wrote it.

07Status

Nothing is deployed. There is no hook address, no market, no token.

The mechanism has a working implementation from an earlier build on a different chain, tested against a fork with a full launch and removal rehearsal. Porting it to Base is recalibration rather than new work, but recalibration against venues that do not exist yet is guesswork, and this document would rather say so than pretend otherwise.

The first honest task is measurement: when a second book opens on one of these tickers, record the real deviation for long enough to know whether the premium is worth charging at all. If it turns out to be two basis points instead of thirty-five, the right answer is to not ship.