Increment
  • 🍀OVERVIEW
    • Background
  • 🌊Protocols
    • 💱Decentralized Exchange
      • CPAMM DEX
        • User Guidance
        • AMM 101
        • Deployment Addresses
      • Stableswap DEX
        • Introduction
        • User Guidance
        • Deployment Addresses
      • DEX Aggregator
      • Smart Contract API
      • Token Listing
      • Security
    • 🏦Decentralized Money Market
      • User Guidance
      • Deployment Addresses
      • Interest Rate Model
      • Market Parameter
      • Liquidation
      • Governance
      • Security
    • 🔮Decentralized Price Feed (Oracle)
      • Architecture
      • Deployment Addresses
      • Using Price Feeds
      • Apply as Feeder
    • 👨‍🌾Liquidity Mining (Farm)
      • Token Farm
        • Deployment Addresses
      • NFT Farm
        • Deployment Addresses
    • 💧Liquid Staking
      • User Guidance
      • Deployment Addresses
      • Use stFlow
      • Protocol Overview
        • stFlow token
        • Protocol Epoch
        • Delegation Strategy
      • FAQ
      • Node Registration
      • Security
    • ✨Points
      • 📐Rules
      • 📄Terms
  • 💦Miscs
    • 📊Metrics
    • 📚Tutorials
    • 🛡️Security Audits
    • 🐛Bug Bounty
    • 🖼️Brand Assets
    • 🕸️Decentralized Web
    • 📄Term of Service
    • 📄Privacy Policy
  • 🌐Socials
    • 🐦 Twitter
    • 🤖️ Discord
    • 📚 Medium
    • ✈️ Telegram
Powered by GitBook
On this page
  1. 🌊Protocols
  2. 💱Decentralized Exchange
  3. Stableswap DEX

Introduction

PreviousStableswap DEXNextUser Guidance

Last updated 1 year ago

Stableswap is a type of amm algorithm that offers low slippage trading for two assets that are highly correlated in nature. For exmaple, it is very suitable for pairs like USDC<>FUSD and stFlow<>Flow.

The algorithm we're using is solidly stableswap algorithm, a CFMM with the invariant:

x3y+xy3>=Kx^3 y + x y^3 >= Kx3y+xy3>=K

It's simple and elegant, doesn't consume a lot of onchain computation units comparing with other complex stableswap algorithms, yet it provides a much smaller slippage than the cpamm dex, and enables more capital efficiency with the same amount of liquidity.

The original solidly stableswap curve works well for "hard" pegged assets, for example, stablecoins USDC/USDT/FUSD, or different version of bridged BTC like ceWBTC/whWBTC et al., but it's still subject to arbitrages for liquid staking assets (stFlow) - as stFlow's value (against flow) increases over time due to the auto-compounding of staking rewards.

To make it more suitable for liquid staking pairs, we've extended the original solidly stableswap algorithm further, which we call it "weighted-solidly-stableswap-curve", i.e.:.

(px)3y+(px)y3>=K;s.t.:p=stFlow/Flow(px)^3y +(px)y^3 >= K; s.t.: p = stFlow/Flow(px)3y+(px)y3>=K;s.t.:p=stFlow/Flow

Where p is the weight and taken from Liquid Staking smart contracts directly. After each epoch advancement, it'll increase value and then the bonding curve will be adjusted a little bit automatically.