Docs / Developer API
Concepts
Six things to know before the first request.
Stages and venues
seed: Just planted. Fewer than 10 buys. Venue curve.sapling: Climbing the curve. Trades on pump.fun's bonding curve. Venue curve.orchard: Graduated to PumpSwap. The curve completed and pump.fun moved the liquidity to a PumpSwap pool. Venue pool.The builders read the venue from chain when they build, never from the index, so a coin that graduated a second ago is bought on its pool. A coin's graduation block says when its curve completed and when it moved.
Amounts
Every amount is an integer in base units, sent as a decimal string. No floats anywhere: parse them with BigInt.
| Asset | Decimals | Example |
|---|---|---|
| ZEC | 8 | "25000000" is 0.25 ZEC |
| Coins | 6 | "1000000" is one token |
| SOL | 9 | "200000000" lamports is 0.2 SOL |
Prices are priceZecE9: ZEC base units per whole token, times 109, so a price far below one base unit keeps its digits. "31200000000" is 31.2 base units per token, 0.000000312 ZEC.
const zecPerToken = Number(BigInt(coin.priceZecE9)) / 1e9 / 1e8; // for display only
const zec = (BigInt(tokens) * BigInt(coin.priceZecE9)) / 10n ** 15n; // ZEC base units for `tokens` base unitsTimes are ISO 8601 in UTC; candle times are unix seconds.
The fee split
Every coin pays a 2.00% creator fee on every trade, in ZEC. It splits the same way whoever built the trade:
| To | Of the creator fee | Of each trade |
|---|---|---|
| LP: $SAPLING/ZEC liquidity, its LP tokens burned | 25% | 0.50% |
| Rootstock: $SAPLING bought back and burned | 25% | 0.50% |
| Treasury | 10% | 0.20% |
| The deployer's choice | 40% | 0.80% |
A coin planted on Raydium LaunchLab (venue: "launchlab") pays a transfer tax instead, in ZEC: 2% to Sapling in four 0.50% parts ($SAPLING bought and burned, the protocol's $SAPLING/ZEC pool, the flywheel, the treasury), plus the deployer's 0%, 1%, 2%, 3% on top. It graduates to its own Raydium CPMM pool, its liquidity locked for good with Burn & Earn. LaunchLab coins.
How it is enforced. A Sapling coin's creator on pump.fun is not a wallet: it is the coin's CoinAuthority, a program address (["coin-authority", mint]) under Sapling's vault program. So pump.fun pays the creator fee of every trade, made from anywhere (sapling.cash, this API, Jupiter, a bot, pump.fun's own page), into Sapling's program, and the program splits it. Each destination is fixed in the program's config; anyone can run the split.
No integrator cut. There is no referral and no fee field. A coin planted or traded through the API pays exactly what one planted on sapling.cash pays. pump.fun charges its own protocol fee on top, as on any pump.fun coin.
The deployer's share
The planter chooses where the 40% goes, once, in the planting itself:
me: the wallet that plants the coin.wallet:<address>: another wallet. That wallet controls the share from the start.holders: holder rewards. Sapling pays every holder with $20 or more on every run; holders claim nothing. Permanent.
Only the current payee can change it later: to another wallet, or to holder rewards for good. Whoever builds the planting chooses the payee, so check it before you sign: why the payee matters.
Unsigned transactions
Every builder answers transactions with empty signature slots. Sapling's servers sign nothing and hold no key of yours, so a breach of the API cannot move anyone's funds.
- Your user's wallet signs, and shows what the transaction does before it is approved.
- A planting's mint key is made on your side (the SDK does it). The API sees only its public key. Once the planting lands the key has no power left: pump.fun holds the mint authority, and the payee can be declared only once.
- Before signing, you can check every transaction against your own request, locally, without trusting the API: verify before you sign.
A Zcash account's read token
A Zcash account's own reads (its pending orders, its activity, and its orders and receipts in full) open with its read token: rt1. followed by base64url characters. It opens that one account's reads and nothing else; it cannot sign, trade or move anything.
- Who gets one. Only a device that holds the account's passkey. Sapling's signing frame (
keys.sapling.cash) receives one when the account is found with your passkey, when it is created, and with every sale, collect or setting its passkey approves; the Sapling Wallet receives it when it connects the account. No API route issues one, and no API key opens an account's reads. - How long. 90 days from when it was issued. Each of the moments above hands out a fresh one. An expired token counts as none.
- What it opens.
GET /v1/accounts/{W}and/activityof its own account, andGET /v1/orders/{orderHash}andGET /v1/receipts/{orderHash}of that account's orders. A token of another account counts as none. - How to send it. In the
x-sapling-account-tokenheader, never in a URL.Authorizationstays for your API key; send both if you have both. A value that is not a read token answers 400invalid_param. - Keep it like a password. Answers opened by a token are never cached (
cache-control: no-store). A wallet keeps it in sealed storage or the Keychain.
Optional today. Every read answers the same without it. Once Sapling requires it (announced in the changelog first), a read without it answers as a private account's: pending left out, /activity listing nothing with private: true, and an order or a receipt by its hash answering its state only (orderHash, state, private: true; no account, no bounds).
const sapling = new Sapling();
const account = await sapling.accounts.get(w, { token }); // the token from the account's own device
const order = await sapling.order(orderHash, { token });
if (isStateOnly(order)) console.log(order.state); // read without the account's token: its state only