BIN mathematics and BIN liquidity model

TraderJoe's BIN math and TraderJoe's BIN liquidity documents provide a detailed explanation of the BIN Mathematics in Joe V2, which is essentially used to achieve concentrated liquidity by discretizing the price curve into Bins. This is similar to the tick concept in Uni V3, but the difference is that LB uses the constant sum formula instead of the constant product formula.

The constant sum formula refers to the fact that the total value of two assets in a trading pool is constant, meaning that the sum of the values of the two assets is always a fixed number. For example, if there are 200 DAI and 100 USDT in the pool, the total value of the two assets will always be a fixed number, such as $300. When making a trade, if a user wants to sell 10 DAI for 10 USDT, they will deposit the DAI into the pool and withdraw the corresponding amount of USDT, which will cause the pool to have 210 DAI and 90 USDT remaining, but the total value of DAI and USDT remains $300, commonly used in CSMM.

The constant product formula refers to the fact that the product of the quantities of two assets in a trading pool is constant, meaning that the product of the quantities of the two assets is always a fixed number. For example, if there are 10 XTokens and 1000 USDT in the pool, the product of the two quantities will always be a fixed number, such as 10,000. When making a trade, if a user wants to sell XTokens for USDT, they will deposit the XTokens into the pool, and the number of USDT in the pool will decrease accordingly, keeping the product of the quantities of XTokens and USDT constant, commonly used in CFMM.

Last updated