> ## Documentation Index
> Fetch the complete documentation index at: https://creator-a1160a86.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create pool

Now that our setup is ready, in this tutorial we will see how to create a DLMM pool.

## Load The Connection Object

To build a transaction object, we need to fetch the latest blockhash from the network.
This can be done simply by using the `connection` object from the client object we have
created in the `services.ts` file.

```typescript create-pool.ts theme={null}
const connection = sarosDLMM.connection;

const { blockhash } =
    await connection!.getLatestBlockhash({
    commitment: "confirmed",
});
```

The above connection object is the direct object from the `Connection` class imported from `@solana/web3.js`.
This is initialized when the `LiquidityBookServices` class is instantiated, so we can directly access it
from the client object.

## Building The Transaction

We have the `createPairWithConfig` method to build a transaction object to create a DLMM pool on Saros.

We need Base and Quote token details to create a pool, which is already configured in our `constants.ts` file.
Additionally, we need to provide binStep, ratePrice, and payer.

* **binStep** is the percentage price increment between consecutive bins.
* **ratePrice** is the relative price offset used when choosing the initial active bin.
* **payer** is the wallet address of the user who is creating the pool.

```typescript create-pool.ts theme={null}
import { BIN_STEP_CONFIGS } from "@saros-finance/dlmm-sdk";
import { PYUSD_TOKEN_DEVNET, WSOL_TOKEN_DEVNET } from "./constants.js";
import { sarosDLMM } from "./service.js";

const wallet = Keypair.generate(); // Use your custom logic to create a keypair object

const {tx, pair} = await sarosDLMM.createPairWithConfig({
    tokenBase: {
        mintAddress: PYUSD_TOKEN_DEVNET.mintAddress,
        decimal: PYUSD_TOKEN_DEVNET.decimals
    },
    tokenQuote: {
        mintAddress: WSOL_TOKEN_DEVNET.mintAddress,
        decimal: WSOL_TOKEN_DEVNET.decimals
    },
    binStep: BIN_STEP_CONFIGS[1]?.binStep || 1,
    ratePrice: 1,
    payer: wallet.publicKey
});

tx.recentBlockhash = blockhash;
tx.feePayer = wallet.publicKey;
```

> [!NOTE]
>
> The `pair` param is the address of the pool that is that is going to be created.

Now that the transaction is built, you can implement the sign and send logic
in your frontend or backend by utilizing the wallet interface of your choice.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.