🧬
Launch App
English
English
  • Say Hello to Raydium
  • Getting Started
    • How-to guides
    • SPL Wallet
      • Buying and selling digital assets
      • Bridging assets
    • Best practices
    • Welcome to UI V3
    • FAQ
  • Traders
    • Swapping
      • Swap FAQ
    • Blinks and Referrals
    • Trade API
    • Raydium Perps
      • Trading basics
      • Order types
      • Trading fees
  • Liquidity providers
    • Providing Concentrated Liquidity (CLMM)
      • Intro on Concentrated Liquidity
      • Estimated APR Calculations
      • Position creation cost (CLMM)
    • Providing Constant Product liquidity
      • Farms
    • Liquidity providing FAQ
  • POOL CREATION
    • LaunchLab
      • Create a Token
      • Buying a LaunchLab token
      • Earn referral fees!
      • Creator fee share
      • Platforms
      • LaunchLab TypeScript SDK
    • Pool types overview
    • Creating a CLMM Pool and Farm
    • Creating a Constant Product Pool
      • Creating an Ecosystem Farm
    • Burn & Earn
    • Pool creation fees
    • Pool creation FAQ
  • Protocol
    • RAY TOKEN
      • RAY Staking
      • Protocol Fees
      • RAY Buybacks
    • Developers
      • Addresses
      • APIs
    • Security
      • Access Controls
    • Bug Bounty Program
      • CLMM Bug Bounty Details
      • Hybrid AMM Bug Bounty Details
      • CPMM (CP-Swap) Bug Bounty Details
    • Protocol Metrics & Analytics
  • Media assets
  • updates
    • Token-2022 Support
    • Archive
      • Staking History Tool
      • V3 LPs migrated to V4
      • Serum DEX3 upgrade
      • Associated Token Account Migration
      • Serum DEX Deprecation
      • Transparency on Exploit Compensation Funds
      • Claim Portal
      • Creating an OpenBook AMM Pool
        • Creating an Ecosystem Farm
      • Integration with OpenBook
      • Acceleraytor
  • Learn more
    • Discord
    • Telegram
Powered by GitBook
On this page
  • Getting started
  • Installation
  • Initialization
  • Walkthrough
  • Key parameters
  • Claiming Fees and vested tokens

Was this helpful?

  1. POOL CREATION
  2. LaunchLab

LaunchLab TypeScript SDK

TypeScript SDK for interacting with LaunchLab bonding curves.

PreviousPlatformsNextPool types overview

Last updated 13 days ago

Was this helpful?

Getting started

This SDK offers tools and functions for interacting with LaunchLab bonding curves. It allows developers to effortlessly build platform config and bonding curves with custom settings and fee structures. SDK: Demo implementation: Mainnet program: LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj Devnet program: 7soRSLviCKHCKzCbRuVpZDif76NWLVqFtbjt8LpyxWSq

Installation

$ yarn add @raydium-io/raydium-sdk-v2

Initialization

import {
  TxVersion,
  DEV_LAUNCHPAD_PROGRAM,
  printSimulate,
  getPdaLaunchpadPoolId,
  Curve,
  PlatformConfig,
  LAUNCHPAD_PROGRAM,
} from '@raydium-io/raydium-sdk-v2'
import { initSdk } from '../config'
import BN from 'bn.js'
import { PublicKey } from '@solana/web3.js'
import { NATIVE_MINT } from '@solana/spl-token'
import Decimal from 'decimal.js'

Walkthrough

  • Users can buy and sell using the dedicated functions. The shareFeeRate, shareFeeReceiver third-party trade fees.

  • Once the threshold of total_quote_fund_raisingis attained, its status changes to 1 (migrate), trading stops on the bonding curve, and the pool migrates to an AMM pool, or CP-swap pool, depending on its migrate type.

Key parameters

  • platformID , pubkey from an existing platform.

  • platformFeeRate fees charged by the platform on the bonding curves in bps * 100, defined in platformConfig.

  • migrateCpLockNftScale the distribution of the revenue sharing between creators, platform, and compounded in the pool in bps * 100, defined in platformConfig

  • /migrateType ==='amm'or 'cpmm' determines if the bonding curves migrate to the AMMv4 or the Cpmm program. Only the Cpmm program allows for revenue sharing post-migration.

  • supplytotal amount of tokens minted, min = 10000000.totalSellA total amount of tokens sold on the bonding curves, min = 20%. totalLockedAmounttotal amount of token vesting, max = 30%. The amount of tokens provided on the pool at migration can be deduced from the two previous parameters; it needs to be ≥ 20% of the supply.

  • decimals number of decimals for the tokenA (base asset).

  • cliffPeriod is the number of seconds after migration before vesting starts. unlockPeriod is the number of seconds for which locked tokens will be vesting. - NB: startTime cannot be passed by users, the start time will be the migration block_stamp.

  • totalFundRaisingB is the total amount of quote tokens to raise on the bonding curve.

  • amountB(buyAmount)amount of tokenB spent alongside the curve initialization to buy tokenA.

Claiming Fees and vested tokens

App developers can create a platform config -eg. . -that allows them to define their fees on the bonding curves feeRate and set the distribution for revenue sharing post migration to a CP-Swap Pool migrateCpLockNftScale between the platform platformScale, the creator creatorScale, and fees compounded in the pool burnScale. Both the feeRate and platformScale parameters are expressed in bps * 100. NB: platformConfigs can only get updated once per epoch using the function .

Users can create tokens and a bonding curve using the function - eg. -. Users can freely set token parameters and metadata, the supply, amount sold, and quote raised.

Platform fees can be claimed by the platform owner using the ClaimPlatformFee function - . The function collects all pending fees from the bonding curves.

Fees post-migration can be claimed by the creator and the platform using the cpmm function haverstLockLiquidity - . Either party receives a dedicated representing their share of the trading fees for the locked principal and can claim independently of the other.

To enable vesting, the token creator needs to create the vesting accounts for any number of accounts using the function createVesting - .

Recipients of vested tokens can claim vested tokens at any time after the cliff using claimVesting - .

https://github.com/raydium-io/raydium-sdk-V2/tree/master/src/raydium/launchpad
https://github.com/raydium-io/raydium-sdk-V2-demo/tree/master/src/launchpad
createPlatform.ts
updatePlatformConfig
createLaunchpad
createMint.ts
demo
demo
NFT
demo
demo