The Role of Bins on ION Finance DEX

6 min readMay 30, 2024

ION’s Hybrid order book AMM

ION Finance intends to become the leading DEX on the TON network, by leveraging its innovative hybrid model, which enhances the traditional AMM framework. Unlike the conventional x*y=k model used by platforms like Uniswap, ION Finance introduces a “bin” system for concentrated liquidity. This system allows liquidity providers to focus their funds within specific prices, ensuring liquidity is available where it’s most needed. This targeted approach avoids the inefficiencies of spreading liquidity across an infinite range, making ION Finance a more effective and efficient choice for users.

Understanding what bins are

A bin represents a small market where the exchange rate of two assets is constant, similar to a small Constant Sum Market Maker pool. Each bin functions like a quote in an order book, representing one specific price point, and collectively, these bins make up the entire pool for exchanging a pair of tokens. The active trading market is referred to as the active bin, meaning the price across the entire market equals the price of the token in the active bin. When a taker order is placed, the trade starts from this active bin, using its liquidity to fulfill the order. If the active bin’s liquidity is exhausted, the trade moves to the next bin.

For example, in a market exchanging token X for USDC, suppose the current price is 10 USDC, the next price is 11 USDC, and so on. If there are 5 tokens of X at each price due to maker orders and a taker places an order worth 100 USDC, the process involves traversing the bins. First, the trade initiates in the active bin with an exchange rate of 1:10. Since the active bin only has 5 tokens of X, the order partially fills, and the remaining 50 USDC moves to the next bin with an exchange rate of 1:11. Here, the remaining order is fulfilled, allowing the taker to receive a total of 5 tokens from the first bin and 50/11 tokens from the second bin, setting the new active bin’s price to 11 USDC.

Each bin maintains a fixed exchange rate, following the constant sum price formula, allowing trades within the bin to occur with a very reduced slippage. Slippage only happens when the liquidity in the active bin is exhausted and the trade moves to the next bin, contrasting with Constant Product Market Makers (CPMMs), where every trade experiences some degree of slippage.

Efficiency of ION’s concentrated liquidity with its order book AMM

A difference between Order book AMM and the traditional AMM is how liquidity is stacked inside liquidity pools. Liquidity providers (LPs) deposit liquidity into discretized price bins, each bin is assigned a specific price, and liquidity providers may provide liquidity to multiple bins. A key change is that all liquidity deposited into bins is given fungible token receipts.

A discretized bin refers to dividing the continuous prices into distinct intervals. Each bin represents a specific price segment, allowing for more precise liquidity allocation and trading within those defined ranges.

LPs using ION’s hybrid model can earn more fees while putting less capital at risk. Traders also indirectly benefit from improvements in efficiency by getting better prices and lower slippage on their trades. In traditional x*y=k AMMs, the deposited liquidity is distributed evenly across all price ranges–from zero to infinity. While this means that the liquidity pool always has tokens to buy and sell, it also means that a big part of the liquidity remains unused.

Order book AMM tries to solve this problem by allowing users to choose at what prices they want to provide liquidity, providing more flexibility, by letting liquidity providers select any number of bins. Much less liquidity is sitting idle and efficiency improvements can scale up to as much as a thousand times higher.

Discretized Bins to decrease swap slippage

Image from Treehouse Academy, https://www.treehouse.finance/treehouse-academy/trader-joe

ION Finance’s Hybrid Order Book AMM combines bins into one structure, aggregating liquidity from all of them to form a Liquidity Pool. Individually, bins act as constant sum pools with their own liquidity reserves, unlike existing AMM designs that use a constant product formula. This model uses pool reserves to calculate prices, often resulting in traders paying more for fewer tokens.

In the Hybrid Order Book AMM, the price is derived from an active bin and remains constant inside it. As a result, if the trade occurs using reserves from the bin being used for the transaction, the trade will execute with almost zero slippage.

Price impact occurs when a trade requires a bin change, which happens when reserves in the currently active bin are insufficient to fulfill the trade. This feature is particularly beneficial for swaps between stablecoins and other pegged assets, as their prices are expected to be equal to each other most of the time.

The AMM model has seen significant developments to date, but there are still notable drawbacks and areas needing solutions and enhancements. The Hybrid Order Book AMM strives to give traders more efficient trades, provide liquidity providers with enhanced efficiency, mitigate impermanent loss, and maximize the composability of their liquidity.

BIN concentrated liquidity AMM X traditional concentrated liquidity AMM

Example below of concentrated liquidity AMM without BIN (left) and with BIN (right)

Image from Avalanche, https://medium.com/avalancheavax/trader-joe-presents-liquidity-book-a-new-amm-design-for-defi-39abf87e0d7f

Concentrated liquidity AMM with bins offers distinct advantages over traditional range-based concentrated liquidity models.

Concentrated liquidity AMMs allow liquidity providers (LPs) to allocate their funds within specific price ranges, concentrating liquidity at price points they expect to be most active. This enhances capital efficiency, as funds are not spread thinly across a wide range of prices. However, this model also has its limitations. Each price range effectively operates like a separate mini-pool, leading to potential slippage within that range during a swap. Slippage occurs because the price can shift due to the trade’s impact on the supply and demand dynamics of the tokens involved. For larger trades that cover multiple ranges, the impact is gradual as liquidity is consumed from one range to the next, maintaining the risk of slippage within each active range.

On the other hand, the liquidity bins model organizes liquidity into discrete, fixed price points or bins. LPs provide liquidity directly to these bins, simplifying the process as they no longer need to choose a range but rather specific price points. This approach allows investors to support single or multiple bins, which has a notable impact on swap execution. When a swap is executed, it fully utilizes the liquidity available at a particular bin’s price, ensuring a consistent price for as much of the swap as that bin can support. If the swap size exceeds the liquidity in one bin, it seamlessly moves to the next available bin, continuing this process until the swap amount is fulfilled. This method reduces slippage significantly, as each portion of the swap is executed at a known and fixed price, unlike the fluctuating prices within a range-based system.

The difference in these approaches fundamentally impacts the predictability and efficiency of swaps. The liquidity bins model can offer more predictable pricing, especially beneficial for large trades that might experience significant slippage in a range-based system. This predictability is important for traders seeking to minimize costs and maximize transaction returns.

While both models aim to solve liquidity and efficiency challenges in decentralized trading platforms, using liquidity bins provides a more simplified and slippage-resistant approach. The choice between these systems depends on the specific needs and strategies of liquidity providers and traders. Still, the benefits of reduced slippage and enhanced price predictability make the liquidity bins model an attractive alternative for many.

BINS advantage

The benefits of using bins in DeFi trading are diverse. Bins enable precise liquidity management by segmenting the price range into discrete intervals, allowing liquidity providers to allocate their assets more efficiently and effectively. This structure reduces price slippage for trades within a bin, ensuring more stable and predictable pricing. Furthermore, by concentrating liquidity in specific price ranges, bins enhance the overall capital efficiency of the pool. This targeted approach minimizes impermanent loss for liquidity providers and provides traders with more reliable and cost-effective transactions, particularly for assets with stable or predictable price movements. Overall, implementing bins represents a major advancement in optimizing DeFi trading systems such as on ION Finance.

📲Access our social media:

Website | TG channel | Twitter | Medium

Thank you,

The ION Finance team

--

--

ION Finance
ION Finance

Written by ION Finance

Trade Tailored, Profit Amplified

No responses yet