Myelin documentation
Myelin is a Uniswap v4 hook that sets the fee of every swap with a neural network running inside the swap. These pages explain how to use it, how it works, how to check it and how to build with it.
What it does
Before a swap, the hook reads what the pool remembers about its recent price moves (eight integers), asks a model of 289 parameters how far the price is likely to move in the next minute, and turns the answer into a fee: higher when the pool is likely to move, lower when it is calm, never below 0.05% or above 0.41%. After the swap, if the price really moved, it updates its memory. Part of the fee (10% in this deployment) goes to a Treasury that has no owner and uses it to buy back and burn a token.
Everything happens on-chain, in the same transaction as the swap. The fee needs no server, no oracle and no keeper, nothing has an admin key, and every fee it has ever set can be recomputed by anyone from public data. Only the buyback needs someone to call it: anyone can, and a keeper script in the repository does.
Where to start
Key facts
| Network | Robinhood Chain (chain id 4663) |
| Hook | 0xe98beA64f59d1Fd4C73df53B22C6439B601AB0c4 |
| Model | 0xF5400cC2836D462605b5d7877b2C26F3f134E87e |
| Fee range | 0.05% (floor) to 0.41% (cap); a static pool charges one fee at all times |
| Treasury share | 10% of every fee, fixed at deployment (the hook accepts at most 20%) |
| Model | 8 → 16 → 8 → 1, 289 parameters, integer arithmetic, 21,890 gas per prediction |
| Changeable by anyone? | No. No owner, no upgrade path: a new version is a new hook at a new address |
| License | MIT |
All pages
Use it
- Swap and read the fee: What the swap panel shows, and what you pay for.
- Provide liquidity: Add a position, choose a range, earn the fees, take it out.
How it works
- How the fee is set: The pool’s memory, the model and the policy, step by step.
- The model: The eight inputs, the network, and why it can run in a swap.
- Treasury, buyback and burn: Where the fee share goes and what limits it.
Trust
- Verify everything: Check the contracts, the model and every swap yourself.
- Backtest results: What we measured on 735,161 real swaps, including what did not work.
- Shadow mainnet: What Myelin would have charged on real mainnet pools, and how to read it.
- Risks: What can go wrong, in plain words.
- Status: What is done, what is checked and what is not.
Build
- Build with it: Read the fee, call the model, create a pool with the hook.
- Networks and addresses: Every contract, by network.
Reference
- Glossary: Ticks, basis points, hooks and the other words.