👩‍💻
Builder Portal
  • Sovryn Builder Portal
    • Contribution
  • Design System
    • Design principles
    • Structure
    • Usage by Sovryn
  • UI Library
    • Overview
    • Getting Started
    • Atoms
      • Accordion
      • Badge
      • HealthBar
      • Button
      • DynamicValue
      • Heading
      • ErrorBadge
      • Icon
      • Input
      • Lottie
      • Paragraph
      • Toggle
      • Link
      • Checkbox
    • Molecules
      • AmountInput
      • ContextLink
      • Dialog
      • Dropdown
      • ErrorList
      • Footer
      • FormGroup
      • Header
      • HelperButton
      • Menu
      • NavMenuItem
      • Notification
      • Overlay
      • Pagination
      • RadioButton
      • RadioButtonGroup
      • Select
      • SimpleTable
      • StatusItem
      • Table
      • TableBase
      • Tabs
      • Tooltip
      • TransactionId
      • VerticalTabs
      • VerticalTabsMobile
      • WalletContainer
      • WalletIdentity
    • Working with Components
    • Links
    • Contribution
  • Sovryn SDK
    • Smart Router
      • Creating a New Swap Route
      • Available routes
        • AMM
        • MoC integration
        • MYNT bAsset
        • MYNT fixed rate
    • Sovryn Onboard
      • Installation
      • Usage
      • Custom Connectors
      • Custom UI
      • Contribution
    • The Graph
      • Overview
      • Usage
      • Sovryn Subgraphs
      • Advanced Usage
  • sovryn.app
    • Overview
    • Sovryn UI Library Usage
    • The Graph Usage
    • Links
    • Contribution
    • Dapp specific components
      • MaxButton
  • Smart Contracts
    • Overview
    • AMM
      • Liquidity
        • V1 Converters
        • V2 Converters
      • Conversion
      • Wrapper
        • V1 liquidity
        • V2 liquidity
        • Swaps
    • Sovryn Protocol
      • Lending
        • Mint
        • Burn
      • Borrowing
        • Borrow
        • Repay
      • Margin Trading
        • Open
        • Close
      • Collateral Management
    • Liquidity Mining
      • Deposit
      • Withdraw
      • Rewards
    • FastBTC
      • RSK->BTC
    • Bitocracy
      • Staking
      • Governor
      • Fee Sharing
      • Vesting
    • Zero
      • Borrower operations
      • Trove Manager
      • Satability Pool
      • Rewards
    • Mynt & DLLR
      • Basset to Masset Conversion
      • Masset to Basset Conversion
      • MOC Integration Conversion
Powered by GitBook
On this page
  • Adding Liquidity
  • Removing liquidity
  1. Smart Contracts
  2. AMM
  3. Liquidity

V1 Converters

On V1 Converters, the same value of both reserve assets need to be provided or removed. One LP token corresponds to a share of both reserve assets.

Adding Liquidity

addLiquidity increases the pool's liquidity and mints new LP tokens (shares in the pool) to the caller. The assets are to be provided in the same ratio as the pool holds them at the time of transaction execution. If the ratio differs, not all provided tokens will be transferred to the pool.

function addLiquidity(IERC20Token[] _reserveTokens, uint256[] _reserveAmounts, uint256 _minReturn) public payable protected active 

Arguments

Name
Type
Description

_reserveTokens

IERC20Token[]

address of each reserve token

_reserveAmounts

uint256[]

amount of each reserve token

_minReturn

uint256

minimum return amount of liquidity pool tokens

Removing liquidity

removeLiquidity decreases the pool's liquidity and burns the caller's shares in the pool.

function removeLiquidity(uint256 _amount, IERC20Token[] _reserveTokens, uint256[] _reserveMinReturnAmounts) public nonpayable protected active 

Arguments

Name
Type
Description

_amount

uint256

amount of liquidity pool tokens to burn in exchange for the underlying reserves.

_reserveTokens

IERC20Token[]

address of each reserve token

_reserveMinReturnAmounts

uint256[]

minimum return-amount of each reserve token

PreviousLiquidityNextV2 Converters

Last updated 1 year ago