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

Trading Mechanics

PreviousBin ArchitectureNextLiquidity Provision

Last updated 8 days ago

  • Bin-Based Liquidity:

    • Liquidity is divided into bins, each corresponding to a specific price point .

    • The bin step (e.g., 0.01% or 1 basis point) determines the price increment between bins.

    • Each bin holds reserves of two tokens (X and Y), but only the active bin (where the current market price lies) contains both tokens. Bins to the left (lower prices) hold only token Y, and bins to the right (higher prices) hold only token X.

  • Active Bin:

    • The active bin is where trading happens. It contains both tokens and supports swaps at its fixed price.

    • Trades within the active bin follow a constant sum formula (X + Y = k), meaning the price remains constant until one token is depleted. This contrasts with the constant product formula (x * y = k) in traditional AMMs.

  • Trades consume liquidity within the active bin at its set price. If demand exceeds the bin’s reserves (e.g., swapping 10 SUI when only 8 are available), the system shifts to the next bin (e.g., $3.10), executing the remainder at that price.

  • This stepwise progression mimics a limit order book but retains AMM decentralization and composability.

Current price for 1 wUSDT is 1 USDC