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
| Field | Type | Required | Notes |
|---|---|---|---|
action | "buy" or "sell" | Yes | Trade direction. Alias: side. |
mint | string | Yes | Token mint. Used for bonding-curve routing and automatic PumpSwap pool_v2 lookup. Alias: token_mint. |
pool | string | No | Explicit PumpSwap pool. If present, routing is skipped and the trade goes to this pool. |
amount | number or string | Yes | How much to trade — see Amount Rules. Sell amounts also accept a percentage such as "50%" or "100%". |
denominated_in_sol | boolean | No | Defaults to true for buys and false for sells. Set it only for exact-token buys. Aliases: denominatedInSol; also accepts "true"/"false" strings. |
slippage | number or string | No | Percentage, default 2, maximum 50. For example, slippage: 5 means 5%. |
slippage_bps | integer | No | Backward-compatible basis-points field. Do not send it together with slippage. Alias: slippageBps. |
simulate | boolean | No | Defaults 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_timing | boolean | No | Defaults to false. Set true only when diagnosing latency; the response then includes timing_ms. Alias: measureTiming. |
wallet | string | No | Managed wallet public key. If omitted, the account default wallet is used, then the first active wallet. |
confirm | boolean | No | Defaults 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:
- If
poolis provided, use that PumpSwap pool. - Otherwise the server fetches the Pump bonding curve for
mint. - If the curve is incomplete, trade on the bonding curve.
- 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
| Field | Meaning |
|---|---|
wallet | Managed wallet that signed and paid transaction fees. |
action | buy or sell, echoed back. |
mint | Token mint traded (resolved from the pool if you passed one). |
amount | Your requested amount, as text. |
amount_units | The same amount in base units — lamports for SOL-denominated buys, token atomic units otherwise. |
denominated_in_sol | Echo of the request flag. |
signature | Submitted transaction signature. |
confirmed | Whether confirmation polling saw the transaction land. |
confirmation_status | processed, confirmed, or finalized when confirmed; null with confirm: false. |
venue | bonding_curve or pumpswap — where the trade routed. |
pool | PumpSwap pool used, when venue is pumpswap. |
expected_output | The 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
400with the on-chain error, and nothing is sent. Setsimulate: falseonly 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
400asking you to retry; the retry routes to PumpSwap. - Every execution is recorded server-side with its signature and status,
including
confirm: falsetrades, so there's always an audit trail.