LBSwapService class provides methods for calculating swap amounts and fees. It is used internally by the LiquidityBookServices class, but can also be used as a standalone service.
Constructor
new LBSwapService
Creates a new instance of theLBSwapService class.
Parameters
Program<Idl>
required
The Liquidity Book program instance.
Connection
required
The Solana connection object.
Methods
fromLbConfig
A static method to create a new instance of theLBSwapService class.
Parameters
Program<Idl>
required
The Liquidity Book program instance.
Connection
required
The Solana connection object.
LBSwapService
A new instance of
LBSwapService.getBinArray
Retrieves the bin array for a given pair and bin array index. ParametersGetBinArrayParams
required
PublicKey
The public key of the bin array.
