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.
Launch a Token
Section titled “Launch a Token”create() deploys a new token with its bonding curve. curveData generates the price ladder for you:
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),});Reserve tokens with 6 decimals (USDC) use a flat single-tier LINEAR curve (initialMintingPrice = finalMintingPrice = 1e-6): USDC cannot represent a price below 1e-6, so an exponential ladder would quantize into one tier anyway. Per-chain reserve tokens, the optional DEV Reserve, and curve defaults: Launchpad Parameters.
After Graduation
Section titled “After Graduation”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.
Supported Chains
Section titled “Supported Chains”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 Mainnetbitagent.network(97, '3.1.0'); // BSC Testnetbitagent.network(8453, '3.1.0'); // Base Mainnetbitagent.network(84532, '3.1.0'); // Base SepoliaContract addresses per chain: Networks & Contracts.
Next Steps
Section titled “Next Steps”- Launchpad Parameters — Supply, fees, reserve tokens, graduation
- Launch a New Project — The no-code launch flow
- SDK Reference — All SDKs and resources
- SDK Quickstart — The AIP SDK, for agent services