Buy Token
type buy_token — buy an existing coin from your wallet with a SOL amount.
Use POST {regionBase}/submit with "type": "buy_token". Buying is by SOL amount (sol_amount / lamports) and reuses the exact snipe instruction builders, so every quote-token quirk (USDC pump, USD1 launchlab, etc.) is handled on-chain with no extra pool fetch.
Required
| Field | Type | Description |
|---|---|---|
type | string | Must be buy_token |
session_id | string | JWT (or Authorization: Bearer) |
api_key | string | Your encrypted Solana API key (see How to get an API key). The signer/buyer is always the wallet decrypted from this key. |
mint_address | string | Token mint (Solana pubkey) |
sol_amount | number | Amount of SOL to spend (e.g. 0.1). See Buy amount below for alternatives. |
Buy amount
Provide one of the following (checked in this order):
| Field | Type | Description |
|---|---|---|
lamports | integer | Exact lamports to spend. Takes priority if present. |
sol_amount | number | SOL to spend (float). |
buy_amount | number | Alias for sol_amount (used if sol_amount is absent). |
A value that resolves to 0 (or a non-positive sol_amount) is rejected with buy_error.
Optional
| Field | Type | Description |
|---|---|---|
mode | string | Platform routing: pump (default), bonk, ray, usd1 |
quote_token | string | Set to "usdc" for USDC-quoted pump coins — routes an inline Raydium CLMM SOL→USDC swap before the buy. |
creator_wallet | string | Creator pubkey for the coin. Defaults to the buyer if omitted, but you should always pass it from coin-config / vamp data — a wrong creator derives the wrong creator-vault PDA and the buy fails on-chain. |
bonkers_mode | boolean | LaunchLab bonkers pool selector (bonk / ray / usd1) |
locked_mode | boolean | LaunchLab locked-pool selector (bonk / ray / usd1) |
mayhem_mode | boolean | Mayhem path for pump |
slippage_bps | integer | Slippage for the SOL→USDC swap leg of a USDC-quoted pump buy. 0–10000, default 200 (2%). |
bribe_fee_sol | number | Jito-style relay tip in SOL (clamped to the sell-path minimum) |
request_id | string | Opaque id echoed back on buy_success / buy_error so you can correlate responses |
Modes
mode | Quote | Routing |
|---|---|---|
pump | SOL | J7 buy_pumpfun unified router (pre-migration BC, post-migration PumpSwap AMM, cashback pools) |
pump + quote_token: "usdc" | USDC | Inline Raydium CLMM SOL→USDC swap, then buy_exact_quote_in_v2 |
bonk | SOL | LaunchLab buy_exact_in |
ray | SOL | LaunchLab buy_exact_in against the Raydium-launchpad stats account |
usd1 | USD1 | Inline J7 SOL→USD1 CLMM swap, then LaunchLab buy_exact_in priced in USD1 |
stroid and other EVM chains are not supported by buy_token (it's Solana-only). Any other mode returns buy_error.
Full examples
All examples use Content-Type: text/plain;charset=UTF-8 with a JSON string body to skip the CORS preflight OPTIONS request, saving one round-trip.
username in the body is overwritten from the JWT on /submit.
JavaScript (browser extension / fetch)
const BASE = "https://nyc.j7tracker.io/deploy"; // or regional: eu / lax / sgp
const body = JSON.stringify({
type: "buy_token",
session_id: "<jwt>",
api_key: "<encrypted_solana_key>",
mint_address: "MintAddressHere",
sol_amount: 0.1,
mode: "pump",
creator_wallet: "CreatorPubkeyHere",
});
const res = await fetch(`${BASE}/submit`, {
method: "POST",
headers: { "Content-Type": "text/plain;charset=UTF-8" },
body,
});
const data = await res.json();
if (data.type === "buy_success") {
console.log("Bought:", data.signature);
} else {
console.error("Error:", data.error);
}USDC-quoted pump coin:
const body = JSON.stringify({
type: "buy_token",
session_id: "<jwt>",
api_key: "<encrypted_solana_key>",
mint_address: "MintAddressHere",
sol_amount: 0.25,
mode: "pump",
quote_token: "usdc",
creator_wallet: "CreatorPubkeyHere",
slippage_bps: 200,
});Python
import json
import requests
BASE = "https://nyc.j7tracker.io/deploy"
payload = {
"type": "buy_token",
"session_id": "<jwt>",
"api_key": "<encrypted_solana_key>",
"mint_address": "MintAddressHere",
"sol_amount": 0.1,
"mode": "pump",
"creator_wallet": "CreatorPubkeyHere",
}
resp = requests.post(
f"{BASE}/submit",
headers={"Content-Type": "text/plain;charset=UTF-8"},
data=json.dumps(payload),
timeout=35,
)
data = resp.json()
if data.get("type") == "buy_success":
print(f"Bought: {data['signature']}")
else:
print(f"Error: {data.get('error')}")Rust
use reqwest::Client;
use serde_json::{json, Value};
let base = "https://nyc.j7tracker.io/deploy";
let client = Client::new();
let body = json!({
"type": "buy_token",
"session_id": "<jwt>",
"api_key": "<encrypted_solana_key>",
"mint_address": "MintAddressHere",
"sol_amount": 0.1,
"mode": "pump",
"creator_wallet": "CreatorPubkeyHere",
});
let resp = client
.post(format!("{base}/submit"))
.header("Content-Type", "text/plain;charset=UTF-8")
.body(body.to_string())
.timeout(std::time::Duration::from_secs(35))
.send()
.await?;
let data: Value = resp.json().await?;
match data.get("type").and_then(|t| t.as_str()) {
Some("buy_success") => {
println!("Bought: {}", data["signature"]);
}
_ => {
eprintln!("Error: {}", data["error"]);
}
}Responses
Success
{
"type": "buy_success",
"signature": "transaction_signature",
"mint_address": "...",
"sol_amount": 0.1,
"lamports": 100000000,
"wallet_address": "...",
"mode": "pump",
"username": "..."
}Error
{
"type": "buy_error",
"error": "description",
"message": "description",
"mint_address": "...",
"wallet_address": "...",
"mode": "...",
"username": "..."
}If you sent a request_id, it is echoed back on both shapes.
The request may take up to 30 seconds before buy_success or buy_error, otherwise 504 with optional last_status.