Skip to main content

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; amountOutMin is 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 β€” with retryAfterMs β€” whenever it exceeds the maxSnipeTaxBps you 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 approve itself, 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.

ParameterTypeRequiredDescription
actionstringYes"buy" or "sell"
tokenstringYesToken contract address. mint is accepted as an alias
amountnumber/stringYesAmount to trade (see formats)
denominatedInQuotestring/booleanFor buys"true" when a buy amount is in the pair's quote asset (ETH, USDG, …). denominatedInSol is accepted as an alias
slippagenumberNoSlippage percentage (default: 90)
priorityFeenumberNoPriority fee in gwei per gas (default: 0.05). Robinhood Chain orders by arrival, not by fee β€” a bigger tip does not help
deadlinenumberNoSeconds until the swap expires (default: 60)
amountOutMinstringNoAn explicit floor in base units. Overrides the price-derived one
maxSnipeTaxBpsnumberNoThe 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​

ErrorRoot CauseSolution
API key required. Pass ?api-key=YOUR_KEY or X-Api-Key header.No key on the requestAdd the key
Invalid or deactivated API keyUnknown key, or deactivated from the dashboardCheck the key; a deactivated key cannot be revived
Insufficient ETH for gas: need X ETH, have Y ETHThe wallet cannot cover value + gas (for both transactions when an approve is needed)Fund the wallet
No known route for this tokenNot a PONS token, or a graduated one whose pool PumpDev has not seen tradeVerify 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 foundSelling from a wallet that holds noneBuy first, or check the address
Price unavailable β€” pass amountOutMin explicitlyA 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 sentSleep retryAfterMs and retry, raise maxSnipeTaxBps, or pass amountOutMin to buy anyway
maxSnipeTaxBps must be an integer from 0 to 10000Not whole basis points700 for 7%
Token has graduated and its pool route is not known yetThe curve is done and the pool route has not been observedRetry 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 serverThis deployment offers trade-local onlyUse 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 LightningPONS LightningWhy
https://pumpdev.io/api/trade-lightninghttps://rhc.pumpdev.io/api/trade-lightningDifferent chain, same shape
minttoken (mint accepted as an alias)EVM tokens are contracts
denominatedInSoldenominatedInQuote (denominatedInSol accepted)The quote asset is often not ETH
signature in the responsehashAn EVM transaction hash
priorityFee in SOLpriorityFee in gwei per gasEVM prices gas per unit β€” and on this chain a bigger tip buys nothing
One transaction alwaysapprovalHash on a wallet's first sell of a tokenERC-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​