Trading API
Overview
Buy, sell, deposit and withdraw on GUM from your own code, with a Solana or EVM wallet as your account.
Base URL:
https://api.gum.ag/app/v1For devnet, use https://dev-api.gum.ag/app/v1. Its OpenAPI spec is
https://dev-api.gum.ag/app/v1/openapi.json. Examples and the playground
use production.
How a trade works
- Quote.
POST /v1/swap/quotewith what you want to buy or sell. You get the price, the minimum you’ll receive, and amessageto sign. - Sign. Sign
messagewith your wallet: Ed25519 for a Solana key,personal_signfor an EVM key. You send only the signature, and the API turns it into a GUM Network typed signature. See Sign with your wallet. - Submit.
POST /v1/swapwith the quote’stransactionand yoursignature. You get anid. - Track. Poll
GET /v1/swap/{id}, or stream/v1/swap/{id}/events, untilfinalistrue. See Track status.
Withdrawals follow the same steps with /v1/withdraw/quote and
/v1/withdraw. GUM Perps uses the same quote → sign → submit flow under
/v1/perps/*: margin deposits, withdrawals and leverage updates sign a GUM
Network transaction and settle on-chain (status: "completed", final: true),
while Perps orders and cancels sign serialized action bytes (in Solana browser
wallets, sign the decoded message with
signMessage instead of
signTransaction) and return a matching-engine acknowledgement
(status: "accepted", final: false; check GET /v1/perps/accounts/{address}
for live positions and open orders). A quote lasts about 30 seconds, so sign
and submit right away.
Endpoints
Spot & account
| Endpoint | What it does |
|---|---|
GET /v1/tokens | Find tokens and stocks you can trade |
GET /v1/balances/{address} | Your USD and token balances |
GET /v1/deposit-addresses/{address} | Where to send funds, per chain |
GET /v1/history/{address} | Deposits, swaps and withdrawals |
POST /v1/swap/quote | Quote a buy or a sell |
POST /v1/swap | Submit a signed quote |
GET /v1/swap/{id} | A trade’s status, polled or streamed |
POST /v1/withdraw/quote | Quote a withdrawal |
POST /v1/withdraw | Submit a signed withdrawal |
GET /v1/withdraw/{id} | A withdrawal’s status, polled or streamed |
GET /v1/chains | Supported chains and their dollar tokens |
GUM Perps
| Endpoint | What it does |
|---|---|
GET /v1/perps/markets | Markets, live hourly & annualized funding, fees and tiers |
GET /v1/perps/markets/{symbol}/orderbook | L2 orderbook bids and asks |
GET /v1/perps/markets/{symbol}/funding-history | Historical hourly funding rates and average APR |
GET /v1/perps/accounts/{address} | Sub-accounts, margin balances, open positions & open orders |
POST /v1/perps/deposit/quote / POST /v1/perps/deposit | Transfer USD from GUM spot into a Perps sub-account (free) |
POST /v1/perps/withdraw/quote / POST /v1/perps/withdraw | Transfer free USD margin back to GUM spot (free) |
POST /v1/perps/leverage/quote / POST /v1/perps/leverage | Set leverage for a market (cross or isolated) |
POST /v1/perps/orders/quote / POST /v1/perps/orders | Quote and place market, limit or post-only Perps orders |
POST /v1/perps/orders/cancel/quote / POST /v1/perps/orders/cancel | Cancel one open order or all open orders in a market |
GET /v1 lists them all, and GET /v1/openapi.json is the OpenAPI 3.1 spec.
Conventions
- Accounts.
addresstakes a Solana address or an EVM0xaddress, and each wallet is its own GUM account. Accounts that sign in with Google, Apple, X or a passkey can’t trade through the API; use the GUM app for those. - Amounts are decimal strings in whole units:
"25"is $25 and"0.5"is half a token. The API never rounds an amount for you. - USD is your GUM cash balance. Buys spend it and sells add to it.
- Errors always look like
{ "error": { "code", "message" } }. Branch oncode; see Errors and limits.
Strategy market data and portfolio tracking
Use GET /v1/strategies/opportunities for ranked cross-venue pairs and GET /v1/strategies/funding-scanner for current funding on individual markets. Both return updatedAt in milliseconds. The Single scanner returns GUM and Hyperliquid perpetuals. A missing quote or unmatched venue has a null value. Market reads are public.
GET /v1/strategies/position-links returns active tracking intervals for the signing account. Add ?includeArchived=true to include earlier intervals. Each link identifies the GUM account, Hyperliquid hedge address, market, side and tracking dates. An interval alone cannot establish current fills or equity.
gumag strategies opportunities list
gumag strategies funding list
gumag strategies position-links list --include-archivedThe CLI signs private reads locally. SDK callers use getSignedHeaders with GET, the exact /v1/strategies/position-links path including any query, and an empty body. Use the service path without the public gateway prefix /app. Send the returned X-Signature, X-Signature-Type, X-Timestamp and X-Public-Key headers within one minute.