Create Pool Functions
createPermissionlessConstantProductPoolWithConfig
Creates a new permissionless constant product pool with a predefined configuration. Function- Both token amounts must be greater than zero
- If using native SOL, it will be automatically wrapped to wSOL
- The configparameter should be a valid configuration account
createPermissionlessConstantProductPoolWithConfig2
Creates a new permissionless constant product pool with a predefined configuration. This function is similar tocreatePermissionlessConstantProductPoolWithConfig but only if you need to set the activation point earlier than the default derived from the config.
Function
- Both token amounts must be greater than zero
- If using native SOL, it will be automatically wrapped to wSOL
- The configparameter should be a valid configuration account
- The activationPointparameter is the timestamp in seconds since the Unix epoch. If you want to set it to the current time, you can use'now'.
createPermissionlessPool
Creates a new permissionless constant product pool. Function- Both token amounts must be greater than zero
- If using native SOL, it will be automatically wrapped to wSOL
- The tradeFeeBpsparameter is the trade fee in basis points.
- The isStableparameter is whether the pool is stable.
- The skipAtaparameter is whether to skip creating associated token account for token A.
createPermissionlessConstantProductMemecoinPoolWithConfig
Creates a new permissionless constant product memecoin pool with a predefined configuration. Function- Both token amounts must be greater than zero
- If using native SOL, it will be automatically wrapped to wSOL
- The memecoinInfoparameter is the information for the memecoin.
- The feeVaultparameter is the information for the fee vault.
State Functions
getLpSupply
Get the total supply of the pool. Function- The poolparameter is the instance of the pool.
getUserBalance
Get the balance of a user in the pool. Function- The poolparameter is the instance of the pool.
- The ownerparameter is the address of the user.
getSwapQuote
Get the swap quote for a given amount of token. Function- The inTokenMintparameter is the mint address of the input token.
- The inAmountLamportparameter is the amount of input token to swap.
- The slippageparameter is the slippage tolerance.
- The swapInitiatorparameter is the address of the swap initiator.
getDepositQuote
Get the deposit quote for a given amount of token. Function- The tokenAInAmountparameter is the amount of token A to deposit.
- The tokenBInAmountparameter is the amount of token B to deposit.
- The balanceparameter is whether to use the balance of the user.
- The slippageparameter is the slippage tolerance.
getWithdrawQuote
Get the withdraw quote for a given amount of pool token. Function- The withdrawTokenAmountparameter is the amount of pool token to withdraw.
- The slippageparameter is the slippage tolerance.
updateState
Update the state of the pool. Function- The poolparameter is the instance of the pool.
Pool Functions
deposit
Deposit tokens into the pool. Function- The ownerparameter is the address of the owner.
- The tokenAInAmountparameter is the amount of token A to deposit.
- The tokenBInAmountparameter is the amount of token B to deposit.
- The poolTokenAmountparameter is the amount of pool token to deposit.
withdraw
Withdraw tokens from the pool. Function- The ownerparameter is the address of the owner.
- The lpTokenAmountparameter is the amount of pool token to withdraw.
- The tokenAOutAmountparameter is the amount of token A to withdraw.
- The tokenBOutAmountparameter is the amount of token B to withdraw.
swap
Swap tokens in the pool. Function- The ownerparameter is the address of the owner.
- The inTokenMintparameter is the mint address of the input token.
- The inAmountLamportparameter is the amount of input token to swap.
- The outAmountLamportparameter is the amount of output token to receive.
- The referralOwnerparameter is the address of the referral owner.

