Skip to main content
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.
create-pool.ts
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.
create-pool.ts
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.