LaunchLab TypeScript SDK
TypeScript SDK for interacting with LaunchLab bonding curves.
Last updated
Was this helpful?
TypeScript SDK for interacting with LaunchLab bonding curves.
Last updated
Was this helpful?
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
Users can buy and sell using the dedicated functions. The shareFeeRate, shareFeeReceiver third-party trade fees.
Once the threshold of total_quote_fund_raising
is 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.
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 'cpswap'
determines if the bonding curves migrate to the AMMv4 or the CPswap program. Only the CPswap programs allow for revenue sharing post-migration.
supply
total amount of tokens minted, min = 10000000.totalSellA
total amount of tokens sold on the bonding curves, min = 20%. totalLockedAmount
total 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.
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 - .