PONS Lightning Trading API: One-Call Buy & Sell on Robinhood Chain
The PONS Lightning API buys and sells ponsfamily.com tokens on Robinhood Chain in one HTTP call. No signing, no RPC, no nonce bookkeeping, no approve(): PumpDev holds a wallet for your API key, builds the trade, signs it and sends it to the sequencer, and you get the transaction hash back. It is the fastest way to put a PONS trading bot or sniper bot live, and the custodial twin of the non-custodial PONS Trading API.
API Endpoint: POST https://rhc.pumpdev.io/api/trade-lightning?api-key=YOUR_KEY
Get a key on the setup page β one click, or import a private key. The key may also be sent as an X-Api-Key header.
Why Use PONS Lightningβ
Robinhood Chain produces a block every ~100 ms and orders transactions by arrival, not by fee. There is no priority auction to win; the only edge is how quickly a valid transaction reaches the sequencer. Lightning removes every step between your decision and that transaction:
- One round trip. Your request arrives, the trade leaves for the sequencer from the same server. No RPC, no local signing, no transaction to ship back and forth.
- Tradeable from the launch block. A PONS token's route and price are derived from its bonding curve the moment its launch confirms β no waiting for someone else to trade it first.
- Priced from the curve, not from history. A token still on its curve is quoted from its own reserves, price impact included;
amountOutMinis a real floor, and a trade with no floor is refused rather than built. - The snipe-tax window is refused for you. Every PONS curve taxes buys up to 99% in the first 3 seconds after launch (99% β 6.18% β 0.19% β 0, one step per second). Lightning reads the rate for your wallet and answers
425β withretryAfterMsβ whenever it exceeds themaxSnipeTaxBpsyou set (default 0), instead of signing a trade that hands your ETH to the curve. A tax within your ceiling is priced in and built, and checking it costs no extra request. See The snipe tax. - Nonce and approvals handled. Back-to-back trades are numbered by the server; a first sell sends its
approveitself, with the swap right behind it. - Any language. It is a JSON POST β Python, Go, a shell script and a spreadsheet macro all qualify.
Commission is 1% per trade, against 0.5% on the non-custodial endpoint: the difference pays for custody, signing and sending. Keys are encrypted at rest and can be deactivated from your account at any moment.
Request Parametersβ
The body is the trade-local body without publicKey β the wallet comes from the key.
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | "buy" or "sell" |
token | string | Yes | Token contract address. mint is accepted as an alias |
amount | number/string | Yes | Amount to trade (see formats) |
denominatedInQuote | string/boolean | For buys | "true" when a buy amount is in the pair's quote asset (ETH, USDG, β¦). denominatedInSol is accepted as an alias |
slippage | number | No | Slippage percentage (default: 90) |
priorityFee | number | No | Priority fee in gwei per gas (default: 0.05). Robinhood Chain orders by arrival, not by fee β a bigger tip does not help |
deadline | number | No | Seconds until the swap expires (default: 60) |
amountOutMin | string | No | An explicit floor in base units. Overrides the price-derived one |
maxSnipeTaxBps | number | No | The highest PONS snipe tax, in basis points, a buy may be signed with (default: 0 β any tax is refused with 425). 700 accepts the 6.18% step, 20 only the 0.19% one. See The snipe tax |
gasLimit and nonce are not accepted: the server estimates gas and manages the wallet's nonce.
Amount Formatsβ
Buy β 0.01 with denominatedInQuote: "true" = buy with 0.01 of the quote asset.
Sell β "100%" sells everything, "50%" half, "1000000" an exact token amount (in whole tokens).
Responseβ
{
"hash": "0xβ¦",
"approvalHash": null,
"token": "0xβ¦",
"action": "buy",
"publicKey": "0xYourWallet",
"quote": {
"quoteAsset": { "address": "0x000β¦000", "symbol": "ETH", "decimals": 18 },
"amountIn": "10000000000000000",
"expectedOut": "β¦",
"amountOutMin": "β¦",
"priceSource": "curve",
"priceAgeMs": 0,
"snipeTaxBps": 0,
"snipeTaxEndsAt": null,
"routeSource": "registry"
},
"fee": { "bps": 100, "amount": "100000000000000", "asset": "ETH" }
}
hash is returned before the transaction is on the network β the same contract as signature on Solana Lightning. Confirm it yourself with eth_getTransactionReceipt (blocks are ~100 ms apart, so a receipt is usually there within a second).
approvalHash is set when this was the wallet's first sell of a token: an unlimited approve is sent first, the swap follows with the next nonce. Later sells of the same token are one transaction.
quote is the same block trade-local returns. A token still on its bonding curve is priced from the curve's own reserves (priceSource: "curve", price impact included, available from the launch block); a graduated token from its Uniswap v4 pool (priceSource: "pool", exact, fees and price impact included), falling back to its last executed trade (feed / logs, priceAgeMs old) when the pool cannot be read. See the trade-local reference for every field.
Buy Exampleβ
const res = await fetch('https://rhc.pumpdev.io/api/trade-lightning?api-key=YOUR_KEY', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
action: 'buy',
token: '0xTokenAddress',
amount: 0.01,
denominatedInQuote: 'true',
slippage: 30,
}),
});
const { hash } = await res.json();
console.log('Buy sent:', hash);
Sell Examplesβ
// Sell everything
body: JSON.stringify({ action: 'sell', token: '0xTokenAddress', amount: '100%' })
// Sell half
body: JSON.stringify({ action: 'sell', token: '0xTokenAddress', amount: '50%' })
Automated Bot Exampleβ
A launch is tradeable the moment it is confirmed, but the curve taxes buys for
the first 3 seconds, so the bot below sleeps for the retryAfterMs a 425
carries and builds again β usually one retry β and treats every other error as
final. With maxSnipeTaxBps: 700 the 6.18% and 0.19% steps are accepted and
priced in; only the 99% launch second is refused. Leave the field out to wait
for a clean curve.
import WebSocket from 'ws';
const API_KEY = 'YOUR_KEY';
const BUY_AMOUNT_ETH = 0.005;
let busy = false;
async function buy(token) {
for (let attempt = 0; attempt < 8; attempt++) {
const res = await fetch(`https://rhc.pumpdev.io/api/trade-lightning?api-key=${API_KEY}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
action: 'buy',
token,
amount: BUY_AMOUNT_ETH,
denominatedInQuote: 'true',
slippage: 20,
maxSnipeTaxBps: 700, // pay up to 7% tax; the 99% launch second is still refused
}),
});
const out = await res.json();
if (res.status !== 425) return out; // built and sent, or a real error
console.log(`snipe tax ${out.snipeTaxBps} bps β ends at ${out.snipeTaxEndsAt}`);
await new Promise((r) => setTimeout(r, out.retryAfterMs ?? 500));
}
return { error: 'snipe tax never cleared' };
}
const ws = new WebSocket('wss://rhc.pumpdev.io/ws');
ws.on('open', () => ws.send(JSON.stringify({ method: 'subscribeNewToken' })));
ws.on('message', async (raw) => {
const event = JSON.parse(raw.toString());
if (event.type !== 'newToken' || event.status !== 'confirmed' || busy) return;
busy = true;
try {
const out = await buy(event.token);
console.log(out.hash ? `bought ${event.symbol}: ${out.hash}` : `error: ${out.error}`);
} finally {
busy = false;
}
});
Error Handlingβ
| Error | Root Cause | Solution |
|---|---|---|
API key required. Pass ?api-key=YOUR_KEY or X-Api-Key header. | No key on the request | Add the key |
Invalid or deactivated API key | Unknown key, or deactivated from the dashboard | Check the key; a deactivated key cannot be revived |
Insufficient ETH for gas: need X ETH, have Y ETH | The wallet cannot cover value + gas (for both transactions when an approve is needed) | Fund the wallet |
No known route for this token | Not a PONS token, or a graduated one whose pool PumpDev has not seen trade | Verify the address. A PONS token still on its bonding curve is routed at any age, from the token contract itself; a graduated token launched before PumpDev's window needs one trade to be observed |
No token balance found | Selling from a wallet that holds none | Buy first, or check the address |
Price unavailable β pass amountOutMin explicitly | A graduated token whose pool could not be read and with no recent trade to price from, or one whose recent trades were in a different asset than the route pays in (ETH and WETH count as the same asset) | Pass amountOutMin |
Snipe tax of N bps applies to buys this soon after launch⦠(HTTP 425) | The token launched under 3 seconds ago and the tax exceeds your maxSnipeTaxBps (default 0); nothing was signed or sent | Sleep retryAfterMs and retry, raise maxSnipeTaxBps, or pass amountOutMin to buy anyway |
maxSnipeTaxBps must be an integer from 0 to 10000 | Not whole basis points | 700 for 7% |
Token has graduated and its pool route is not known yet | The curve is done and the pool route has not been observed | Retry in a moment |
Gas estimation failed: β¦ | The swap would revert (route, amounts, allowance) | Read the reason; retry with wider slippage or a smaller amount |
Lightning is not configured on this server | This deployment offers trade-local only | Use trade-local |
Porting a Solana Lightning Botβ
A bot written against pump.fun Lightning works here with the URL changed and one unit checked:
| Solana Lightning | PONS Lightning | Why |
|---|---|---|
https://pumpdev.io/api/trade-lightning | https://rhc.pumpdev.io/api/trade-lightning | Different chain, same shape |
mint | token (mint accepted as an alias) | EVM tokens are contracts |
denominatedInSol | denominatedInQuote (denominatedInSol accepted) | The quote asset is often not ETH |
signature in the response | hash | An EVM transaction hash |
priorityFee in SOL | priorityFee in gwei per gas | EVM prices gas per unit β and on this chain a bigger tip buys nothing |
| One transaction always | approvalHash on a wallet's first sell of a token | ERC-20 needs an allowance |
The WebSocket carries both field names too, so the bot above and its pump.fun original read the same events.
Frequently Asked Questionsβ
Do I need an API key for the PONS Lightning API?β
Yes β the key is the wallet. Create one on the setup page or import a private key; the server signs with that wallet on every request. If you would rather keep your keys, the PONS Trading API needs no key at all.
Can I snipe PONS launches with Lightning?β
Yes, from the block the launch confirms β but the first second is not worth having. Every PONS curve taxes buys 99% in the launch second, then 6.18%, then 0.19%, then 0, one step per second of block time; the creator's own wallets are exempt. Lightning refuses a buy whose tax exceeds your maxSnipeTaxBps (default 0) with 425, snipeTaxBps and retryAfterMs rather than paying it, and signs one whose tax is within the ceiling, priced in β the same "fire once the tax is under X%" knob a tax-trigger sniper has, at no extra request. The bot example above sleeps on retryAfterMs; nothing is signed or sent meanwhile.
What does Lightning cost on Robinhood Chain?β
1% of each trade, taken in the quote asset, plus the chain's gas paid from the wallet β roughly 0.00002 ETH per swap at measured base fees. Details on the pricing page.
How do I withdraw from a Lightning wallet?β
Import the privateKey you were shown at creation into any EVM wallet on Robinhood Chain (chain ID 4663) and send from there. PumpDev never holds anything you cannot move yourself. Keep that key: it is shown once.
Which quote assets are supported?β
All of them β ETH, USDG and tokenized equities. amount on a buy is in the pair's quote asset, read from the route with its decimals, so 0.01 means 0.01 ETH on an ETH pair and one cent on a USDG pair. An ERC-20 quote gets its approval sent for you on the first buy.
How fast is a Lightning trade?β
Measured end to end on the live chain, a build lands in about 200 ms once the token's route is warm; the send to the sequencer follows from the same process. Warm your own connection with GET /api/health at startup so the first trade does not pay for a TLS handshake.
Next Stepsβ
- PONS Lightning Setup β create or import a wallet
- PONS Lightning Create β launch a token in one call
- PONS Trading API β client-side signing
- PONS WebSocket β launches and trades in real time
- Fees
- PONS API overview β feed, trading and launches on Robinhood Chain
- Explorer: rh-scan.com β confirm any
hashthis API returns