# Standard Pool

### Steps to Integration

There are three steps in conducting a create pool: 1) prepare input, 2) approve tokens, 3) conduct create pool. You need to install PiperX sdk and import it to proceed.

```javascript
import { v2AddLiquidity, v2RouterTokenApproval, } from '@piperx/sdk/src/core'
import { WIP_ADDRESS } from '@piperx/sdk/src/constant'
```

#### Prepare Input

You need the following inputs before you can create a pool&#x20;

```typescript
token1_address: address, // if it is $IP native token, use WIP_ADDRESS
token2_address: address, // if it is $IP native token, use WIP_ADDRESS
amount1: bigint, // amount of token 1 you want to deposit to the pool
amount2: bigint, // amount of token 2 you want to deposit to the pool
amount1Min: bigint, // minimal amount of token 1 you want to deposit to the pool
amount2Min: bigint, // minmial amount of token 2 you want to deposit to the pool
expire_time: bigint// expiration timestamp for a swap
signer: ethers.Signer
```

Note that, if you are creating pool with $IP token, you should pass in the PiperX wrapped $IP token address, because the $IP token is not a ERC-20 token. For example, if you are create  $IP to $USDC pool, please use wrapped $IP address `WIP_ADDRESS`

#### Approve tokens

You need to approve the router contract to both your tokens to create this pool

```typescript
await v2RouterTokenApproval(token1_address, amount1, signer)
await v2RouterTokenApproval(token2_address, amount2, signer)
```

#### Creating the pool

```typescript
await v2AddLiquidity(
    token1: string,
    token2: string,
    amount1: bigint,
    amount2: bigint,
    amount1Min: bigint,
    amount2Min: bigint,
    expire_time: bigint,
    signer: ethers.Signer
)
```


---

# 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://docs.piperx.xyz/developer/sdks/create-pool/standard-pool.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.
