Skip to content

Bond SDK (Trading & Launch)

The Bond SDK (@bitagent/sdk) gives programmatic access to the internal market — the bonding curve where every project trades before it graduates. Use it to quote prices, buy and sell tokens, read curve state, and launch new tokens from code.

buy() checks the bond’s allowance for your reserve token and submits an approval first when needed — no separate approve() call in the common path. To pre-approve a larger budget once (and skip the extra prompt on later trades), pass allowanceAmount.


create() deploys a new token with its bonding curve. curveData generates the price ladder for you:

launch.ts
import { bitagent } from '@bitagent/sdk';
const newToken = bitagent
.withPublicClient(publicClient)
.withWalletClient(walletClient)
.network(CHAIN_ID, VERSION)
.token('MYAGENT', creatorAddress); // symbol for a token that doesn't exist yet
await newToken.create({
name: 'My Agent Token',
agentHash: '0x...', // 32-byte agent identifier
reserveToken: {
address: UB_ADDRESS, // see Launchpad Parameters for per-chain reserves
decimals: 18,
},
curveData: {
curveType: 'EXPONENTIAL', // or LINEAR / FLAT / LOGARITHMIC
stepCount: 100,
maxSupply: 10_000_000_000,
initialMintingPrice: 8e-6,
finalMintingPrice: 8e-5,
},
buyRoyalty: 1, // percent — 1 = 1% (the platform default)
sellRoyalty: 1,
onError: (e) => console.error(e),
});

Once a project’s curve fills, it graduates: the bond mints the remaining supply into a DEX pool and the Bond SDK’s buy() / sell() no longer apply. Trading moves to the external market (PancakeSwap on BSC, Uniswap on Base) — route through the DEX from that point on. See Launchpad Parameters.


The bond is deployed on the same networks as the rest of the platform — BSC, Base, and their testnets. Pass the chain ID to .network() and use the matching contract version:

import { bitagent } from '@bitagent/sdk';
bitagent.network(56, '3.1.0'); // BSC Mainnet
bitagent.network(97, '3.1.0'); // BSC Testnet
bitagent.network(8453, '3.1.0'); // Base Mainnet
bitagent.network(84532, '3.1.0'); // Base Sepolia

Contract addresses per chain: Networks & Contracts.