GENESYS BLOCKCHAIN
  • ⛓️GENESYS BLOCKCHAIN (GCHAIN)
    • ⛓️GCHAIN
    • ✅What is GCHAIN?
    • ✅Proof of Authority
    • ✅Validators
    • ✅(GSYS)
    • ✅How to add Gchain to your wallet
    • 📚Glossary
    • ⚠️Terms & Conditions
  • 🐘GENESYS WALLET (GWALLET)
    • 🐘How to create your Gwallet
  • GENESYS VIEWAPP
    • 📊GVA General Aspects
      • 📈Why GVA?
        • 📊GenesysView App
        • 📈GVA products & Services
        • 📈GVA Features
        • 📈GVA Launchpad
          • Connect Wallet
          • Change Network
          • Let's Connect
          • Coin Crafter
            • Mint Coin
            • My Token Collection
          • Genesys Platform
            • Launch Pre-sale
            • Pre-sale Directory
          • Reward Lock
            • Set up Pool
            • Pool Ledger
          • Prize Draw
            • Launch Simple Lottery
            • Lottery Roster
          • Secure Vault
            • Establish Secure Lock
            • Token Secure Storage
            • Liquidity Vaults
          • Utility Kit
            • Multisender
            • Wrapped Converter
            • D-vote
            • Soon!
            • Market Maker
          • Collaboration Hub
        • 👨‍💻GVA P2P exchange
        • 🔐GVA Privacy & Security
  • BLUELOTUSDAO
    • Introduction
      • Best returns/yield for Liquidity Providers (LPs)
      • Best Rates for Traders
    • BlueLotusDAO Products
      • 🔁Exchange
        • Token Swap
        • Time to Trade
        • LPs (Liquidity Pools)
        • How to Add/Remove Liquidity V2
        • How to Add/Remove Liquidity V3
      • 🚜Farming
        • How to Use Farms
      • 🪙Pools
        • How to Stake in Pools
      • BlueLotusDAO Protocol
        • How BlueLotusDAO works
        • Programmable Pricing Curve
        • Dynamic Fee
        • BlueLotusDAO Ecosystem
        • Adding Liquidity in BlueLotusDAO
        • Protocol Fee
        • BLDT TOKENOMICS
          • BLDT Description
          • Deflationary Mechanisms
  • BLUELOTUSDAO GOVERNANCE
    • Introduction
    • Native Token
    • Governance
      • 📝Summary
      • 📚Categories
      • 🤝Voting
        • Voting Authority
      • ⚙️Governance Process
        • Governance Stages
          • Temperature Check
          • Consensus Check
          • Governance Proposal
      • 🔗Security
      • 🌎Blue Lotus Foundation
  • BLUE20-BRIDGE
    • Blue20-Bridge Intro
    • Blue20-Bridge
    • How to use Blue20-Bridge
Powered by GitBook
On this page
  1. BLUELOTUSDAO
  2. BlueLotusDAO Products
  3. BlueLotusDAO Protocol

Adding Liquidity in BlueLotusDAO

PreviousBlueLotusDAO EcosystemNextProtocol Fee

Last updated 1 year ago

There are some conditions when adding liquidity to the BlueLotusDAO:

  1. After LP contributions, the token price is unchanged.

  2. PminP_{min}Pmin​ and PmaxP_{max}Pmax​ are also unchanged after LP contributions.

In BlueLotusDAO, the pool for pair X-Y needs to maintain 4 parameters:

  1. The initial amount of token XXX that is used for amplification, denoted by x0x_0x0​

  2. The initial amount of token YYY that is used for amplification, denoted by y0y_0y0​

  3. The change in token XXX amount after trading activities, denoted by Δx0\Delta x_0Δx0​

  4. The change in token YYY amount after trading activities, denoted by Δy0\Delta y_0Δy0​

Therefore, the real balances and virtual balances of the reserves are:

Real Balances

x=x0+Δx0y=y0+Δy0x = x_0 + \Delta x_0 \\ y = y_0 + \Delta y_0x=x0​+Δx0​y=y0​+Δy0​

Virtual Balances

x′=a⋅x0+Δx0y′=a⋅y0+Δy0x' = a \cdot x_0 + \Delta x_0 \\ y' = a \cdot y_0 + \Delta y_0x′=a⋅x0​+Δx0​y′=a⋅y0​+Δy0​

The real balances and virtual balances of the reserve after contribution are:

Real Balances

Virtual Balances

The constant product, after the LP contribution, becomes:

Example

  • Suppose an LP wants to contribute 20% of the current token amounts in the pool, so he should deposit:

ie. deposit 24X and 17Y tokens.

where aaa is the amplification factor. You may find more information about the amplification factor .

The constant product x′⋅y′=(a⋅x0+Δx0)⋅(a⋅y0+Δy0)=k′x' \cdot y' = (a \cdot x_0 + \Delta x_0) \cdot (a \cdot y_0 + \Delta y_0) = k'x′⋅y′=(a⋅x0​+Δx0​)⋅(a⋅y0​+Δy0​)=k′.

Note that PminP_{min}Pmin​ and PmaxP_{max}Pmax​ at this time are:

{Pmin=(y0⋅a−y0)2k′Pmax=k′(x0⋅a−x0)2\begin{cases} P_{min} = \cfrac{(y_0 \cdot a - y_0)^2}{k'} \\ \\ P_{max} = \cfrac{k'}{(x_0 \cdot a - x_0)^2} \end{cases}⎩⎨⎧​Pmin​=k′(y0​⋅a−y0​)2​Pmax​=(x0​⋅a−x0​)2k′​​

The current price: P=y′x′=a⋅y0+Δy0a⋅x0+Δx0P = \cfrac{y'}{x'} = \cfrac{a \cdot y_0 + \Delta y_0}{a \cdot x_0 + \Delta x_0}P=x′y′​=a⋅x0​+Δx0​a⋅y0​+Δy0​​

Liquidity Providers have to contribute in the same proportion for all 4 amount types. We denote the contribution ratio to be bbb. LPs have to contribute x1+Δx1x_1 + \Delta x_1x1​+Δx1​, y1+Δy1y_1 + \Delta y_1y1​+Δy1​ in which:

{x1=b⋅x0Δx1=b⋅Δx0y1=b⋅y0Δy1=b⋅Δy0\begin{cases} x_1 = b \cdot x_0 \\ \Delta x_1 = b \cdot \Delta x_0 \\ y_1 = b \cdot y_0 \\ \Delta y_1 = b \cdot \Delta y_0 \end{cases}⎩⎨⎧​x1​=b⋅x0​Δx1​=b⋅Δx0​y1​=b⋅y0​Δy1​=b⋅Δy0​​
x=(x0+x1)+(Δx0+Δx1)=(b+1)⋅(x0+Δx0)y=(y0+y1)+(Δy0+Δy1)=(b+1)⋅(y0+Δy0)x = (x_0 + x_1) + (\Delta x_0 + \Delta x_1) = (b + 1) \cdot (x_0 + \Delta x_0) \\ y = (y_0 + y_1) + (\Delta y_0 + \Delta y_1) = (b + 1) \cdot (y_0 + \Delta y_0)x=(x0​+x1​)+(Δx0​+Δx1​)=(b+1)⋅(x0​+Δx0​)y=(y0​+y1​)+(Δy0​+Δy1​)=(b+1)⋅(y0​+Δy0​)
x′=a⋅(x0+x1)+(Δx0+Δx1)=(b+1)⋅(a⋅x0+Δx0)y′=a⋅(y0+y1)+(Δy0+Δy1)=(b+1)⋅(a⋅y0+Δy0)x' = a \cdot (x_0 + x_1) + (\Delta x_0 + \Delta x_1) = (b + 1) \cdot (a \cdot x_0 + \Delta x_0) \\ y' = a \cdot (y_0 + y_1) + (\Delta y_0 + \Delta y_1) = (b + 1) \cdot (a \cdot y_0 + \Delta y_0)x′=a⋅(x0​+x1​)+(Δx0​+Δx1​)=(b+1)⋅(a⋅x0​+Δx0​)y′=a⋅(y0​+y1​)+(Δy0​+Δy1​)=(b+1)⋅(a⋅y0​+Δy0​)
x′⋅y′=(b+1)2⋅(a⋅x0+Δx0)⋅(a⋅y0+Δy0)=(b+1)2⋅k′x' \cdot y' = (b + 1)^2 \cdot (a \cdot x_0 + \Delta x_0) \cdot (a \cdot y_0 + \Delta y_0) = (b + 1)^2 \cdot k'x′⋅y′=(b+1)2⋅(a⋅x0​+Δx0​)⋅(a⋅y0​+Δy0​)=(b+1)2⋅k′

PminP_{min}Pmin​ and PmaxP_{max}Pmax​ at this time are:

{Pmin=((y0+y1)⋅a−(y0+y1))2(b+1)2⋅k′=(y0⋅a−y0)2k′Pmax=(b+1)2⋅k′((x0+x1)⋅a−(x0+x1))2=(x0⋅a−x0)2k′\begin{cases} P_{min} = \cfrac{((y_0 + y_1) \cdot a - (y_0 + y_1))^2}{(b + 1)^2 \cdot k'} = \cfrac{(y_0 \cdot a - y_0)^2}{k'} \\ P_{max} = \cfrac{(b + 1)^2 \cdot k'}{((x_0 + x_1) \cdot a - (x_0 + x_1))^2} = \cfrac{(x_0 \cdot a - x_0)^2}{k'} \end{cases}⎩⎨⎧​Pmin​=(b+1)2⋅k′((y0​+y1​)⋅a−(y0​+y1​))2​=k′(y0​⋅a−y0​)2​Pmax​=((x0​+x1​)⋅a−(x0​+x1​))2(b+1)2⋅k′​=k′(x0​⋅a−x0​)2​​

The current price is updated to be P=y′x′=(a⋅y0+Δy0)⋅(b+1)(a⋅x0+Δx0)⋅(b+1)=a⋅y0+Δy0a⋅x0+Δx0P = \cfrac{y'}{x'} = \cfrac{(a \cdot y_0 + \Delta y_0) \cdot (b + 1)}{(a \cdot x_0 + \Delta x_0) \cdot (b + 1)} = \cfrac{a \cdot y_0 + \Delta y_0}{a \cdot x_0 + \Delta x_0}P=x′y′​=(a⋅x0​+Δx0​)⋅(b+1)(a⋅y0​+Δy0​)⋅(b+1)​=a⋅x0​+Δx0​a⋅y0​+Δy0​​

We see that after LP contributes, the current price, PminP_{min}Pmin​ and PmaxP_{max}Pmax​ are unchanged. It is similar in the case of LPs withdrawals, where the ratio bbb is negative.

Initially, the first LP put 100 XXX and 100 YYY to the reserve, we have: x=100,y=100,Δx=0,Δy=0x = 100, y = 100, \Delta x = 0, \Delta y = 0x=100,y=100,Δx=0,Δy=0.

A user trades 20 X for 15 Y, so we have the updated parameters: x=100,y=100,Δx=20,Δy=−15x = 100, y = 100, \Delta x = 20, \Delta y = −15x=100,y=100,Δx=20,Δy=−15.

0.2⋅100+0.2⋅20=24(X)0.2⋅100+0.2⋅(−15)=17(Y)0.2 · 100 + 0.2 · 20 = 24 (X) \\ 0.2 · 100 + 0.2 · (−15) = 17 (Y)0.2⋅100+0.2⋅20=24(X)0.2⋅100+0.2⋅(−15)=17(Y)

The parameters are then updated to be: x=120x = 120x=120, y=120y = 120y=120, Δx=24\Delta x = 24Δx=24, Δy=−18\Delta y = −18Δy=−18.

here
Page cover image