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.

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).

An example. WETH goes from $3,000 to $3,300 over an hour, in small steps. At every step the pool is a little behind, and at every step someone buys the cheap WETH from it. The LPs end the hour holding less WETH than if they had simply kept their tokens, and the difference went to the arbitrageurs.

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.

  1. 1
    It watches its own price. Once per block, it records how much its price moved. No outside price feed is used.
  2. 2
    It decides whether a real trend has started. A statistical test adds up one-way movement and ignores noise. See The trend detector.
  3. 3
    It 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.
  1. The pool's own priceFrom its reserves, once per block, before the swap.
  2. Trend or chop?How much of the recent movement went one way.
  3. Evidence buildsA CUSUM statistic adds up one-way moves.
  4. Spread is setPast the threshold, a spread ramps to a 5% cap.
  5. Swaps are pricedWith the trend pays it. Against it pays nothing extra.
The loop the pool runs. It reads its own price once per block, decides whether a real trend is under way, and prices the next swaps accordingly. Nothing outside the pool is consulted.

The same trend, in two pools

A normal pool

  1. The price starts moving one way.
  2. The pool keeps quoting the same curve to everyone.
  3. Arbitrageurs trade with the move, block after block.
  4. LPs lose the full amount (LVR).

A Poincaré pool

  1. The price starts moving one way.
  2. The detector confirms a trend from the pool's own price.
  3. Trades that push with the trend pay a spread of up to 5%.
  4. LPs keep the spread. Everyone else pays the plain price.
The same price trend, in two pools. The difference is the third step: Poincaré notices the trend and makes the trades that follow it pay for the damage they do.

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

  1. What you useReads and unsigned transactionsAppTypeScript SDKMCP serverHTTP API
  2. PeripheryRead the hook, never change itPoincareLens (quotes)PoincareDCA (orders)Keeper
  3. The hookPricing, detector, liquidityPoincareHookCusumDirectionalSignalControlLawAsymmetricCurvePriceLib
  4. Uniswap v4Settlement and routingPoolManagerRouter
The parts, from what you touch down to Uniswap. Everything above the hook only reads it or trades through Uniswap's own router; the hook itself has no admin and cannot be changed after deployment.
PartWhat it doesSource
PoincareHookThe pool itself: the detector, the pricing and the liquidityPoincareHook.sol (opens in a new tab)
PoincareLensRead-only quotes that match what a swap will really payPoincareLens.sol (opens in a new tab)
PoincareDCAOrders that buy or sell over time and wait out the spreadPoincareDCA.sol (opens in a new tab)
Five librariesThe 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.

Unichain Sepolia · chain 1301 · testnetLaunch app