Buy API
POST /submit with type buy_token — buy an existing coin with a SOL amount.
POST {base}/submit with "type": "buy_token". Solana platforms and pons; the buyer is the wallet in api_key.
Required fields
| Field | Type | Notes |
|---|---|---|
type | string | buy_token |
session_id | string | JWT, or Authorization: Bearer |
api_key | string | Encrypted key — Solana, or EVM for pons |
mint_address | string | Token mint / contract |
sol_amount | number | Amount to spend in SOL (ETH on pons). lamports (integer) takes priority; buy_amount is an alias |
Optional fields
| Field | Type | Notes |
|---|---|---|
mode | string | Omit or auto (default): the server reads the mint on-chain and picks the venue — pump curve / PumpSwap, LaunchLab (bonk / ray / stonk), Bags DBC, or the migrated Raydium / Meteora pool. Explicit pump, bonk, ray, usd1, stonk, bags, pons skip that read and build straight from the request |
creator_wallet | string | Only with an explicit mode: the creator pubkey (from /token/coin-config/:mint). Resolved on-chain when absent |
quote_mint | string | Only with an explicit mode on a quoted coin (USDC / PUMP / stock pump, USD1 / stock bonk, StonkFun pair): the quote CA. Auto mode reads it off the pool. quote_token: "usdc" is the legacy label |
config_key | string | Only with mode: "bags": the coin's DBC config key |
slippage_bps | integer | Swap-leg slippage, default 200 (500 on pons) |
mayhem_mode | boolean | Mayhem path for pump |
bonkers_mode, locked_mode | boolean | LaunchLab pool selectors |
bribe_fee_sol | number | Relay tip in SOL |
request_id | string | Echoed back on success / error |
Quoted coins (stock / USDC / USD1 pairs) are bought in one transaction: SOL → quote through the quote's pool route, then the venue's buy leg. batch_buy_token (buys: [{ sol_amount, api_key }], max 10) takes the same fields.
{
"type": "buy_token",
"session_id": "<jwt>",
"api_key": "<encrypted_solana_key>",
"mint_address": "MintAddressHere",
"sol_amount": 0.1
}Success response
{
"type": "buy_success",
"signature": "...",
"mint_address": "...",
"sol_amount": 0.1,
"lamports": 100000000,
"wallet_address": "...",
"mode": "pump"
}Errors are { "type": "buy_error", "error": "…" }; a 0 amount, an EVM mode other than pons, or a mode that is not a Solana launchpad (Buys not supported for … mode) are rejected.