Buttonwood
  • Buttonwood Basics
    • Introduction to Buttonwood
    • First Principles
    • FAQ
    • DeFi for Beginners
  • Learn
    • Glossary
    • Elastic Supply Assets
      • ButtonToken
      • UnbuttonToken
    • Tranche
      • Deposit Flow
      • Redemption Flow
    • ButtonZero
      • System Design
      • Lending
      • Borrowing
    • ButtonAuctions
    • ButtonSwap
      • Core Concepts
      • Pool Interactions
  • User Guides
    • ButtonSwap User Guide
      • Create a Pool
      • Swap
      • Add Liquidity
      • Remove Liquidity
    • ButtonZero User Guide
      • Primer
      • Borrow (Sell & Ask)
      • Lend (Buy & Bid)
      • Redemption
    • ButtonAuctions User Guide
      • Join an Auction
        • Redemptions
      • Create an Auction
      • Settle an Auction
      • Note on Rebasing Assets
    • Provide Liquidity on Uniswap
    • Mint Tranches
      • Mint Tranches via Contract
        • Minting AMPL Tranches
        • Minting ETH Tranches
        • Minting WBTC Tranches
        • Bond List
  • Developers
    • Deployed Contracts
      • Ethereum Mainnet
      • Görli Testnet
      • Kovan Testnet
      • Avalanche C-Chain
      • Base Mainnet
      • Arbitrum
      • Optimism
    • Tranche
      • Tranche
      • TrancheFactory
      • Bond
      • BondFactory
      • UniV3LoanRouter
    • Button Wrappers
      • ButtonToken
      • UnbuttonToken
      • ButtonTokenFactory
      • UnbuttonTokenFactory
    • Audits
    • Bug Bounty
  • Additional Resources
    • Apps
    • Github
    • Discord
    • Twitter
    • Website
    • ButtonZero
    • Zero Whitepaper
Powered by GitBook
On this page
  • Initialization of a Pool
  • Minting and Burning LP Shares (from existing pool)
  • Minting: Adding Liquidity
  • Redemption: Removing Liquidity

Was this helpful?

  1. Learn
  2. ButtonSwap

Pool Interactions

Initialization of a Pool

The creation (or initialization) of a pool determines the initial price of the asset pair, and their resulting swap ratio. The initializer receives LP shares for creating the pool. A larger amount of tokens deposited will result in more LP shares for the initializer. Increased liquidity will also lead to less slippage and a more stable pool.

Using x and y for each token, and s for the number of LP shares minted, liquidity pools are initialized as follows:

s−minted=√(x−deposited∗y−deposited)s_-minted = √(x_-deposited*y_-deposited)s−​minted=√(x−​deposited∗y−​deposited)

Minting and Burning LP Shares (from existing pool)

LP Share tokens represent a proportional share of the liquidity pool and the reservoirs. The tokens that flow into the reservoir after rebases can be reintegrated into the liquidity pool, leading to increased liquidity and fees.

Minting: Adding Liquidity

LPs can add liquidity in two ways:

  1. Deposit double-asset liquidity

  2. Deposit single-asset liquidity that is less than or equal to the value in the opposing reservoir

Let ‘s’ represent the number of shares, and ‘z’ represent the total number of tokens in the pool:

s−minted/s−starting=z−deposited/z−startings_-minted/s_-starting=z_-deposited/z_-startings−​minted/s−​starting=z−​deposited/z−​starting

LPs will always be able to deposit an equivalent amount of Token X and Y. When one reservoir, i.e. Token X, is partially filled, LPs can mint shares by depositing Token Y to balance the pool.

Redemption: Removing Liquidity

There are two types of redemption:

  1. LPs can withdraw liquidity and redeem (burn) for a proportional share of the pool and reservoir

  2. LPs can withdraw from just a single-asset reservoir, up to the total number of tokens in the reservoir.

Option #1 will always be available to LPs, resulting in an equivalent withdraw of Token X and Token Y. If one reservoir is partially filled, i.e. Token X, LPs can redeem shares for just Token X.

One thing LPs should be cognizant of - if you deposit single-asset liquidity, that does not mean you will be able to redeem for a single asset.

PreviousCore ConceptsNextButtonSwap User Guide

Last updated 2 years ago

Was this helpful?