GUM Docs
Open GUM

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:

Text
https://api.gum.ag/app/v1

For 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

  1. Quote. POST /v1/swap/quote with what you want to buy or sell. You get the price, the minimum you’ll receive, and a message to sign.
  2. Sign. Sign message with your wallet: Ed25519 for a Solana key, personal_sign for an EVM key. You send only the signature, and the API turns it into a GUM Network typed signature. See Sign with your wallet.
  3. Submit. POST /v1/swap with the quote’s transaction and your signature. You get an id.
  4. Track. Poll GET /v1/swap/{id}, or stream /v1/swap/{id}/events, until final is true. 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

EndpointWhat it does
GET /v1/tokensFind 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/quoteQuote a buy or a sell
POST /v1/swapSubmit a signed quote
GET /v1/swap/{id}A trade’s status, polled or streamed
POST /v1/withdraw/quoteQuote a withdrawal
POST /v1/withdrawSubmit a signed withdrawal
GET /v1/withdraw/{id}A withdrawal’s status, polled or streamed
GET /v1/chainsSupported chains and their dollar tokens

GUM Perps

EndpointWhat it does
GET /v1/perps/marketsMarkets, live hourly & annualized funding, fees and tiers
GET /v1/perps/markets/{symbol}/orderbookL2 orderbook bids and asks
GET /v1/perps/markets/{symbol}/funding-historyHistorical 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/depositTransfer USD from GUM spot into a Perps sub-account (free)
POST /v1/perps/withdraw/quote / POST /v1/perps/withdrawTransfer free USD margin back to GUM spot (free)
POST /v1/perps/leverage/quote / POST /v1/perps/leverageSet leverage for a market (cross or isolated)
POST /v1/perps/orders/quote / POST /v1/perps/ordersQuote and place market, limit or post-only Perps orders
POST /v1/perps/orders/cancel/quote / POST /v1/perps/orders/cancelCancel 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. address takes a Solana address or an EVM 0x address, 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 on code; 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.

Shell
gumag strategies opportunities list
gumag strategies funding list
gumag strategies position-links list --include-archived

The 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.