Magma Finance
  • Welcome
  • Magma Overview
  • product
    • Swap
    • Fees
    • Roadmap
    • Links
    • Media Kit
  • ALMM
    • Definations
    • Bin Architecture
    • Trading Mechanics
    • Liquidity Provision
    • Dynamic Fees
  • guides
    • How to Set Up Sui Wallet
    • How to Bridge Assets to Sui
    • How to Swap
    • How to Add Liquidity
  • contracts and security
    • Contracts
    • Security Audit
  • Developer Doc
Powered by GitBook
On this page
  1. ALMM

Bin Architecture

PreviousDefinationsNextTrading Mechanics

Last updated 9 days ago

Bins as Discrete Price Points:

Liquidity is divided into bins, each associated with a specific price for the token pair.

For example, in a SUI/USDC pool, bins might represent prices like $3, $3.01, $3.02, etc., depending on the bin step (the price increment between bins, e.g., 0.01% or 1 basis point).

The price within a bin follows a constant sum formula (X + Y = k), unlike the constant product formula (x * y = k) used in traditional AMMs like Uniswap V2. This means trades within a bin occur at a fixed price until one token is depleted.

Active Bin:

The active bin is the bin where the current market price lies and contains reserves of both tokens (X and Y).

Only the active bin facilitates trades and earns trading fees.

Bins to the left of the active bin (lower prices) contain only token Y (e.g., USDC in SUI/USDC), while bins to the right (higher prices) contain only token X (e.g., SUI). This happens because non-active bins are either depleted or waiting to be used.

Bin Step:

The bin step determines the price difference between consecutive bins. For example, a 0.01% bin step means each bin’s price is 0.01% higher than the previous one.

Smaller bin steps allow for finer control over liquidity placement but require more active management. Larger bin steps suit volatile pairs, as they cover wider price ranges.

Concentrated Liquidity:

LPs can allocate liquidity to specific bins within a chosen price range (e.g., $0.99 to $1.01 for USDC/USDT), rather than the entire price spectrum.

This concentrated liquidity ensures that capital is used only where trading activity is likely, maximizing fee earnings. For stable pairs like USDC/USDT, LPs can focus liquidity around $1, where most trades occur.

In the center is the active bin