Augmentlabs StableCoin with AMCF
  • Overview
    • 💡About Us
    • ✨Our Vision
  • Smart Contracts
    • 🪙USC Token
    • 🪙AGC Token
    • ⚖️Token Controller
    • 👨‍🍳MasterChef
    • ⚙️Uniswap Liquidity Auto Provider
    • ⚙️Pancakeswap Liquidity Auto Provider
    • 🕰️Timelock
    • 🔗AGC Governor
Powered by GitBook
On this page
  • Overview
  • Dependencies
  • How it works
  • Roles
  • Participants
  1. Smart Contracts

Pancakeswap Liquidity Auto Provider

The smart contract that allows user to deposit USC or USDT to provide liquidity to the pool without having to perform manual steps in Pancakeswap.

PreviousUniswap Liquidity Auto ProviderNextTimelock

Last updated 2 years ago

Overview

Contract:

BscLpAutoProvider is an Upgradeable smartcontract that takes advantage of the Zap tool to easily perform the swap-and-add-liquidity flow without having to do it manually.

Augmentlabs will create an USC/USDT pool on Pancakeswap(V2) and users can take advantage of the BscLpAutoProvider to provide liquidity to the pool.

The BscLpAutoProvider will be the owner of all LP tokens created as a result of the liquidity providing flow. This ensures the pool has high liquidity and no whales can create a shock in the liquidity.

The owner of the BscLpAutoProvider can only withdraw all LP tokens by using the withdrawLpTokens function that transfers all LP tokens to the owner address. This function is restricted to the Timelock and can only be approved via governance of token holders.

Dependencies

  • Pausable: Allows for pausing/unpausing of the smart contract.

  • AccessControl: Allows for multiple permission roles to exist in the same contract.

How it works

The users will call the provideLiquidity function to provide either USC or USDT. The BSC Liquidity Auto Provider will call to the Zap smartcontract to swap a certain amount of the provided token (either USC or USDT). After that, both the swapped amount and the remaining token will be used to provide liquidity to the USC/USDT pair on Pancakeswap.

Slippage tolerance will kick in to ensure that the tolerance percentage over 50% of the provided amount should not be exceeded (50% means the ideal case where 1 USC = 1 USDT)

Roles

  • Admin (DEFAULT_ADMIN_ROLE): Admin role is able to pause/unpause the smart contract and grant roles to other users. Admin role will be held by a gnosis safe address to ensure security.

  • Pauser (PAUSER_ROLE): Pauser role is able to pause/unpause the contract in case of emergencies. Initially no specific address is the holder of the Pauser role other than the Admin.

  • Upgrader (UPGRADER_ROLE): Upgrader role is able to upgrade the smart contract for future phases. Initially no specific address is the holder of the Upgrader role other than the Admin.

  • Operator (OPERATOR_ROLE): Operator role is able to perform the slippage tolerance change.

  • Withdrawer (WITHDRAWER_ROLE): Withdrawer role is able to withdraw a certain amount of liquidity from the pool to the owner address.

Participants

  • Gnosis-safe address as Admin, Pauser, Upgrader, Operator: This ensures important roles are secure and doesn't have single-point-of-failure. Also for future extension, Admin can grant roles to other addresses if needed.

  • Timelock as Withdrawer: This ensures that normally all liquidity are locked so the ecosystem is healthy. The withdraw liquidity is only available if it's approved through governance of AGC token holders.

  • User: Performs the provideLiquidity flow using USC/USDT on Pancakeswap.

⚙️
BscLpAutoProvider.sol
AGC