# Add Liquidity

### **1. Add liquidity with two tokens**

Use the `add_liquidity_entry` function from the `router` module.

```javascript
 public entry fun add_liquidity_entry(
    lp: &signer,
    token_1: Object<Metadata>,
    token_2: Object<Metadata>,
    is_stable: bool,
    amount_1: u64,
    amount_2: u64,
) {
    ...
}
​
```

### **Function Parameters**

lp: The transaction signer (liquidity provider).token\_1: The first token object used to provide liquidity.token\_2: The second token object used to provide liquidity.is\_stable: A boolean flag indicating whether the pool is stable (true) or volatile (false)amount\_1: Amount oftoken\_1amount\_2: Amount oftoken\_2

#### 2. Add liquidity with two coins

Use theadd\_liquidity\_both\_coins\_entryfunction from theroutermodule.

```javascript
public entry fun add_liquidity_both_coins_entry<CoinA, CoinB>(
        lp: &signer,
        is_stable: bool,
        amount_1: u64,
        amount_2: u64,
    ) {
        ...
    }
```

#### **Function Parameters**

* `lp`: The transaction signer (liquidity provider).
* `coinA`: The first coin object used to provide liquidity.
* `coinB`: The second coin object used to provide liquidity.
* `is_stable`: A boolean flag indicating whether the pool is stable (`true`) or volatile (`false`)
* `amount_1`: Amount of `coinA`
* `amount_2`: Amount of `coinB`

### 3. **Add liquidity with a coin and a token**

Use the `add_liquidity_and_stake_coin_entry` function from the `router` module.

```javascript
public entry fun add_liquidity_and_stake_coin_entry<CoinType>(
        lp: &signer,
        token_2: Object<Metadata>,
        is_stable: bool,
        amount_1: u64,
        amount_2: u64,
    ) {
        ...
    }
```

#### **Function Parameters**

* `lp`: The transaction signer (liquidity provider).
* `CoinType`: The first coin object used to provide liquidity.
* `token_2`: The second token object used to provide liquidity.
* `is_stable`: A boolean flag indicating whether the pool is stable (`true`) or volatile (`false`)
* `amount_1`: Amount of coin
* `amount_2`: Amount of token

### 4. **Add liquidity and stake with two tokens**

Use the `add_liquidity_and_stake_entry` function from the `router` module.

```javascript
public entry fun add_liquidity_and_stake_entry(
        lp: &signer,
        token_1: Object<Metadata>,
        token_2: Object<Metadata>,
        is_stable: bool,
        amount_1: u64,
        amount_2: u64,
    ) {
       ...
    }
```

#### **Function Parameters**

* `lp`: The transaction signer (liquidity provider).
* `token_1`: The first token object used to provide liquidity.
* `token_2`: The second token object used to provide liquidity.
* `is_stable`: A boolean flag indicating whether the pool is stable (`true`) or volatile (`false`)
* `amount_1`: Amount of `token_1`
* `amount_2`: Amount of `token_2`

### **5. Add liquidity and stake with two coins**

Use the `add_liquidity_and_stake_both_coins_entry` function from the `router` module.

```javascript
public entry fun add_liquidity_and_stake_both_coins_entry<CoinA, CoinB>(
        lp: &signer,
        is_stable: bool,
        amount_1: u64,
        amount_2: u64,
    ) {
        ...
    }
```

#### **Function Parameters**

* `lp`: The transaction signer (liquidity provider).
* `coinA`: The first coin object used to provide liquidity.
* `coinB`: The second coin object used to provide liquidity.
* `is_stable`: A boolean flag indicating whether the pool is stable (`true`) or volatile (`false`)
* `amount_1`: Amount of `coinA`
* `amount_2`: Amount of `coinB`

### **6. Add liquidity and stake with a coin and a token**

Use the `add_liquidity_and_stake_coin_entry` function from the `router` module.

```javascript
public entry fun add_liquidity_and_stake_coin_entry<CoinType>(
        lp: &signer,
        token_2: Object<Metadata>,
        is_stable: bool,
        amount_1: u64,
        amount_2: u64,
    ) {
        ...
    }
```

### **Function Parameters**

* `lp`: The transaction signer (liquidity provider).
* `CoinType`: The first coin object used to provide liquidity.
* `token_2`: The second token object used to provide liquidity.
* `is_stable`: A boolean flag indicating whether the pool is stable (`true`) or volatile (`false`)
* `amount_1`: Amount of coin
* `amount_2`: Amount of token
