GUM Trading CLI & MCP

v0.3.1
io.github.jupnet/gum-cli Checked 31 minutes ago Published 5 days ago

Trade spot tokens, tokenized stocks, and up to 50x perps across chains on GUM by Jupiter.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

whoami

The wallet this server trades with: its address, Solana or EVM, the profile and its USD limit. Call this first; the other tools default to this wallet.

get_balances

USD cash and token holdings. Defaults to this server's wallet.

ParameterTypeDescription
addressstringYour account: a Solana address, an EVM 0x address, or a GUM address.

list_chains

Supported chains, each with its dollar token and whether USD can be withdrawn to it (usdWithdrawable).

get_deposit_addresses

Where to send funds to top up the account: one deposit address per chain, with its dollar token and minimum.

ParameterTypeDescription
addressstringYour account: a Solana address, an EVM 0x address, or a GUM address.

get_history

Deposits, swaps and withdrawals, newest first. Pass nextCursor back as cursor for the next page.

ParameterTypeDescription
addressstringYour account: a Solana address, an EVM 0x address, or a GUM address.
chainIdintegerOnly one market: the token's chain (GET /chains). Pass it with `token`.
cursorstring`nextCursor` from the previous page.
limitinteger
mintstringOnly one market, by its GUM mint. Use instead of `chainId` and `token`.
tokenstringOnly one market: a symbol (SOL) or the token's address. Found on its chain unless you pass --chain.
typestring

get_perps_account

GUM Perps sub-accounts, balances, margin, configured market leverage, open positions and resting orders. Defaults to this server's wallet.

ParameterTypeDescription
addressstringYour account: a Solana address, an EVM 0x address, or a GUM address.
subaccountIdintegerFilter to one sub-account (0–4).

perps_deposit

Move USD from GUM spot balance into a GUM Perps sub-account (free). Set dryRun to check without moving funds. Needs a USD limit.

ParameterTypeDescription
amount *stringUSD amount as a decimal string.
dryRunbooleanQuote and sign, then have the API check the signature without submitting. Nothing moves.
subaccountIdintegerPerps sub-account index (0–4, default 0).

perps_set_leverage

Set target leverage for a GUM Perps market (cross or isolated). Set dryRun to check without submitting.

ParameterTypeDescription
leverage *integerTarget leverage multiplier (1–100).
symbol *stringPerps market symbol, e.g. SOL, BTC, SPCX.
dryRunbooleanQuote and sign, then have the API check the signature without submitting. Nothing moves.
marginModestringDefaults to "cross".
subaccountIdinteger

list_perps_markets

List active GUM Perps markets with mark/index prices, hourly and annualized funding rates, open interest, maker/taker fees and margin tiers.

get_perps_funding_history

Historical hourly funding rates and average annualized rate for a GUM Perps market.

ParameterTypeDescription
symbol *stringPerps market symbol, e.g. SOL, BTC, ETH, SPCX, HYPE.
limitintegerHourly entries to return (1–720, default 168 = 7 days).

get_perps_orderbook

Current L2 orderbook bids and asks for a GUM Perps market.

ParameterTypeDescription
symbol *stringPerps market symbol, e.g. SOL, BTC, ETH, SPCX, HYPE.
depthintegerLevels per side (1–50, default 20).

perps_cancel_order

Cancel one open GUM Perps order (orderId or clientOrderId) or all open orders in a market (cancelAll: true). Set dryRun to check without cancelling.

ParameterTypeDescription
symbol *string
cancelAllbooleanSet true to cancel every open order in this market.
clientOrderIdstring
dryRunbooleanQuote and sign, then have the API check the signature without submitting. Nothing moves.
marginModestring
orderIdstring
subaccountIdinteger

quote_perps_order

Preview a GUM Perps market, limit or post-only order without submitting. Returns quantity, price and estimated USD notional.

ParameterTypeDescription
side *stringbuy opens/adds long; sell opens/adds short.
size *stringOrder size as a decimal string: base units by default, or USD when sizeCurrency is "USD".
symbol *stringPerps market symbol, e.g. SOL, BTC, SPCX.
clientOrderIdstringOptional unsigned 64-bit integer client order id.
marginModestringDefaults to "cross".
orderTypestringDefaults to "market".
pricestringLimit price as a decimal string. Required for limit and postOnly orders.
reduceOnlyboolean
sizeCurrencystringDefaults to "base".
slippageBpsintegerMarket order slippage cap in bps (default 100 = 1%, max 400 = 4%).
subaccountIdinteger
timeInForcestring

perps_place_order

Place a GUM Perps market, limit or postOnly order with this wallet. side is buy (long) or sell (short); size is in base units (or USD when sizeCurrency is USD). Set dryRun to verify without submitting. Needs a USD limit.

ParameterTypeDescription
side *stringbuy opens/adds long; sell opens/adds short.
size *stringOrder size as a decimal string: base units by default, or USD when sizeCurrency is "USD".
symbol *stringPerps market symbol, e.g. SOL, BTC, SPCX.
clientOrderIdstringOptional unsigned 64-bit integer client order id.
dryRunbooleanQuote and sign, then have the API check the signature without submitting. Nothing moves.
marginModestringDefaults to "cross".
orderTypestringDefaults to "market".
pricestringLimit price as a decimal string. Required for limit and postOnly orders.
reduceOnlyboolean
sizeCurrencystringDefaults to "base".
slippageBpsintegerMarket order slippage cap in bps (default 100 = 1%, max 400 = 4%).
subaccountIdinteger
timeInForcestring

perps_withdraw

Move free USD from a GUM Perps sub-account back to your GUM spot balance (free). Set dryRun to check without moving funds. Needs a USD limit.

ParameterTypeDescription
amount *stringUSD amount as a decimal string.
dryRunbooleanQuote and sign, then have the API check the signature without submitting. Nothing moves.
subaccountIdintegerPerps sub-account index (0–4, default 0).

quote

Price a buy or a sell without trading. Buys take amount in USD; sells take it in tokens. Returns pay, receive (with its minimum), fee, usdValue and expiresAt.

ParameterTypeDescription
amount *stringDecimal string. Buy: USD to spend. Sell: tokens to sell.
side *string
token *stringA symbol (SOL) or the token's address. A symbol on several chains needs --chain.
chainIdintegerThe token's chain, e.g. 900 Solana or 8453 Base. Found from the token when left out.
slippageBpsintegerOptional. Defaults to 100 (1%), 200 on Ethereum and Robinhood. Max 1000.

trade

Buy or sell with this wallet's GUM balance: quotes, signs, submits and waits up to a minute. Buys spend amount USD; sells sell amount tokens. Set dryRun to check everything without trading. Refused unless the server runs with a USD limit (GUM_MAX_TRADE_USD or the profile's). If the result isn't final yet, call get_swap with its id.

ParameterTypeDescription
amount *stringDecimal string. Buy: USD to spend. Sell: tokens to sell.
side *string
token *stringA symbol (SOL) or the token's address. A symbol on several chains needs --chain.
chainIdintegerThe token's chain, e.g. 900 Solana or 8453 Base. Found from the token when left out.
dryRunbooleanQuote and sign, then have the API check the signature without submitting. Nothing moves.
slippageBpsintegerOptional. Defaults to 100 (1%), 200 on Ethereum and Robinhood. Max 1000.

get_swap

A swap's status by id. Done once final is true; while pending, step says what's happening.

ParameterTypeDescription
id *stringThe `id` returned when you submitted.

search_tokens

Find tradable tokens and stocks by symbol, name or address. Returns address, chainId, decimals, priceUsd, verified and riskLevel.

ParameterTypeDescription
chainIdintegerOnly this chain. With an address `query`, that token is looked up on this chain directly; if the lookup can't reach its source, the answer is a 502 to retry.
limitinteger
querystringSymbol, name or address. Empty returns popular tokens.

quote_withdrawal

Price a withdrawal without sending it: amount, fee, usdValue and warnings about the destination.

ParameterTypeDescription
amount *stringDecimal string.
chainId *integerDestination chain.
destination *stringAddress on chainId that receives the funds.
token *string"USD" (paid out as the chain's dollar token), or the symbol or address of a token you hold on that chain.

withdraw

Send funds to an address on another chain. token is "USD" (paid out as that chain's dollar token) or a token you hold. Returns once submitted; follow it with get_withdrawal. Set dryRun to check without sending. Refused unless the server runs with a USD limit (GUM_MAX_TRADE_USD or the profile's).

ParameterTypeDescription
amount *stringDecimal string.
chainId *integerDestination chain.
destination *stringAddress on chainId that receives the funds.
token *string"USD" (paid out as the chain's dollar token), or the symbol or address of a token you hold on that chain.
dryRunbooleanQuote and sign, then have the API check the signature without submitting. Nothing moves.

get_withdrawal

A withdrawal's status by id. Done once final is true.

ParameterTypeDescription
id *stringThe `id` returned when you submitted.

perps_close_position

Close all or part of an open GUM Perps position with a reduce-only market order. Omit size to close the full position; specify marginMode and/or subaccountId if multiple positions exist for the same market. Set dryRun to verify without executing. Needs a USD limit.

ParameterTypeDescription
symbol *stringMarket symbol to close, e.g. SOL.
dryRunbooleanQuote and sign, then have the API check the signature without submitting. Nothing moves.
marginModestringMargin mode to disambiguate when both cross and isolated positions exist.
sizestringOptional base-unit size to close. Omit to close the full open position.
slippageBpsintegerMaximum slippage in basis points for the market close (0–400).
subaccountIdintegerSub-account index (0–4) when positions span multiple sub-accounts.

search_api

Search the API for an endpoint in plain words (e.g. "price history"). Returns each match's operationId and parameters, ready for call_api, including endpoints newer than this server.

ParameterTypeDescription
query *stringWhat you want to do.

call_api

Call an endpoint by operationId (find it with search_api). params fill path and query parameters; an address parameter defaults to this server's wallet. body is the JSON body. Submitting trades and withdrawals isn't allowed here: use trade and withdraw, which sign.

ParameterTypeDescription
operationId *stringFrom search_api.
bodyobjectThe JSON body, for POST operations.
paramsobjectPath and query parameters by name.