unbound

SDK

@unbound/sdk is the TypeScript library the app itself uses: it turns launch settings into a Meteora config, builds and sends transactions, and reads launches. It's built on Solana Kit; Meteora's own SDK (web3.js) stays inside it.

The SDK lives in Unbound's repository and isn't published on npm yet. These pages describe it for people working with the code.

Set up

import { createUnbound, UNBOUND_PARTNER } from "@unbound/sdk";

const unbound = createUnbound({ rpcUrl: "https://your-mainnet-rpc", partner: UNBOUND_PARTNER });

Functions that send transactions take a Kit client with an identity (the signer) and sendTransaction, such as one built with @solana/kit-plugin-rpc and a wallet or keypair plugin.

Launch a token

import { createLaunch, PRESETS, previewLaunch, validateLaunch } from "@unbound/sdk";

const settings = { ...PRESETS.fairLaunch.settings, firstBuy: 0.5 }; // or build your own LaunchSettings

const problem = validateLaunch(settings, client.identity.address); // Meteora's own checks; null if fine
const preview = previewLaunch(settings); // { quoteToGraduate, tokensSoldOnCurve, curve, perTrade }

const { mint } = await createLaunch(unbound, client, { settings, name: "My Token", symbol: "MYT", uri });

uri points to the token's metadata JSON (the app uploads it to IPFS first).

Read launches

import { getLaunch, getLaunches, listLaunches, launchTerms, currentFeeBps } from "@unbound/sdk";

const launch = await getLaunch(unbound, mint); // null if it isn't an Unbound launch
launch.price; // quote token per whole token
launch.progress; // 0 to 1 toward graduation
launch.curveComplete; launch.migrated;

const rules = launchTerms(launch); // the fee schedule, splits, locks and vesting, from the config
const feeNow = currentFeeBps(launch, Date.now() / 1000);

const all = await listLaunches(unbound); // scans the program: slow on public RPCs
const some = await getLaunches(unbound, pools); // direct reads when you know the pools (e.g. from /api/launches)

Trade

import { buy, chainTime, quote, sell, withSlippage } from "@unbound/sdk";

const q = quote(launch, "buy", 1_000_000_000n, await chainTime(unbound)); // 1 SOL, in lamports
// q.amountOut, q.fee, q.completesCurve (this buy reaches graduation and only fills up to it)

await buy(unbound, client, { launch, amountIn: q.amountIn, minOut: withSlippage(q.amountOut, 100) }); // 1% slippage
await sell(unbound, client, { launch, amountIn: tokens, minOut: withSlippage(sellQuote.amountOut, 100) });

Quote with the chain's clock (chainTime) during an anti-sniper period: a computer's clock can be seconds off, and the fee changes every few seconds. Trades carry Unbound's referral automatically.

Claim fees

import { claimCreatorFees } from "@unbound/sdk";

await claimCreatorFees(unbound, client, { launch }); // client.identity must be the launch's creator

Errors

Transactions fail with Kit errors. dbcErrorMessage(code) turns a Meteora program error code into a readable sentence.