How Poincaré works
Poincaré is a Uniswap v4 pool that can tell when the market is trending. While a trend lasts, trades that push with it pay a small extra charge, and the people who supplied the pool's liquidity keep it. Everyone else trades at the normal price.
The problem: liquidity providers lose money in trends
A liquidity pool holds two tokens, say USDC and WETH, and lets anyone swap one for the other. The people who deposit those tokens are liquidity providers (LPs), and they earn a fee on every swap.
The pool sets its price from its own balances. It does not know the price anywhere else. So when the price of WETH rises on other exchanges, the pool is briefly too cheap, and arbitrageurs buy from it until its price catches up. Each of those trades takes a little value out of the pool. That loss has a name: loss-versus-rebalancing (LVR).
A choppy market that moves up and down but goes nowhere costs LPs very little. A market that keeps moving one way is what drains them. A normal pool cannot tell these apart, so it gives the same price to the trades that hurt it and the trades that do not.
The idea
Poincaré does three things a normal pool does not.
- 1It watches its own price. Once per block, it records how much its price moved. No outside price feed is used.
- 2It decides whether a real trend has started. A statistical test adds up one-way movement and ignores noise. See The trend detector.
- 3It charges only the trades that push with the trend. They pay a spread of up to 5%, which stays in the pool for LPs. Trades in the other direction, and all trades in calm markets, pay the plain price. See The spread and the fee.
- The pool's own priceFrom its reserves, once per block, before the swap.
- Trend or chop?How much of the recent movement went one way.
- Evidence buildsA CUSUM statistic adds up one-way moves.
- Spread is setPast the threshold, a spread ramps to a 5% cap.
- Swaps are pricedWith the trend pays it. Against it pays nothing extra.
The same trend, in two pools
A normal pool
- The price starts moving one way.
- The pool keeps quoting the same curve to everyone.
- Arbitrageurs trade with the move, block after block.
- LPs lose the full amount (LVR).
A Poincaré pool
- The price starts moving one way.
- The detector confirms a trend from the pool's own price.
- Trades that push with the trend pay a spread of up to 5%.
- LPs keep the spread. Everyone else pays the plain price.
Poincaré does not remove the loss. LPs still hold both tokens and still feel real market moves. It reduces the part that is avoidable: the value that trend-following trades take.
What is actually deployed
- What you useReads and unsigned transactionsAppTypeScript SDKMCP serverHTTP API
- PeripheryRead the hook, never change itPoincareLens (quotes)PoincareDCA (orders)Keeper
- The hookPricing, detector, liquidityPoincareHookCusumDirectionalSignalControlLawAsymmetricCurvePriceLib
- Uniswap v4Settlement and routingPoolManagerRouter
| Part | What it does | Source |
|---|---|---|
| PoincareHook | The pool itself: the detector, the pricing and the liquidity | PoincareHook.sol (opens in a new tab) |
| PoincareLens | Read-only quotes that match what a swap will really pay | PoincareLens.sol (opens in a new tab) |
| PoincareDCA | Orders that buy or sell over time and wait out the spread | PoincareDCA.sol (opens in a new tab) |
| Five libraries | The maths, one job each (price, signal, detector, spread, curve) | src/libraries (opens in a new tab) |
It is live on Unichain Sepolia, a test network: the tokens have no value. Addresses are on the Contracts page.
See it live
- Analytics charts the detector block by block, read from the chain.
- Trade shows which side pays a spread right now, before you swap. No wallet is needed to look.
- Pool shows the liquidity and what LPs have earned from the spread.