Skip to main content

Laser Trade

POST /v1/trades/execute

Executes a Pump or PumpSwap trade from a SolanaLaser-managed wallet.

You do not sign transactions and do not send private keys. SolanaLaser authenticates the API key, loads the selected managed wallet, decrypts the wallet key in memory, builds the Pump/PumpSwap instructions, simulates, submits through Helius Sender, and returns the transaction signature.

Request

{
"action": "buy",
"mint": "TOKEN_MINT",
"pool": "OPTIONAL_PUMPSWAP_POOL",
"amount": 0.1,
"denominated_in_sol": true,
"slippage": 2,
"simulate": true,
"measure_timing": false,
"wallet": "OPTIONAL_MANAGED_WALLET_PUBLIC_KEY",
"confirm": true
}

Fields

FieldTypeRequiredNotes
action"buy" or "sell"YesTrade direction. Alias: side.
mintstringYesToken mint. Used for bonding-curve routing and automatic PumpSwap pool_v2 lookup. Alias: token_mint.
poolstringNoExplicit PumpSwap pool. If present, routing is skipped and the trade goes to this pool.
amountnumber or stringYesHow much to trade — see Amount Rules. Sell amounts also accept a percentage such as "50%" or "100%".
denominated_in_solbooleanNoDefaults to true for buys and false for sells. Set it only for exact-token buys. Aliases: denominatedInSol; also accepts "true"/"false" strings.
slippagenumber or stringNoPercentage, default 2, maximum 50. For example, slippage: 5 means 5%.
slippage_bpsintegerNoBackward-compatible basis-points field. Do not send it together with slippage. Alias: slippageBps.
simulatebooleanNoDefaults to true. Set false to skip pre-submit simulation and use a 400,000 CU limit for lower latency. A failed on-chain transaction can still consume fees.
measure_timingbooleanNoDefaults to false. Set true only when diagnosing latency; the response then includes timing_ms. Alias: measureTiming.
walletstringNoManaged wallet public key. If omitted, the account default wallet is used, then the first active wallet.
confirmbooleanNoDefaults to true. Polls signature status up to 90 seconds. Set false to return right after submission.

Routing

SolanaLaser chooses the trade venue with these rules:

  1. If pool is provided, use that PumpSwap pool.
  2. Otherwise the server fetches the Pump bonding curve for mint.
  3. If the curve is incomplete, trade on the bonding curve.
  4. If the curve is complete (the token graduated), derive PumpSwap pool_v2(mint) and trade there.

Two on-chain constraints are enforced for you: bonding-curve mints must be Token-2022 (all current Pump launches are), and only SOL-quoted PumpSwap pools are supported.

Amount Rules

Buy With SOL

{
"action": "buy",
"mint": "TOKEN_MINT",
"amount": 0.1
}

amount is a decimal SOL amount (up to 9 decimal places), and denominated_in_sol defaults to true. 0.1 means 0.1 SOL.

Buy Exact Token Amount

{
"action": "buy",
"mint": "TOKEN_MINT",
"amount": 1000000000,
"denominated_in_sol": false
}

amount is an integer in token atomic units. For a 6-decimal Pump token, 1000000000 equals 1000 tokens. Only available while the token is on the bonding curve — PumpSwap buys must be SOL-denominated.

Sell Tokens

{
"action": "sell",
"mint": "TOKEN_MINT",
"amount": 1000000000,
"denominated_in_sol": false
}

Sells use token atomic units by default. A SOL-denominated sell is rejected with 400.

Sell a Percentage of the Wallet Balance

{
"action": "sell",
"mint": "TOKEN_MINT",
"amount": "50%",
"denominated_in_sol": false
}

The server reads the selected managed wallet's associated token account and resolves "50%" at execution time. Values from greater than 0% through 100% are accepted.

Examples

Buy, Auto-Routed

const trade = await solanaLaser("/v1/trades/execute", {
action: "buy",
mint: "TOKEN_MINT",
amount: 0.1, // SOL
slippage: 3,
});

console.log(`Bought via ${trade.venue}: https://solscan.io/tx/${trade.signature}`);

Sell From a Specific Wallet, No Confirmation Wait

const trade = await solanaLaser("/v1/trades/execute", {
action: "sell",
mint: "TOKEN_MINT",
amount: "2500000000000", // token atomic units, as a string
denominated_in_sol: false,
wallet: "MANAGED_WALLET_PUBLIC_KEY",
confirm: false,
});
// trade.confirmed === false; poll the signature yourself if needed

PumpSwap With Explicit Pool

const trade = await solanaLaser("/v1/trades/execute", {
action: "buy",
pool: "PUMPSWAP_POOL_ADDRESS",
mint: "TOKEN_MINT",
amount: 0.1,
});

Response

{
"wallet": "MANAGED_WALLET_PUBLIC_KEY",
"action": "buy",
"mint": "TOKEN_MINT",
"amount": "0.1",
"amount_units": 100000000,
"denominated_in_sol": true,
"signature": "TRANSACTION_SIGNATURE",
"confirmed": true,
"confirmation_status": "confirmed",
"venue": "bonding_curve",
"pool": null,
"expected_output": "123456789"
}

Response Fields

FieldMeaning
walletManaged wallet that signed and paid transaction fees.
actionbuy or sell, echoed back.
mintToken mint traded (resolved from the pool if you passed one).
amountYour requested amount, as text.
amount_unitsThe same amount in base units — lamports for SOL-denominated buys, token atomic units otherwise.
denominated_in_solEcho of the request flag.
signatureSubmitted transaction signature.
confirmedWhether confirmation polling saw the transaction land.
confirmation_statusprocessed, confirmed, or finalized when confirmed; null with confirm: false.
venuebonding_curve or pumpswap — where the trade routed.
poolPumpSwap pool used, when venue is pumpswap.
expected_outputThe slippage bound from the quote, in base units as a string: minimum tokens out for a SOL-in buy, maximum SOL in for a token-out buy, minimum SOL out for a sell.

Operational Notes

  • Every trade is simulated before submission; a failing simulation is a 400 with the on-chain error, and nothing is sent. Set simulate: false only when speed matters more than that pre-submit protection.
  • Priority fees are fetched live per trade (Helius getPriorityFeeEstimate, "High" level), and a Sender tip (0.0002 SOL minimum) is appended automatically. The managed wallet pays both plus network fees.
  • A confirmation timeout is a 502 — the transaction may still land, so check the signature before retrying a buy.
  • If the bonding curve completes between routing and execution (a token graduating mid-request), you get a 400 asking you to retry; the retry routes to PumpSwap.
  • Every execution is recorded server-side with its signature and status, including confirm: false trades, so there's always an audit trail.