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 theconnection object from the client object we have
created in the services.ts file.
create-pool.ts
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 thecreatePairWithConfig 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. 