# Mint Position (add liquidity)

This is an example of creating a new position in Pangea's pool or depositing additional liquidity in an existing position.

```typescript
import { ethers } from "ethers";
import {BigNumber} from "@ethersproject/bignumber";

/// concentrated Liquidity Pool Manager address
const poolManagerAddress = "0x000...";

/// web3 Provider (metamask provider / jsonRPC provider / ...)
const provider = ethers.getDefaultProvider();

// Create new position
async function createPosition(
    poolAddress:string,
    lowerTick:number,
    upperTick:number,
    amount0Desired:BigNumber,
    amount1Desired:BigNumber
) {
      const pool = await ConcentratedLiquidityPool__factory.connect(poolAddress, provider);
      const token0 = await ERC20__factory.connect(await pool.token0(), provider);
      const token1 = await ERC20__factory.connect(await pool.token1(), provider);        
            
      const poolManager = await ConcentratedLiquidityPoolManager__factory.connect(positionManagerAddress, provider);
      // first, approve      
      await (await token0.approve(poolManager.address,amount0Desired)).wait();
      await (await token1.approve(poolManager.address, amount1Desired)).wait();
      
      // second, mint postion
      const tx = await poolManager.mint(
            poolAddress, 
            0, // if the lowerOld is not set, will search and input automatically
            lowerTick,
            0, // if the upperOld is not set, will search and input automatically
            uppterTick,
            amount0Desired,
            amount1Desired,
            0,
            0 // if positionId = 0 create new. else, add liquidity to the positionId
      );
      await tx.wait();
}
```


---

# Agent Instructions: 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://pangeaswap.gitbook.io/pangeaswap/en/developers/interacting-with-the-protocol/mint-position-add-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.
