For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create LB Pair

Deploy new liquidity book trading pairs with custom configurations for any token combination.

Prerequisites

Before creating a pair:

  • Initialize the SDK with valid configuration

  • Have wallet connected with sufficient gas

  • Ensure both token types are valid on Sui

  • Choose appropriate bin step for your pair type

  • Calculate initial active bin ID for starting price

Basic Usage

const tx = await sdk.Factory.createLBPair({
  tokenXType: "0x2::sui::SUI",
  tokenYType: "0x...::usdc::USDC", 
  binStep: 20,        // 20 basis points
  activeId: 8388608   // Starting price = 1.0
});

await sdk.fullClient.signAndExecuteTransaction({
  transaction: tx,
  signer: keypair
});

Parameters

tokenXType & tokenYType

  • Full type strings of both tokens

  • Order doesn't matter (SDK auto-sorts)

  • Must be different tokens

binStep

  • Price increment in basis points (1-10000)

  • Cannot be changed after creation

activeId

  • Starting bin ID (sets initial price)

  • Use 8388608 for 1:1 price ratio

Advanced Example

Token Ordering

DLMM requires tokenX < tokenY (by address). The SDK handles this automatically:

After Creation

  1. Pair is deployed but has no liquidity

  2. Use Add to New Position to provide initial liquidity

  3. Find your pair with Get Single Pair

Last updated