LogoLogo
  • Overview
  • Key Principles
    • StableSwap Invariant
    • Amplification Coefficient
    • Low Slippage Mechanism
    • Liquidity Provider Benefits
  • FAQs
    • How rebalancing works?
  • Resources
    • Contract Addresses
    • Security
  • Community
    • Github
    • X
    • Telegram
Powered by GitBook
On this page
  • Algorithm
  • Fixed Ratio
  • Floating Ratio
  1. Key Principles

StableSwap Invariant

An easy to swap Bitcoin-pegged assets, with a seamless user experience.

PreviousOverviewNextAmplification Coefficient

Last updated 6 months ago

BitFLUX is an automated market maker (AMM) function focused on swapping between correlated assets - that include pegged-value cryptos (bitcoins) - with minimal slippage for traders and more efficient trading for liquidity providers. This includes different versions of bitcoins.

Algorithm

BitFLUX is a hybrid AMM that combines both Constant Product and Constant Sum models, and the following chart shows the stableswap algorithm in relation to constant product and constant sum invariants.

Fixed Ratio

  • This means that the sum of the assets remains constant, which helps maintain stable prices with minimal slippage. This model is particularly effective when trading assets with similar values.

Floating Ratio

  • This allows for greater flexibility in pricing, accommodating larger trades but with increased slippage. The price adjusts dynamically based on the available liquidity of each asset in the pool

The algorithm is a hybrid model that combines both fixed and floating ratios to optimize for low slippage and high liquidity. It adapts between these two formulas depending on the balance of the pool, ensuring efficient trading across various market conditions

A BitFLUX pool is an implementation of the stableswap invariant with 2 or more bitcoin assets, which can be referred to as a plain pool. Alternative and more complex pool flavors include pools with lending functionality, so-called lending pools, as well as metapools, which are pools that allow for the exchange of one or more assets underlying basepools.

Constant Sum: When the liquidity pool portfolio is balanced, the algorithm functions as a fixed ratio approach through the constant sum formula, expressed as x+y=kx+y=kx+y=k. You can observe the stableswap (blue line) staying close to the Constant Sum red line, and the price is stable.

Constant Product: As the liquidity pool portfolio becomes imbalanced, the algorithm transitions to a floating ratio using the constant product formula, expressed as x⋅y=kx⋅y=kx⋅y=k. You can observe the stableswap (blue line) now resembling the Constant Product purple line, and the price becoming expensive.