myelin
Robinhood Chain
Launching · Uniswap v4 hook

Every swap fee, set by a neural network. On-chain.

A Uniswap v4 hook that prices each swap with a 289-parameter neural network running inside the transaction: higher when the pool is jumpy, lower when it is calm. The fee needs no oracle and no keeper, nothing has an admin key, and every fee can be recomputed to the last bit.

0/0replaying the latest swaps
0
From the code · counted and measured
289
parameters
a neural network that runs inside every swap
21,890
gas, one prediction
measured in the Foundry tests; the whole hook adds about 60,000 to a swap, and about 76,600 when it updates its memory
0
admin keys
no owner, no upgrade path: in the hook, the model, the Treasury, the oracle or the token
8
inputs
whole numbers built from the price moves the hook has recorded. No oracle
3,558
test vectors, bit for bit
model, policy and memory: the contracts, the Python reference and the browser code agree on every one
735,161
real swaps in the backtest
4 pools on Robinhood Chain mainnet, read from two providers and cross-checked
01 Who it is for

One hook. Three ways in.

Myelin is a normal Uniswap v4 pool with one difference: the fee is set by a model you can read, call and check. Pick where you start.

Traders

See the fee before you sign.

Swap through Uniswap’s own router with the wallet you already use. The quote includes the fee, and the fee always stays between 0.05% and 0.41%, set by a rule that is public and cannot be changed.

Make a swap
Liquidity providers

A fee that follows the risk.

The fee rises when the pool gets jumpy and falls when it is calm. Your position is a normal Uniswap v4 position that the hook can never hold or lock. Read the backtest before you rely on it: it does not show that liquidity providers earn more.

Provide liquidity
Builders

A model you can call.

Call the model for free, read every swap’s inputs and fee from one event, open a pool with the hook, or deploy your own with a different policy. MIT licensed, no key, no signup.

Build with it
02 How it works

Remember. Read. Decide.

Four beats inside every swap. The model only ever sees eight numbers built from the price moves the pool has already recorded: no oracle, no off-chain call.

Fig. 1 · The reflex arc
stimulusa swap moves the pricenetworkeight numbers in, one number outresponse—the fee, set before the swapafterSwap: the hook remembers a move that counts
  1. It remembers.

    After a swap that leaves the price 3 or more ticks from the last observation, in a later second, the hook folds the move into eight integers: the last move, three moving averages of movement, drift, a streak and two clocks. A swap of one wei, a flicker between two ticks or a burst inside one second changes nothing. That memory is one storage slot per pool, and it is all the model ever sees.

    afterSwap eight integers · written only by a real move · one storage slot

  2. It reads.

    Before the next swap, a 289-parameter network turns those eight numbers into one: how far the price is likely to move in the next minute. Whole-number arithmetic, inside the transaction, for about 22k gas.

    beforeSwap 8 → 16 → 8 → 1 · integer weights · a pure function

  3. It decides.

    A fixed policy maps that number to a fee between a floor and a cap. A calm pool pays little. A jumpy pool pays more, because that is when liquidity providers are most exposed to traders who know the price is about to move.

    policy fee = clamp(floor + slope × (output − threshold), floor, cap)

  4. It settles, and remembers again.

    The swap runs at that fee and a fixed share of it goes to the Treasury. Then, if the price really moved, the hook updates its memory, and it emits an event with everything it used, so anyone can recompute the decision. No keeper, no oracle, nobody in the middle.

    afterSwap Reflex event emitted · memory updated by a real move · share minted to the Treasury

03 Where the fee goes

A share that buys back and burns.

A fixed part of every fee goes to a Treasury that no one owns. It cannot pay a person. It can only buy the project token and burn it, and anyone can make it do that.

  1. A swap pays its fee

    The policy picks the total fee for this swap, inside the floor and the cap.

  2. The hook sets 10% aside

    It mints that part to the Treasury as claims, in the same transaction. The hook itself keeps nothing.

  3. The Treasury holds it

    No owner, no admin function and no way to pay a person. It can only buy and burn.

  4. Anyone triggers a buyback

    At most 5% of the claims per call, once an hour per currency, and never at more than about 3% above the pool’s average price of the last half hour.

  5. The token is burned

    What the Treasury buys is destroyed in the same transaction. Every call is on-chain and listed on the Treasury page.

What this costs. The share comes out of what liquidity providers would otherwise earn, and the backtest does not show that they get it back in a better fee. The buyback’s price limit caps what a sandwich can cost the Treasury at about 3%. A pool has no price history to measure it against in its first half hour, and nothing calls the buyback by itself: anyone can, and a script in the repository does. The details are in the risks; the rules are in the Treasury docs. It buys back and burns MYL.

04 Evidence

Tested. Replayed. Unedited.

Before putting the idea on a chain we tested it on real swaps, and Shadow replays it on real pools. This is what came out, including what it does not show.

Backtest · 735,161 real swaps

The result, unedited.

Better
0.79 vs 1.03

Prediction error of the next minute’s move: the network against a one-line rule. Lower is better.

Not clear
+0.76 bps

ETH/USDG, what liquidity providers kept: the network minus the rule (95% interval −0.06 to +1.47).

Passed
4 of 4

Pools where the network beat the rule. The project’s own test asked for a majority, and this passes. It is not evidence of better returns: the rule got weaker on the new inputs, and only one pool is clear of zero.

The network predicts well. Whether that earns liquidity providers more is not shown: the test passes by its own definition, but the rule it beats got weaker, and in the busiest pool the margin cannot be told from zero. We claim no return. The method, every number and the full report are in the docs.

Shadow · mainnet, read only

See it on real pools.

Replayed
150

Real swaps of the ETH / USDG pool, replayed through the model.

Paid
0.217%

The fee swappers really paid, on average. Another hook sets it.

Myelin
0.149%

What Myelin would have charged for the same swaps.

These are other pools’ swaps: Myelin’s own mainnet pool is new and starts empty. This compares fees, not returns: a lower fee means liquidity providers earn less on each swap. Numbers as of 2026-10-22 15:21 UTC.

05 How it differs

Three ways to set a fee.

A static fee never reacts. A keeper reacts from a server you cannot inspect. Myelin reacts inside the swap, with a rule you can re-run, and nobody can change it.

Static feeOff-chain keeperMyelin
Who sets the feeNobody. It never changes.An operator, from a server.A contract, from the pool’s own memory.
Can you re-run the decisionNothing to re-runNo. You only see the resultYes. Call predict() with the same inputs
Can the rule change in secretNoYesNo. It is immutable
What you have to trustNothingThe operator and their dataThe published weights, hashed on-chain
06 For builders

Ask the model anything. It is free.

The model is a pure function. Call it from a script, a bot or a terminal, and compare the answer with what the hook itself would charge. No key, no signup, no wallet.

predict.ts
// Ask the deployed model yourself: a view call, free, no wallet.
import { createPublicClient, http, parseAbi } from 'viem';

const client = createPublicClient({ transport: http('https://rpc.mainnet.chain.robinhood.com') });

const pred = await client.readContract({
  address: 'model address, published with the deployment',
  abi: parseAbi(['function predict(int256[8] x) pure returns (int256)']),
  functionName: 'predict',
  args: [[12n, 1212n, 339n, 86n, -324n, 1n, 4n, 3181n]],
}); // 445n: ln(1 + about 4.7 ticks) x 256
07 Questions

Questions, answered plainly.

More in the docs, including the risks.

What is Myelin?
A Uniswap v4 hook that sets the fee of a pool on every swap. The fee comes from a neural network that runs inside the swap transaction, so anyone can verify exactly how it was chosen. A fixed share of each fee goes to an ownerless Treasury that buys back and burns MYL.
Why put a neural network on-chain?
Because the point is that you do not have to trust it. A model that runs off-chain can be swapped or tuned in secret. One that runs inside the contract can only do what its public weights say, and you can call it yourself.
Does it beat a fixed fee?
Not shown. On four real pools the network predicts the next minute of price movement better than a one-line rule (a test error of 0.79 against 1.03). The project’s own test for liquidity providers, that the network leaves them better off than that rule in a majority of pools, is passed (4 of 4). We do not read that as better returns: the rule got weaker on the new inputs, only one pool’s margin is clear of zero, and set against that rule as it was on the first version’s inputs, the network is behind in the busiest pool. Myelin shows a mechanism you can verify, not a promise of returns. Nothing on this site is a performance claim.
Can the fee be gamed?
Not for the price of a wei. The pool’s memory changes only when the price stands at least 3 ticks from where the last observation left it, and at most once a second, so swaps of one wei, flickers between two ticks and bursts inside a second do nothing. In a search over 480 real pool states, the cheapest way found to push the fee to its cap took a median of 68 ticks of price movement over about 21 seconds. The first version of the memory needed 2 ticks, and none at all in nearly half of the states, because swaps of one wei counted. That is an upper bound from a search, and what it costs grows with the depth of the pool. The fee is also capped at 0.4127%, and anyone can compute the next fee in advance and wait for a cheap moment. The risks page has the rest.
Where does the Treasury share go?
Part of every fee (10% in this deployment) is minted to the Treasury contract as claims. Anyone can call buybackAndBurn: it spends at most 5% of those claims per call, once an hour per currency, on MYL in a plain pool, and burns what it receives. The swap never pays more than about 3% above the pool’s average price of the last half hour. Nothing calls it by itself, so someone has to: anyone can, and a script in the repository does. The Treasury page lists every call. The share comes out of what liquidity providers would otherwise earn, and the backtest does not show that they get it back.
Is there a token?
Yes: Myelin (MYL), contract 0x6C71AB1c7CbbA4194Fe956AA9e1fe4895d09fF43. The Treasury buys it back with its share of every fee and burns it; the docs explain how, and what limits it.
What does it cost to try?
Reading is free: the dashboard needs no wallet, and calling the model is a free view call. A swap costs the pool’s fee and gas; the hook adds about 60,000 gas to a swap, and about 76,600 when the swap updates its memory.
Why Robinhood Chain?
It runs Uniswap v4 with sub-second blocks and cheap gas, which makes it a good place for a hook that does real work on every swap.

Swap once.
Check everything.

Connect a wallet, make a swap, then recompute its fee yourself. Nothing to sign up for.