Jito bundles
Up to 5 transactions that land together, all or nothing; up to 16 buyers with lookup tables.
Send an array of up to 5 trade objects instead of one. You get back a list of transactions, one per object, in the same order. Sign each with its wallet, then send them together with POST /api/sol/bundle. They land in the same block, in order, or not at all.
The first object's
priorityFee is paid as the Jito tip (that is what makes a bundle land). Priority fees on the other objects are ignored.Launching with buyers? Put the
create first and the buys of the same mint after it. Each buy is priced on the curve exactly as it will be at that point in the bundle (after the dev buy and the buys before it), so the amounts match what lands. A bundle is the create plus up to 4 buyers.Add ?format=json to get { transactions: [{ transaction, expected: { tokens, sol }, feeSol, mint, action }] } instead of a bare list: handy for showing each wallet how many tokens it will get.
Need more than 4 buyers in the block? See Lookup tables: a buyers entry puts several wallets in one transaction, for about 16 per bundle.
POSThttps://api.trenchytools.lol/api/sol/trade-local
Example: launch + 2 buyers
JavaScript
const txs = await fetch(`${BASE}/api/sol/trade-local?api-key=${API_KEY}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify([
{ publicKey: dev.publicKey.toBase58(), action: 'create', mint: mint.publicKey.toBase58(),
tokenMetadata: { name: 'My Coin', symbol: 'MYC', uri: metadataUri },
amount: 0.5, denominatedInSol: 'true', slippage: 10, priorityFee: 0.002, pool: 'pump' },
{ publicKey: buyer1.publicKey.toBase58(), action: 'buy', mint: mint.publicKey.toBase58(),
amount: 0.3, denominatedInSol: 'true', slippage: 25, priorityFee: 0, pool: 'pump' },
{ publicKey: buyer2.publicKey.toBase58(), action: 'buy', mint: mint.publicKey.toBase58(),
amount: 0.3, denominatedInSol: 'true', slippage: 25, priorityFee: 0, pool: 'pump' },
]),
}).then((r) => r.json()) // [base58, base58, base58]
const signed = txs.map((b58, i) => {
const tx = VersionedTransaction.deserialize(bs58.decode(b58))
tx.sign(i === 0 ? [dev, mint] : [[buyer1, buyer2][i - 1]])
return bs58.encode(tx.serialize())
})
const { bundleId } = await fetch(`${BASE}/api/sol/bundle?api-key=${API_KEY}`, {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ transactions: signed }),
}).then((r) => r.json())
console.log('bundle', bundleId)
Response
Response
["4hX9…base58…", "2kPq…base58…", "9wLm…base58…"]