> For the complete documentation index, see [llms.txt](https://build.sovryn.com/builder-portal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://build.sovryn.com/builder-portal/smart-contracts/amm/wrapper/v2-liquidity.md).

# V2 liquidity

## 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.&#x20;

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

**Arguments**

<table><thead><tr><th width="226.33333333333334">Name</th><th width="134">Type</th><th>Description</th></tr></thead><tbody><tr><td>_liquidityPoolConverterAddress</td><td>address</td><td>address of LiquidityPoolConverter contract</td></tr><tr><td>_reserveAddress</td><td>address</td><td>address of the reserve token to add liquidity to</td></tr><tr><td>_amount</td><td>uint256</td><td>amount of liquidity to add</td></tr><tr><td>_minReturn</td><td>uint256</td><td>minimum return-amount of pool tokens </td></tr></tbody></table>

**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.&#x20;

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

**Arguments**

<table><thead><tr><th width="225.33333333333334">Name</th><th width="135">Type</th><th>Description</th></tr></thead><tbody><tr><td>_liquidityPoolConverterAddress</td><td>address</td><td>address of the LiquidityPoolConverter contract</td></tr><tr><td>_poolToken</td><td>address</td><td>address of the pool token</td></tr><tr><td>_amount</td><td>uint256</td><td>amount of pool tokens to burn</td></tr><tr><td>_minReturn</td><td>uint256</td><td>minimum return-amount of reserve tokens </td></tr></tbody></table>

**Returns**

The amount of liquidity removed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://build.sovryn.com/builder-portal/smart-contracts/amm/wrapper/v2-liquidity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
