The packages are published on npm as alpha releases, and the surface can still change between versions. Pin an exact version.
Install
The source, the full reference and three runnable examples — a quote reader that checks itself against a live chain, a curve trading bot, and a swap widget — are on GitHub.
What it is
A TypeScript SDK for trading bots and aggregators: quoting and swapping, limit orders, and buying and selling on the launchpad’s bonding curve — plus what doing those well takes: pool and launch discovery, pool and launch state, the tick distribution and live fees for pricing a pool yourself, permits, and the events to follow it all live. Providing liquidity, farming, creating pools and launching tokens are deliberately out: none of them is trading. The contracts are permissionless and the ABIs ship whole, so nothing stops you — it is a statement about what the package supports.The three things to know
Writes return unsigned calls; they do not send. Every builder gives back{ to, data, value, approvals? } — your signer is your own: a wagmi hook, an ethers wallet, a KMS, a Safe proposal. client.send() exists for when a viem WalletClient really is what you have. approvals says what a call needs, not what is outstanding: pendingApprovals asks the chain, and nothing approves maxUint256 unless you ask for it.
The DEX is Uniswap-V3-shaped but not V3-compatible. The events are identical by design, so your indexing works unchanged. The periphery is not: callbacks are lunya*, a route path carries a one-byte pool type where V3 has a three-byte fee, and pools are keyed on a curve rather than a fee tier. Route through this SDK — never a V3 router. Details in DEX Integration.
A launch is its own contract, priced in its own token. One contract is cloned per launch, so the address you call is not the address you hold; the curve is denominated in a quote token, with the native coin as a separate entry point only some launches accept. The buy that fills the curve graduates the launch in the same transaction, and from then on its liquidity lives in an ordinary exchange pool — price it with dex, not launchpad.
Choosing a network
Addresses ship with the package
The registry carries each listed network’s chain metadata and its contract addresses, so naming the network is all it takes to trade. Override any of them — a fork, your own deployment, contracts newer than the version you installed — by passingaddresses to the client, merged over the registry’s, or with deploymentFromEnv() in Node. That function is the only thing in the package that reads process.env, and only because you called it.
A listed deployment says what the addresses were when that version was cut, not what is live this minute: pin the version, or pass your own. The shipped RPC endpoint is public — bring your own transport for anything that matters.
A taste of the surface
now must be block.timestamp, because a clock ahead of the chain sees a smaller surcharge than the contract charges and sizes a minimum that reverts; and pass exempt: true for a recipient the launch exempts, or ask the chain with launchpad.quoteBuyFor.
The ABIs ship generated from the contract build artifacts, so calldata never drifts from what the contracts accept, and explainLunyaError decodes a revert against every custom error in the protocol — including a pool’s, reaching you through the router.