👩‍💻
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. Wrapper

V2 liquidity

Providing liquidity with the wrapper has the benefit that RBTC is automatically wrapped to WRBTC and the pool tokens are automatically deposited at the liquidity mining contract.

Adding liquidity

addLiquiditytoV2 accepts RBTC, wraps RBTC to WRBTC, adds liquidity to the converter contract and transfers the pool tokens to the liquidity mining contract.

function addLiquidityToV2(
        address _liquidityPoolConverterAddress, 
        address _reserveAddress,
        uint256 _amount, 
        uint256 _minReturn)  
returns(uint256) 

Arguments

Name
Type
Description

_liquidityPoolConverterAddress

address

address of LiquidityPoolConverter contract

_reserveAddress

address

address of the reserve token to add liquidity to

_amount

uint256

amount of liquidity to add

_minReturn

uint256

minimum return-amount of pool tokens

Returns

The amount of pool tokens minted.

Removing liquidity

removeLiquidityFromV2 withdraws the pool tokens from the liquidity mining contract, removes the liquidity from the converter contract , unwraps WRBTC to RBTC and sends those to the user.

function removeLiquidityFromV2(
    address _liquidityPoolConverterAddress, 
    address _reserveAddress,
    uint256 _amount, 
    uint256 _minReturn) 
returns(uint256) 

Arguments

Name
Type
Description

_liquidityPoolConverterAddress

address

address of the LiquidityPoolConverter contract

_poolToken

address

address of the pool token

_amount

uint256

amount of pool tokens to burn

_minReturn

uint256

minimum return-amount of reserve tokens

Returns

The amount of liquidity removed.

PreviousV1 liquidityNextSwaps

Last updated 1 year ago