Concepts Bins & ranges

Concepts

Bins & ranges.

From a market-cap range to Uniswap ticks, tick spacing and bin splitting.

You think in market caps; Uniswap thinks in ticks. Here is how a range in the app becomes a list of bins on-chain.

bin 1
bin 2
bin 3
bin 4
bin 5
usable ticks (multiples of tick spacing)5 bins × 3 spacings
A range is aligned to multiples of the pool's tick spacing, then cut into equal bins. The last bin absorbs any remainder.

Ticks in one paragraph

Uniswap prices live on a grid: tick i means a price of 1.0001^i (token1 per token0). Each pool has a tick spacing (for example 60 for a 0.3% V3 pool, or whatever a V4 pool chose), and positions can only start and end on multiples of it. See Uniswap: concentrated liquidity.

From your range to bins

  1. Market caps become ticks

    The app reads the pool's current tick and converts your min and max market caps into ticks around it. If the token is token1 of the pool, the direction flips: a higher token price is a lower tick.

  2. Ticks are aligned

    The contract rounds the lower tick down and the upper tick up to the tick spacing, and clamps them to the usable tick range.

  3. The range is split

    It is cut into numBins equal slices, each a whole number of tick spacings. If the range is too narrow for the number of bins you asked for, the bin count is reduced so every bin spans at least one tick spacing.

  4. Each bin gets its liquidity

    The contract computes the liquidity each bin can hold with its share of the deposit at the current price, using Uniswap's liquidity math, so it never takes more than you sent.

The price guard

Along with the range, the app sends minTick and maxTick: the current tick plus or minus your slippage. If the pool's tick is outside that window when your transaction executes, it reverts with PriceOutOfBounds. This protects you from sandwich attacks that push the price before adding liquidity.

Choosing a bin count

More bins give a smoother ladder but each bin is smaller. 10 is a good default; use 15 to 20 for wide ranges, fewer for narrow ones or high tick-spacing pools.