The spread and the fee

Once a trend is confirmed, the pool changes one thing: the price it gives to the side pushing with the trend. The curve itself never changes shape. This page shows who pays what, with numbers, and why it is done this way.

One curve, always

Poincaré prices swaps on the same curve as the original Uniswap: the two balances multiplied together stay constant (x · y = k). That holds in calm markets and in trends, for buys and for sells. What changes in a trend is a spread added on top for one side.

Calm

No trend confirmed

Buy WETHPlain price
Sell WETHPlain price

Price rising

Up-trend confirmed

Buy WETH (with the trend)+ up to 5%
Sell WETH (against it)Plain price

Price falling

Down-trend confirmed

Buy WETH (against it)Plain price
Sell WETH (with the trend)+ up to 5%
The spread is one-sided. It is charged to the side that pushes the price further along the trend, and only while the trend is confirmed. The base fee (not shown) applies to every swap.

How big is the spread

It grows with the evidence from the detector: nothing below the threshold, a straight ramp above it, and a hard stop at 5%.

5% cap0%Spreadh 0.005cap 0.02Evidenceno spreadramps with evidence
How evidence becomes a spread. Below the threshold there is none. Past it the spread rises in a straight line and stops at 5%, however strong the trend gets. The cap is a safety limit: it bounds what any manipulation could ever be worth.

Source: ControlLaw.sol (opens in a new tab).

A worked example

The pool holds 3,000,000 USDC and 1,000 WETH, so its price is $3,000. You buy WETH with 30,000 USDC. The base fee is 0.10% at the time.

SituationYou receiveYour priceKept by LPs
Calm market9.8912 WETH$3,033The 30 USDC fee
Price rising, spread at its 5% cap9.3966 WETH$3,193The fee, plus 0.4946 WETH (about $1,484)
Price falling (you are against the trend)9.8912 WETH$3,033The 30 USDC fee

The calm price is above $3,000 because any large trade moves the price, in every pool of this kind. The trend spread is the extra on the second row, and it only appears when you are buying into a rise (or selling into a fall). The Trade screen shows this split before you confirm.

If you are not in a hurry. A spread-aware DCA order can wait while your side is being charged and fill when it is free again.

The base fee

Every swap also pays a small fee that follows volatility: half of the pool's recent average move per block, never more than 0.30%. In a quiet market it is close to zero. Like the spread, it stays in the pool for LPs.

Why not reshape the curve instead

The obvious way to lean against a trend is to make the curve steeper in one direction. We built that first, and it fails.

Two curves, one per direction (built, tested, rejected)

  1. Buy on the shallow curveLittle price impact on the way in.
  2. Sell back on the deep curveA better price on the way out.
  3. Pool value leavesThe trader ends with more than they started.

One curve plus a spread (what the pool does)

  1. Buy on the curvePays the spread if it is with the trend.
  2. Sell back on the same curveThe plain price, never better than the curve.
  3. Always ends with lessFees, spread and rounding all favour the pool.
Why the curve keeps one shape. Giving each direction its own curve moves the pool's mid-price, so a trader can buy on one and sell straight back on the other at a profit. A spread on a single curve can only make a round trip worse.

A safe version of the two-curve idea was then built and measured against the spread on four years of real prices. It lost by about thirty to one, because a steeper curve taxes every trade, including the ordinary ones the pool wants. So the curve stays symmetric, and a test in the repository keeps that setting locked off. Source: AsymmetricCurve.sol (opens in a new tab), evidence in OPEN_ITEMS.md (E1) (opens in a new tab).

Rounding

Every amount is rounded in the pool's favour: fees up, what you receive down. Each rounding is worth less than one unit of the smallest token amount, but it means no sequence of swaps can take value out of the pool through rounding. A test of 384,000 random operations checks this.

Unichain Sepolia · chain 1301 · testnetLaunch app