# GUM Docs — Full Documentation > GUM (gum.ag, built by Jupiter) is the universal identity and liquidity layer for crypto — spot tokens, tokenized stocks, perpetual futures (GUM Perps), Universal Deposit, Universal Swap & Bridge, and a keyless Trading API + CLI/MCP server (`@gumag/cli`). - Website: https://gum.ag - Docs index: https://docs.gum.ag/llms.txt - Sitemap: https://docs.gum.ag/sitemap.xml - Trading API base URL: https://api.gum.ag/app/v1 - OpenAPI 3.1 spec: https://api.gum.ag/app/v1/openapi.json - CLI & MCP server: `npx -y @gumag/cli@latest mcp` --- ## Introduction URL: https://docs.gum.ag/ Markdown: https://docs.gum.ag/index.md Description: Learn how GUM works, accept deposits with Universal Deposit, swap and bridge assets with Universal Swap & Bridge, or trade from your own code with the Trading API. import { CardGroup_1 } from "../components/index/CardGroup_1.jsx"; --- ## How GUM works URL: https://docs.gum.ag/how-gum-works Markdown: https://docs.gum.ag/how-gum-works.md Description: GUM lets you hold, trade and move assets across multiple chains, with more to come. This page shows what happens behind the app. import { Steps_1 } from "../components/how-gum-works/Steps_1.jsx"; import { CardGroup_1 } from "../components/how-gum-works/CardGroup_1.jsx"; GUM is the identity and liquidity layer for crypto. You hold, trade and move assets across multiple chains without a wallet for each chain or a bridge between them. The GUM app at [gum.ag](https://gum.ag) is the first app built on it. ## The three layers ### GUM Runtime * **GUM Network** is the chain GUM runs on, where your account and balances live. * **DOVES** (Decentralized Observation, Validation, and Execution) are the nodes that run GUM Network, watch every connected chain and sign the actions GUM sends out. * **Universal Accounts** are GUM's native accounts, opened with Google or X ([OpenIDZK](/accounts/openidzk)), a passkey or a wallet. **Each sign-in method opens its own account.** ### Omnichain Ledger * Tracks balances across supported chains. ### Core Services * **Intents.** You choose an action. An authorized session keypair, including a delegation keypair, can sign the transaction on your behalf; some wallets sign directly. Core Services handle execution on the target chain. * **Routing.** For each trade, GUM compares quotes from several aggregators and uses the best one ([meta-aggregation](/glossary#meta-aggregation)). ## What happens when you deposit, trade and withdraw ## Supported chains Each supported chain has a **dollar token**, the stablecoin it settles in on GUM. You can convert USDT and USDG to USD in the app. **Only deposit on the supported chains listed above.** Tokens sent on any other network aren't credited to your account, even if the address looks the same. See [Deposit](/funds/deposit). ## What you can do today For costs, see [Fees](/fees). For unfamiliar terms, see the [Glossary](/glossary). For help, open a ticket on [Discord](https://discord.gg/gum-ag). --- ## Universal Accounts and sign-in URL: https://docs.gum.ag/accounts/universal-accounts Markdown: https://docs.gum.ag/accounts/universal-accounts.md Description: Your GUM account comes from the way you sign in, with no seed phrase to write down. import { AccordionGroup_1 } from "../../components/accounts/universal-accounts/AccordionGroup_1.jsx"; A Universal Account is created on GUM. ## Sign-in methods | Method | How you approve sign-in | | ------------------------------- | ------------------------------------- | | Google, Apple or X | Sign in to that account | | [Passkey](/glossary#passkey) | Your fingerprint, face or screen lock | | Solana or Ethereum (EVM) wallet | Sign a message in your wallet | Google, Apple and X sign-in use [OpenIDZK](/accounts/openidzk), GUM's private social login. New Apple sign-ups are paused during an Apple sign-in migration. ## One method, one account **Each sign-in method creates a separate account, so you must sign in the same way every time to reach your funds.** Every Google, Apple or X account, every passkey and every wallet address opens its own account, with its own address and balance. Linking sign-in methods, account recovery and two-factor authentication (2FA) are planned, but not available yet. ## Approvals and sessions Signing in starts a session: a temporary permission for this device to act for your account, so you trade without pop-ups. * **Sessions last about two weeks.** Google, Apple and X sessions [can end sooner](/accounts/openidzk#why-you-may-be-signed-out-early). * **A session can do anything your account can**, including withdrawing your funds. * **Sessions can't be revoked yet.** **Log out** doesn't cancel the session, so treat a signed-in device like an unlocked wallet. ## Hardware-wallet mode A Solana hardware wallet that doesn't support message signing can't authorize the delegated session key GUM normally uses to act without repeated wallet approvals. Tick **Hardware Wallet?** when you sign in to use the same account without delegation. You'll approve each token trade and withdrawal in your wallet, and [GUM Perps](/perps/overview) trading isn't available. * **A Ledger needs Blind signing.** Its Solana app only approves GUM transactions with [Blind signing turned on](https://support.ledger.com/article/4499092909085-zd). Ledger turns it off after every Ledger OS or Solana app update, so GUM reminds you each time it asks you to sign. * **Approve within about 25 seconds.** A trade or withdrawal expires shortly after GUM prepares it. If you reject or cancel it, or it expires first, nothing is submitted or charged: get a new quote and approve again. ## FAQ --- ## Private social login (OpenIDZK) URL: https://docs.gum.ag/accounts/openidzk Markdown: https://docs.gum.ag/accounts/openidzk.md Description: How signing in with Google, Apple or X works, and what stays private. import { Steps_1 } from "../../components/accounts/openidzk/Steps_1.jsx"; import { AccordionGroup_1 } from "../../components/accounts/openidzk/AccordionGroup_1.jsx"; When you sign in with Google, Apple or X, GUM uses OpenIDZK to open your [Universal Account](/accounts/universal-accounts). A zero-knowledge proof shows [GUM Network](/how-gum-works) that you hold a valid login, without revealing who you are on-chain. The proof is handled for you. New Apple sign-ups are paused during an Apple sign-in migration. ## What stays private, and what doesn't **Your email and social account ID never go on-chain, and GUM doesn't store them.** Some things aren't private: * GUM's sign-in services check your login token when you sign in. * The chain can see which login provider an account uses. * Your account address and transactions are public on GUM Network. * Your login provider knows you signed in to GUM. ## How a sign-in works For what the proof checks, see [OpenIDZK proofs](/protocol/openidzk-proofs). ## Why you may be signed out early Sessions last [about two weeks](/accounts/universal-accounts#approvals-and-sessions), but Google, Apple and X sign logins with keys that get replaced from time to time. Once the key that signed your login is retired, GUM Network stops accepting your session. Your account and funds aren't affected: sign in again the same way. ## FAQ --- ## Deposit URL: https://docs.gum.ag/funds/deposit Markdown: https://docs.gum.ag/funds/deposit.md Description: Send supported tokens to your personal deposit addresses on GUM for free. **Depositing into GUM is free.** Pick a supported chain and send tokens to the deposit address shown in the app. ## How it works 1. Open **Deposit** in the app and pick the chain you're sending from. 2. Copy the address or scan its QR code, then send from your wallet or exchange. On EVM chains, your deposit address starts with `0x` and may be the same on several networks. Always send on the network selected in the app. Each sign-in method creates its own account with its own addresses, so copy the address while signed in to the account you want to fund. See [Universal Accounts](/accounts/universal-accounts). ## Supported chains **The minimum deposit is $2.** A smaller deposit waits at your address. Send more of the same token to the same address, and GUM credits them together once the total clears the minimum. You can also deposit other supported tokens. They arrive as tokens in your account. ## Timing Deposits usually arrive in under a minute. Ethereum takes a few minutes. If a deposit hasn't arrived by then, check it with **Deposits not coming in?** on the Deposit screen. If it's still missing, open a ticket on [Discord](https://discord.gg/gum-ag). ## Sending from a wallet or exchange The wallet you send from pays the sending network's usual fee. On an exchange, choose the same network as in GUM, and check that what arrives after any withdrawal fee is still worth at least $2. If the exchange doesn't support Solana deposit addresses like GUM's, use Base or Arbitrum instead. **Send only on the networks listed above, to the address the Deposit screen shows for that network.** Funds sent on any other network, or tokens GUM doesn't support, may never be credited, even where your EVM address looks valid. Never send to the public key shown in your profile settings: it isn't a deposit address. If a deposit went wrong, open a ticket on [Discord](https://discord.gg/gum-ag). Recovery isn't guaranteed. --- ## Withdraw URL: https://docs.gum.ag/funds/withdraw Markdown: https://docs.gum.ag/funds/withdraw.md Description: Send USD or tokens from GUM to an address on another chain, for a flat fee per destination chain. Withdrawing sends USD or tokens from your GUM account to an address on another chain. Each withdrawal pays a flat fee that depends on the destination chain. ## How to withdraw 1. Open **Withdraw**, paste the address and choose the chain. 2. Choose the token. The app lists only the tokens you can send to that chain. 3. Enter the amount, review the fee and the address check, then choose **Withdraw**. The address check catches malformed addresses and accounts that can't receive funds, but it can't tell whether an address is yours, or whether the wallet or exchange behind it supports that network. ## What arrives on each chain USD goes out as USDC where the table shows it is available, regardless of the chain it came in on. Every other token can only be withdrawn to its [home chain](/glossary#home-chain). If a token is missing from the list, pick its home chain as the destination. ## Fees The flat fee comes out of the amount you withdraw, so the amount must be worth more than the fee. For a token other than USD, you pay the same dollar amount in that token. See [Fees](/fees#withdrawals) for each chain's fee. These are the current rates; they may change. ## Timing Withdrawals usually arrive in about a minute. Ethereum takes a few minutes. A withdrawal doesn't expire: it stays open until it's delivered. If one looks stuck, or before you move a very large amount, open a ticket on [Discord](https://discord.gg/gum-ag). **Withdrawals can't be reversed.** GUM can't get back funds sent to a wrong address, or to a wallet or exchange that doesn't support that network. Check the destination chain and the full address before you confirm. --- ## Gifts URL: https://docs.gum.ag/funds/gifts Markdown: https://docs.gum.ag/funds/gifts.md Description: Send USD to anyone as a link, QR code or code, which they claim by signing in to GUM. A gift sends USD from your balance as a link, a QR code or a 20-character code. The person you send it to signs in to GUM, or creates an account, and claims the USD. Gifts are [free](/fees) to send and claim. ## Send a gift Open **Gift**, choose **Send**, enter an amount between $1 and $1,000,000 and choose **Create gift**. Then copy or share the link, or download the gift as an image. **The code is shown only once**, so save or share it straight away. ## Claim a gift Open the gift link or scan its QR code, or open **Gift**, choose **Receive** and enter the code. Sign in and choose **Claim**. The USD arrives in the account you're signed in to, so sign in the way you normally do. See [Universal Accounts](/accounts/universal-accounts). If the app says the gift can't be claimed, it has already been claimed, it has expired, or the code is invalid. ## Expiry and cancelling Gifts expire 7 days after they're created if no one claims them. Until then, you can cancel a gift under **Active** to get the USD back, and its link and code stop working. If you lose the code, cancel the gift. **Anyone who has the code or link can claim the gift.** Share it only with the person it's for, and never post it publicly. Once someone claims it, you can't cancel it. --- ## Trade tokens URL: https://docs.gum.ag/trade/tokens Markdown: https://docs.gum.ag/trade/tokens.md Description: Buy and sell tokens across supported chains with your USD balance. import { Steps_1 } from "../../components/trade/tokens/Steps_1.jsx"; import { AccordionGroup_1 } from "../../components/trade/tokens/AccordionGroup_1.jsx"; You buy tokens with your [USD balance](/glossary#usd-balance) and sell them back to USD across supported chains. [Deposit](/funds/deposit) to fund your USD balance. Tokenized stocks and Earn tokens trade the same way; see [Stocks](/trade/stocks) and [Earn](/trade/earn). ## Supported chains ## How a trade works ## Price protection **Every trade carries a minimum output that you sign and the chain enforces.** The quote shows it as **Receive at least**. Max [slippage](/glossary#slippage) caps how far below the quote a trade can fill: The cap is 2% on Ethereum and Robinhood Chain, and 1% on other supported chains. If the swap can't deliver the minimum, the trade doesn't go through. ## If a trade fails **If a trade can't complete, you get a full refund, including the fee:** your USD on a buy, your tokens on a sale. The app claims the refund for you automatically. If a refund seems stuck, open the trade and select **Claim Funds**. If that doesn't help, open a ticket on [Discord](https://discord.gg/gum-ag). ## Fees Each trade pays a fee, shown on the quote before you confirm. The standard rate is 25 bps (0.25%), with a minimum fee per chain; stablecoins, some Earn tokens and Robinhood Chain have different rates. These are current rates; they may change. See [Fees](/fees). ## Token warnings GUM checks tokens for signs of risk and warns you before you trade. In the live quote check, GUM quotes a $1,000 buy, then quotes selling those tokens straight back, with no fee and no slippage, and measures how much of the $1,000 comes back. | Round trip returns | What happens | | ---------------------------------- | ----------------------------------------------------------------------- | | 95% or more | No warning. | | 50% to under 95% | The quote shows a warning. | | Under 50%, or no buy or sell quote | Marked **Not tradable on GUM yet**. Buying needs a second confirmation. | Stocks must clear a stricter bar; see [When a stock can trade](/trade/stocks#when-a-stock-can-trade). The app also warns about concentrated or few holders, low liquidity or recent volume, new tokens, tokens whose issuer can freeze balances or create more tokens, and poor-value quotes. Warnings are a guide, not a guarantee. Any token can lose value, or become hard to sell, without a warning showing. ## FAQ --- ## Stocks URL: https://docs.gum.ag/trade/stocks Markdown: https://docs.gum.ag/trade/stocks.md Description: Trade tokenized stocks and ETFs with your USD balance, and know what a stock token does and doesn't give you. Stocks lets you buy and sell tokens that track public stocks and ETFs, paid from your USD balance. **A stock token tracks a stock, but holding it isn't the same as owning the share.** ## What stock tokens are A stock token is issued on Solana by a third-party issuer, which sets its terms. You trade it like any Solana token, with a $1 minimum, 1% max slippage and the same [fees](/fees); see [Trade tokens](/trade/tokens). - **Rights sit with the token issuer, not the company.** Unless its terms say otherwise, you have no shareholder, voting or dividend rights. - **The price can diverge from the stock**, especially outside market hours or when trading in the token is thin. - **The token depends on its issuer.** If the issuer fails or stops supporting a token, it can become hard to sell and can lose all its value, whatever happens to the stock. Pre-stocks are pre-IPO tokens linked to private companies, and they carry extra risk. There's no public share price to check the token against, and the company may never list. What the token represents, and what happens if the company lists, is acquired or fails, depends entirely on the issuer's terms. Pre-stocks can become hard to sell and can lose all their value. ## When a stock can trade **Whether a stock can trade is decided by a live quote check, not by the clock.** GUM quotes a $1,000 buy of the stock token, then quotes selling it straight back, with no fee and no slippage. If less than 99% comes back, the stock shows as **Unavailable**. A result is reused for up to 30 minutes, so a stock can become available again once quotes improve. This bar is stricter than the one for [other tokens](/trade/tokens#token-warnings). The market hours on each stock page are a reference, because quote quality differs outside them. Outside regular hours, quotes can be worse, and the app warns you before you trade. ## Dividends and corporate actions Dividends, stock splits, mergers and other corporate actions follow the token issuer's terms, and a token may not reflect them at all. GUM doesn't pay dividends itself. **There's no redemption through GUM.** You can't turn a stock token into the underlying shares in the app. To exit, you sell the token for USD. --- ## Earn URL: https://docs.gum.ag/trade/earn Markdown: https://docs.gum.ag/trade/earn.md Description: Buy yield-bearing tokens from third parties with your USD balance, and see where their yield and risks come from. Earn lists yield-bearing tokens from third parties, with their current APY (annual percentage yield). You buy them with your USD balance and sell them back to USD. **Earn isn't a GUM vault: GUM doesn't set, manage or guarantee the yield.** ## What Earn is Earn gives you access to yield-bearing tokens across multiple chains. The third-party protocols behind them generate the yield and set the rates. - **Depositing buys the token** at a quote, like any [trade](/trade/tokens). - **Withdrawing sells the token** for USD at the quote at that time, which can be more or less than you paid. It can be temporarily unavailable while the token's chain is paused for maintenance. - **Limits:** $1 minimum for deposits and withdrawals, and a fixed 1% max slippage. ## Where the APY comes from GUM shows each token's APY from third-party data. It's the latest available rate, including compounding, or a 30-day average when there's no current rate. For some tokens it's an estimate. **APY varies and isn't guaranteed.** It isn't a forecast, and the value of the token can fall. The projection in the app assumes the rate holds all year and the token keeps its value. ## Risks Yield-bearing tokens carry risks that GUM doesn't control: - **The token issuer.** The protocol behind a token can fail, change how the token works or cut its rate. - **Smart contracts.** A bug or exploit in the token's contracts can cause losses. - **Depegging.** A token can trade below the asset it's meant to track. - **Liquidity.** Withdrawing is a sale. In a thin market you may get less than the displayed value, or no quote for a while. You can lose money in Earn, including the amount you put in. There's no deposit insurance, and GUM doesn't guarantee the yield or your principal. ## Fees Depositing and withdrawing are trades, so trading fees apply both ways: the standard 25 bps (0.25%), or a reduced 7 bps (0.07%) on some Earn tokens. These are current rates; they may change. See [Fees](/fees). --- ## GUM Perps URL: https://docs.gum.ag/perps/overview Markdown: https://docs.gum.ag/perps/overview.md Description: Trade perpetual futures on crypto using your USD balance as collateral. Leverage limits vary by market. import { CardGroup_1 } from "../../components/perps/overview/CardGroup_1.jsx"; A perpetual future, or perp, tracks an asset's price and never expires. You don't own the asset: you go **long** to profit when the price rises, or **short** when it falls. Leverage lets you hold a position worth more than the USD behind it. Perps use leverage. A small price move can wipe out the USD behind a position, and a liquidation can't be undone. Read [Liquidation](/perps/liquidation) before you trade. ## How GUM Perps works * **On-chain.** Each market has an order book on GUM Network, where a program matches orders and tracks positions, so every fill can be verified. * **USD is the collateral.** Profit and loss, fees and funding are all paid in USD. * **Sub-accounts.** You move USD into a perps [sub-account](/perps/accounts) to trade. You can have up to five, each with its own USD and positions. ## Markets Markets are open 24/7, except during scheduled maintenance, which the app announces beforehand. ## Mark price and last price GUM Perps uses an **oracle price** as its **mark price**. **Your margin, liquidations and unrealized PnL use the mark price, not the last trade.** The **last price** is the latest trade on the order book. It can differ from the mark price, especially in fast markets or when the book is thin. ## Fees These are current rates; they may change. * **Maker, 0.5 bps (0.005%):** your order rests on the book and someone else fills it. It's a charge, not a rebate. * **Taker, 3.5 bps (0.035%):** your order fills right away against the book. Liquidations carry an extra fee; see [Fees](/fees). Deposits and transfers have no account-value cap. Your available balance and trading limits still apply. See [Deposits and transfers](/perps/accounts#deposits-and-transfers). ## Learn more --- ## Perps accounts and sub-accounts URL: https://docs.gum.ag/perps/accounts Markdown: https://docs.gum.ag/perps/accounts.md Description: Move USD between your balance and GUM Perps, keep positions apart with sub-accounts, and know the limits that apply. To trade perps, you move USD from your GUM balance into a perps sub-account. Each sub-account is a separate margin account with its own USD, positions, orders and liquidation risk. To keep a cross position open while opening an isolated position in the same market, use another sub-account. ## Moving USD Open the transfer screen in Perps and choose a direction. Your main USD balance is labelled **Spot** there. - **Spot to Perps:** up to your available USD balance. - **Perps to Spot:** up to the sub-account's **Available** balance, the USD that isn't backing positions or open orders. While it has open positions or orders, $0.01 stays behind. - **Perps to Perps:** up to the sender's Available balance minus $0.01. Not available during maintenance. Transfers are free. Margin set aside for an [isolated position](/perps/margin-and-leverage#cross-and-isolated-margin) moves only between that position and its sub-account: use **Adjust margin** on the position to add USD, or to take back any above its initial margin. If you have no USD yet, see [Deposit](/funds/deposit). ## Sub-accounts - You can have up to **five** sub-accounts. - **Positions in one sub-account can't use USD from another**, and a liquidation in one doesn't touch the others. - Isolated positions sit inside a sub-account and don't count toward the five. ## Deposits and transfers There is no account-value cap on deposits or transfers into a sub-account. You can move up to your available balance; position and order limits still apply when you trade. Account value is the sub-account's USD plus the unrealized PnL of its positions. ## Jupiter Account You may see a sub-account named **Jupiter Account**. It shows positions opened through Jupiter's perps interface, which runs on GUM Perps. It's view-only in GUM; manage those positions on Jupiter. It takes one of your five sub-account slots. --- ## Margin and leverage URL: https://docs.gum.ag/perps/margin-and-leverage Markdown: https://docs.gum.ag/perps/margin-and-leverage.md Description: How much USD you need to open and keep a position, how leverage and margin modes work, and how the app estimates your liquidation price. Margin is the USD that backs your positions. You need **initial margin** to open a position, and **maintenance margin** to keep it open. Percentages are of position value. The app shows the current leverage limit in the order form. Every market uses [margin tiers](#margin-tiers), and the table shows the first tier. ## Leverage You set leverage per market in the order form, from 1x up to the market's max, which is where it starts. **Leverage sets how much initial margin a new position needs, not your maintenance margin.** The higher the leverage, the less you need. For a cross position you already hold, lowering the setting doesn't move your liquidation price; adding USD or reducing the position does. ## Margin tiers In every market, a larger position needs a larger share of its value as margin, and allows less leverage. All markets use the same tier rates: | Max leverage | 50x | 25x | 20x | 10x | 5x | | ------------------ | --- | --- | ---- | --- | --- | | Initial margin | 2% | 4% | 5% | 10% | 20% | | Maintenance margin | 1% | 2% | 2.5% | 5% | 10% | Each market's tiers end at these position values. Its first tier starts at $0 and each later one where the previous one ends, so SOL's 20x tier covers $20,000 to $50,000. **—** means the market has no such tier. | Market | 50x | 25x | 20x | 10x | 5x | | ------------------- | ------- | ------- | -------- | -------- | -------- | | BTC, ETH | $20,000 | $50,000 | $100,000 | $250,000 | $500,000 | | SOL | $10,000 | $20,000 | $50,000 | $100,000 | $200,000 | | ZEC | $10,000 | $20,000 | $50,000 | $100,000 | — | | HYPE | — | $25,000 | $50,000 | $100,000 | — | | JUP | — | — | $10,000 | $20,000 | $50,000 | | SPCX, SKHYNIX | — | — | $50,000 | $75,000 | $100,000 | - **Your leverage caps your position.** Your position and open orders in a market can total up to the end of the last tier whose max leverage is at least yours. ETH starts at 50x, which allows $20,000. At 30x that's still $20,000, and $50,000 needs 25x or lower. The leverage slider marks each tier's max. - **Initial margin is one rate on the whole position**: its value divided by your leverage. A $50,000 ETH position at 25x needs $2,000. - **Maintenance margin rises gradually.** Each slice of a position pays its own tier's percentage, so a $50,000 ETH position needs $800: 1% of the first $20,000 plus 2% of the next $30,000. - **A position above the first tier is liquidated one tier at a time.** See [Liquidation](/perps/liquidation#what-happens). ## Cross and isolated margin - **Cross** (the default) backs all of a sub-account's positions and orders with its USD, so a loss can draw on the whole balance. - **Isolated** sets aside margin for one position, based on your leverage. Only that margin backs it, so a liquidation doesn't touch the rest of the sub-account. In one sub-account, a market is either cross or isolated. To keep both modes open for the same market, use separate sub-accounts. Otherwise, close the existing position and cancel its open orders before switching. ## Return on position margin **Position ROE** is unrealized PnL divided by the margin backing the position, multiplied by 100. Cross uses the venue's required initial margin at its reported mark price. The margin equals mark notional times the effective initial margin rate, which accounts for the position's leverage setting and risk tier. A stricter risk tier can require more margin than the displayed leverage implies. At the same PnL, a higher margin requirement moves ROE closer to zero. Isolated uses posted collateral when available and required initial margin otherwise. Adding isolated collateral reduces the size of the percentage at the same PnL. The percentage beside the account value divides unrealized PnL by the current account value shown on the tab, multiplied by 100. GUM account tabs use cross-position PnL and cross-account value. If all open positions are isolated, a funded GUM cross account shows 0.00%. The Jupiter Account tab includes the full unrealized PnL of its cross and isolated positions. Its displayed account value is cross equity plus the positive equity in each isolated account. For example, with $1,000 in cross equity and one isolated account at −$50 equity carrying a −$150 open loss, the tab shows $1,000 and −15.00%. Both tabs show a percentage only when the displayed account value is at least $0.01. The calculation uses the unrounded account value. ## Account health **You're liquidated when your account value drops below the maintenance margin plus the fees to close your positions**: the taker fee and the market's [liquidation fee](/perps/liquidation). Account value is the sub-account's USD plus unrealized PnL, including funding not yet paid. The app shows this as **Liquidation risk**: above 95% it flags elevated risk, and at 100% the sub-account can be liquidated. With isolated positions, it shows whichever margin is closest to liquidation, because each one is liquidated on its own. ## Liquidation price The app shows an **estimated** liquidation price for each position, and a preview in the order form. It assumes only that market's price moves, so funding, other positions and transfers shift it. Liquidation itself is triggered by your actual account value, checked on-chain. If the app shows **--**, no liquidation price falls within the valid market range. The order form skips the preview for markets with margin tiers, which is currently every market. --- ## Orders URL: https://docs.gum.ag/perps/orders Markdown: https://docs.gum.ag/perps/orders.md Description: The order types and options GUM Perps supports, how big an order can be, and why an order can be rejected. You can place market, limit and scale orders on every market. Each fill happens at the price of the order already resting on the book. ## Time in force Every order has a time in force: how long it stays open before whatever hasn't filled is cancelled. | Short name | Full name | What happens | | ---------- | ------------------- | ----------------------------------------------------- | | GTC | Good till cancelled | Rests on the book until it fills or you cancel it | | IOC | Immediate or cancel | Fills what it can right away; the rest is cancelled | | FOK | Fill or kill | Fills completely right away, or is cancelled entirely | ## Order types | Order type | What it does | Time in force | | ---------- | --------------------------------------------------------- | -------------------- | | Market | Fills right away, within your slippage limit | IOC (default) or FOK | | Limit | Fills at your price or better; the rest waits on the book | GTC | | Scale | Places a ladder of limit orders across a price range | GTC, IOC or FOK | - **Market:** anything that can't fill within your slippage setting (1% by default, up to 4%) is cancelled. - **Scale:** splits your size across 1 to 20 orders (5 by default), evenly spaced in price. Sizes are equal unless you set **Size skew** to weight them toward one end of the range. ## Order options - **Post only** (limit and scale): only adds liquidity, so it always pays the maker fee. It's rejected if any part would fill right away. Always GTC. - **Reduce only:** can only make your current position smaller, so it never opens a new position or reverses one. It can't be bigger than your position: if you're long 1 BTC, a reduce-only sell for more than 1 BTC is rejected. ## Order size - **Minimum:** $5 per order on-chain, including each order in a scale ladder. The app also asks for at least $10 on market and limit orders. Reduce-only orders skip the $10 minimum, but one under $5 must close your whole position. - **Maximum:** each market caps order and position size, and the order form shows your max order size. Open orders count toward the position cap. ## Price bands GUM Perps rejects orders priced further from the [mark price](/perps/overview#mark-price-and-last-price) than these bands. Limit and post-only orders are checked on buys above the mark and sells below it; market orders on their worst possible fill price. | Order | JUP | All other markets | | ------------------- | --- | ----------------- | | Limit and post-only | 20% | 10% | | Market | 10% | 5% | A resting order that ends up outside its band is cancelled rather than filled. ## Self-trade prevention If your order would match your own resting order in the same sub-account, GUM Perps cancels the resting one and your new order carries on against other orders. ## TP/SL A take profit (TP) or stop loss (SL) closes some or all of a position you hold once the price reaches a trigger you set. Setting one is free; when it triggers, its order pays the taker fee. | Position | Take profit triggers at | Stop loss triggers at | | -------- | ----------------------- | --------------------- | | Long | The trigger or above | The trigger or below | | Short | The trigger or below | The trigger or above | - **Trigger price:** the [mark price](/perps/overview#mark-price-and-last-price) by default, or the last price. A last-price TP/SL only counts trades made after you set or last edited it. - **Entry price:** a take profit must be on the profit side of your entry price and a stop loss on the loss side. It's checked against your entry, not the mark, so one that's already past the mark triggers right away. - **Size:** a share of the position, a quantity, or a USD amount converted at the trigger price. A share is worked out when it triggers, so it follows the position as it grows or shrinks. A TP/SL never closes more than the position. - **Limits:** up to 8 TP/SL per position. Your take profits together can't be bigger than the position, and neither can your stop losses. When it triggers, GUM Perps places a reduce-only order that fills right away (IOC): - **Market** (the default): goes ahead only if the book can close the whole size within the market [price band](#price-bands). Otherwise GUM Perps tries again, and cancels the TP/SL after 5 failed tries. - **Limit:** fills at your limit price or better, and whatever can't fill right away is cancelled. The limit can't be better than the trigger: at or below it when closing a long, at or above it when closing a short. A trigger isn't a guaranteed exit price. A market TP/SL fills at the prices on the book, which can be worse than the trigger in a fast market. A TP/SL ends when: - it triggers and its order is placed, even if a limit order fills only partly or not at all; - the position is closed or reversed, which removes every TP/SL on it; - a limit TP/SL's price is outside the price band when it triggers; - it would close less than the $5 order minimum, and not the whole position. When a TP/SL triggers, your reduce-only orders in that market that would no longer fit the position are cancelled. Order history shows them as **Replaced by take profit** or **Replaced by stop loss**. While the sub-account is being liquidated, TP/SL don't trigger and you can't add or edit them. ## Why an order is rejected - It's below the minimum or above the maximum size, or would take your position past its cap. - Its price is outside the price band. - It's post-only and would fill right away. - It's reduce-only and you have no position, or it's bigger than your position. - The sub-account already uses the other margin mode in that market. See [Cross and isolated margin](/perps/margin-and-leverage#cross-and-isolated-margin). - There isn't enough Available margin. - The sub-account is being liquidated, or GUM Perps is under maintenance. --- ## Funding URL: https://docs.gum.ag/perps/funding Markdown: https://docs.gum.ag/perps/funding.md Description: The hourly payments between longs and shorts that keep perp prices close to the oracle price. Funding is a payment between traders on the same market. Perps never expire, so funding is what keeps a perp's price close to the [oracle price](/perps/overview#mark-price-and-last-price) of the asset. - **When the rate is positive, longs pay shorts.** This happens when the perp trades above the oracle price. - **When the rate is negative, shorts pay longs.** This happens when the perp trades below it. GUM doesn't take a fee on funding. ## How the rate is set The rate has two parts: - **Premium:** how far the order book trades from the oracle price, averaged over the current hour. - **Interest:** a small baseline. When the book trades close to the oracle price, the rate settles at this baseline. Each market caps the rate in both directions. The rate is recalculated through the hour. ## When it's paid Funding is paid every hour, on the hour (UTC), on the size of the position you hold at that moment. Each payment covers the whole hour before it, at that hour's rate and mark price: a position held over the hour pays or receives the full hour's funding, and one opened and closed between two hours pays none. **Funding is added to or taken from your account value, so paying it moves you closer to liquidation.** ## How the app shows it - The chart header shows the current hourly rate and a countdown to the next payment. - The funding details also show the rate per 8 hours and annualized. You're charged the hourly rate; the other two are for comparison. - Your past payments appear in your funding history. --- ## Liquidation URL: https://docs.gum.ag/perps/liquidation Markdown: https://docs.gum.ag/perps/liquidation.md Description: When GUM Perps closes your positions, what it costs, and how to avoid it. If your account value falls too low to support your positions, GUM Perps closes them for you. This is liquidation. Liquidation can't be undone. You lose the price move up to the close, plus the fees, and in a fast market the close can fill at worse prices. ## When it happens **A sub-account is liquidated when its account value, at the [mark price](/perps/overview#mark-price-and-last-price), drops below the maintenance margin plus the fees to close its positions.** With cross margin, the whole sub-account counts; with isolated margin, only that position's margin. In the app, this is when **Liquidation risk** reaches 100%. See [Account health](/perps/margin-and-leverage#account-health). ## Liquidation fee Each close pays the taker fee plus a liquidation fee on the value closed, never more than what's left in the sub-account. ## What happens 1. Your open orders are cancelled, except reduce-only ones. You can't place orders, move USD out or change leverage until the liquidation ends. 2. Positions are closed with market orders on the order book, largest first. A position above its market's first [margin tier](/perps/margin-and-leverage#margin-tiers) goes first and is closed one tier at a time. 3. After each close, once the sub-account is back above the threshold, liquidation stops and any other positions stay open. ## How to avoid it - **Add USD or reduce your positions** to move your liquidation price away. - **Use less leverage.** For a cross position, lowering the setting alone doesn't help. - **Use isolated margin** for riskier trades. - **Watch liquidation risk and funding.** Paying [funding](/perps/funding) lowers your account value over time. - **Plan around maintenance.** You can't trade, cancel orders or adjust margin during a maintenance window, but your positions stay open. If a liquidation looks wrong, open a ticket on [Discord](https://discord.gg/gum-ag). --- ## Fees URL: https://docs.gum.ag/fees Markdown: https://docs.gum.ag/fees.md Description: What GUM charges when you trade, trade perps, deposit, withdraw or send a gift, and what it doesn't. ## At a glance | What you do | Fee | | -------------------------------------- | ---------------------------------------------------------- | | Trade tokens and stocks | 0.25% (25 bps) | | Trade stablecoins and some Earn tokens | 0.07% (7 bps) | | Trade on Robinhood Chain | 0.30% (30 bps) | | Minimum spot trading fee | $0.01; $0.10 on BSC/Robinhood; $0.30–$3.00 on Ethereum | | Trade perps | Maker 0.005%, taker 0.035% | | Deposit into GUM | Free | | Withdraw | $0.10–$0.60 ([rates by chain](#withdrawals)) | | Send or claim a [gift](/funds/gifts) | Free | | Gas | Unapplicable | ## Trading tokens and stocks Each trade pays a percentage of its size or the chain's minimum fee, whichever is larger. | Trade | Rate | | ------------------------------------------- | --------------- | | Most tokens and stocks | 25 bps (0.25%) | | Stablecoins and some Earn tokens | 7 bps (0.07%) | | Any token on Robinhood Chain | 30 bps (0.30%) | | Chain the token trades on | Minimum fee per trade | | ------------------------------------- | --------------------- | | Solana, Base, Arbitrum, Sui, HyperEVM | $0.01 | | BSC, Robinhood Chain | $0.10 | | Ethereum | $0.30 | On Ethereum, the minimum can rise with network gas, up to $3.00. The fee comes out of the USD you spend or receive. See [Trade tokens](/trade/tokens). ## Perps Trading fees are charged on the value of each fill. | Fee | Rate | | ---------------------------------------------------- | ---------------- | | Maker (your order rests on the book and gets filled) | 0.5 bps (0.005%) | | Taker (your order fills immediately) | 3.5 bps (0.035%) | Liquidation fees are charged on the value closed: Funding is paid between traders, not to GUM. See [Funding](/perps/funding) and [Liquidation](/perps/liquidation). ## Deposits **Depositing into GUM is free.** When you send from your own wallet, that wallet pays the sending network's usual fee. See [Deposit](/funds/deposit). Apps that integrate [Universal Deposit](/universal-deposit/overview) pay its own fee. See [Deposit costs](/universal-deposit/deposit-costs). ## Withdrawals | Destination chain | Withdrawal fee | | ------------------------------------- | -------------- | | Solana, Base, Arbitrum, BSC, HyperEVM | $0.30 | | Robinhood Chain | $0.50 | | Ethereum | $0.60 | | Sui | $0.10 | The fee comes out of the amount you withdraw, which must be larger than the fee. See [Withdraw](/funds/withdraw). --- ## Typed signatures and addresses URL: https://docs.gum.ag/protocol/typed-signatures Markdown: https://docs.gum.ag/protocol/typed-signatures.md Description: How GUM Network accepts signatures from Ethereum wallets, passkeys, social sign-in and session keys, and how each one maps to a 32-byte address. On Solana, only an Ed25519 key can sign a transaction. [GUM Network](/how-gum-works), the chain GUM runs on, replaces each signature with a **typed signature**: a one-byte type tag, followed by a payload in the format that tag defines. Validators verify every supported scheme themselves, so an Ethereum wallet, a passkey or a Google, Apple or X account can own a GUM Network account directly, the basis of a [Universal Account](/accounts/universal-accounts). For the bytes of a whole transaction, see [Transaction wire format](/protocol/wire-format). ## Signature types | Tag | Name in code | Scheme | In the GUM app | | ------ | ---------------------- | -------------------------------------------------------- | --------------------------------- | | `0x00` | `Ed25519` | Ed25519, as on Solana | Solana wallets | | `0x01` | `Secp256k1` | ECDSA on secp256k1 | — | | `0x02` | `Secp256r1` | ECDSA on P-256 | — | | `0x10` | `Secp256k1ETH` | Ethereum `personal_sign` (EIP-191) | EVM wallets | | `0x20` | `Secp256r1Passkey` | WebAuthn passkey (P-256) | Passkeys | | `0x40` | `OpenIDZK` | [OpenIDZK](/protocol/openidzk-proofs) sign-in | Google, Apple and X | | `0x06` | `Delegation` | [Session key](#session-keys) | Sessions for wallets and passkeys | | `0x60` | `SubAccountDelegation` | [Session key for a sub-account](#sub-account-delegation) | — | Validators reject tag `0x04`, a retired OpenID signature without zero-knowledge proofs. ### What each type signs and carries - **`0x00`:** a 64-byte signature over the message bytes. - **`0x01`, `0x02`:** the public key (33 bytes compressed or 65 uncompressed), then `r` and `s` (32 bytes each), over SHA-256 of the message. - **`0x10`:** the same payload as `0x01`, over `keccak256("\x19Ethereum Signed Message:\n" ‖ length ‖ message)`, with the length in decimal. This is standard `personal_sign`, so any EVM wallet signs without changes. The typed signature drops the wallet's `v` and carries the public key instead. - **`0x20`:** the public key (64 bytes), authenticator data, client data JSON and signature (64 bytes), verified as a WebAuthn assertion whose challenge is SHA-256 of the message. The client data type must be `webauthn.get`, and the authenticator must report user presence and user verification. It signs `authenticatorData ‖ SHA-256(clientDataJSON)`. - **`0x40`, `0x06`, `0x60`:** signed by a session key, covered below and in [OpenIDZK proofs](/protocol/openidzk-proofs#signature-layout-and-size). ECDSA signatures (`0x01`, `0x02`, `0x10`, `0x20`) must use the low-S form. ## Addresses Every GUM Network address is 32 bytes. An Ed25519 signer's address is its public key, so a Solana wallet keeps its base58 address on GUM Network. Every other type uses a **typed address**: ```layout bytes 0–29 digest, which depends on the type byte 30 type tag byte 31 bump ``` The bump is the smallest value, counting up from 0, that puts the 32 bytes off the Ed25519 curve. So only the scheme named in byte 30 can sign for a typed address, and the same key under two types gives two different addresses. For `0x01`, `0x02`, `0x10` and `0x20`, validators recompute the address from the public key in the signature and require the smallest bump. A signature can only authorize the address its own key derives, so each sign-in method creates its own account. | Type | Bytes 0–29 | | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | `0x01`, `0x02`, `0x20` | The first 30 bytes of SHA-256 of the uncompressed public key (`x ‖ y`, 64 bytes) | | `0x10` | Bytes 0–19: the Ethereum address, `keccak256(x ‖ y)[12..32]`. Bytes 20–29: `keccak256(ethereum_address)[20..30]`, a checksum | | `0x40` | The first 30 bytes of `SHA-256(authority_account ‖ sub ‖ salt)`, proven inside the zero-knowledge proof. See [OpenIDZK proofs](/protocol/openidzk-proofs#the-address-and-its-salt) | | `0x60` | Bytes 0–19: the first 20 bytes of the parent address. Bytes 20–29: a label of 1 to 10 bytes, padded with zeros | ### Worked example: an Ethereum address The Ethereum address `0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed` maps to this GUM Network address: ```layout bytes 0–19 5aaeb6053f3e94c9b9a09f33669435e7ef1beaed the Ethereum address bytes 20–29 4b9e849aa48d4d35f740 keccak256(address)[20..30] byte 30 10 Secp256k1ETH byte 31 03 bumps 0, 1 and 2 are on the curve base58 76zD55PjRdoDgfapMXpm1gdPy3XDt1pN595fybzQCuia ``` Because the Ethereum address sits in the first 20 bytes, you can derive the GUM Network address from an Ethereum address alone, and read the Ethereum address back out. ## Session keys To avoid a wallet or passkey prompt for every transaction, your device creates an Ed25519 **session key** with an expiry slot (slots are GUM Network's unit of block time). Your wallet or passkey authorizes it once by signing a nonce derived from the session public key and expiry slot. Each transaction then carries a `0x06` signature, and validators verify your authorization against your address and the session signature against the message. ```layout Delegation (0x06) payload 32 bytes session public key (Ed25519) 8 bytes expiry slot, u64 little-endian 64 bytes session key's signature over the message compact-u16 length of your authorization n bytes your authorization: a typed signature (tag and payload) over the nonce ``` - The signer slot in the transaction holds **your** address, not the session key's. - Your authorization can be an Ed25519, secp256k1, P-256, Ethereum or passkey signature. OpenIDZK signatures don't need `0x06`: each one already carries its own session key and expiry. - A session is valid while the current slot is below its expiry slot, which the GUM app sets about two weeks ahead. **A session can do anything your account can, and it can't be revoked before it expires.** ## Sub-account delegation A sub-account is a second address derived from yours and a short label (the `0x60` row under [Addresses](#addresses)). A `0x60` signature works like `0x06`, except: - The session key can only act for that one sub-account: your authorization covers a nonce that commits to the session key, expiry slot and sub-account address. - The payload ends with the parent's 32-byte address. Validators check that the sub-account shares its first 20 bytes, carries tag `0x60` and uses the smallest bump. - The parent can also be an OpenIDZK account. The session then ends at whichever expiry slot comes first: the sub-account session's or the OpenIDZK session's. These protocol sub-accounts are separate from [GUM Perps sub-accounts](/perps/accounts). ## Planned: multi-factor accounts and recovery Linking sign-in methods to one account, 2FA and recovery are planned through a future User Program, not available yet. Validators don't accept a User signature type today. --- ## OpenIDZK proofs URL: https://docs.gum.ag/protocol/openidzk-proofs Markdown: https://docs.gum.ag/protocol/openidzk-proofs.md Description: How a Google, Apple or X sign-in becomes a GUM Network signature: the nonce binding, the address salt, the Groth16 proof and the checks validators run. OpenIDZK lets a Google, Apple or X account sign GUM Network transactions with a `0x40` [typed signature](/protocol/typed-signatures). The provider signs a login token, an OpenID Connect ID token, that commits to a session key on your device. GUM's sign-in services check your login token when you sign in, return your address salt and generate a zero-knowledge proof. The proof shows validators that the token is genuine and ties the session key to your address, without revealing the token. **Your email and social account ID never go on-chain, and GUM doesn't store them.** For a plain-language overview, see [Private social login](/accounts/openidzk). ## The nonce binding The provider copies the OpenID Connect `nonce` into the token it signs. Your device sets it to: ```formula nonce = base64url( SHA-256( session_pubkey ‖ exp_slot ‖ user_rand ) ) ``` | Input | Size | What it is | | ---------------- | -------------------------- | ------------------------------------- | | `session_pubkey` | 32 bytes | The session key's Ed25519 public key | | `exp_slot` | 8 bytes, u64 little-endian | The slot at which the session expires | | `user_rand` | 8 bytes, u64 little-endian | A random value chosen at sign-in | The nonce is 43 base64url characters, without padding. Because the provider's signature covers it, the token authorizes exactly this session key until this slot. ## The address and its salt ```formula digest = SHA-256( authority_account ‖ sub ‖ salt ) address = digest[0..30] ‖ 0x40 ‖ bump ``` | Input | What it is | | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | `authority_account` | A 32-byte account in GUM Network's OpenID registry for one provider and one client ID (`aud`). It lists that provider's registered signing keys. | | `sub` | The provider's ID for your account, taken from the token and padded with zeros to 256 bytes | | `salt` | Returned by GUM's salt service for your account | | `bump` | The smallest value that puts the address off the Ed25519 curve, as for every [typed address](/protocol/typed-signatures#addresses) | The salt keeps your address unlinkable to your social account: without it, anyone who knew your provider account ID could hash it with the public authority account and find your address. The salt service returns the same salt each time you sign in with the same account, so the same sign-in derives the same address. Each provider has its own authority account, so Google, Apple and X sign-ins give different addresses, even for the same person. ## The proof The proof is a 256-byte Groth16 proof on the BN254 curve: point A (G1, 64 bytes), point B (G2, 128 bytes) and point C (G1, 64 bytes), all uncompressed. It shows that the prover knows an ID token for which: 1. The RS256 signature is valid under the public RSA-2048 modulus, with exponent 65537. 2. The `nonce` claim equals the nonce hash above, for the public session key and expiry slot. 3. The `aud` claim equals the public `aud`. 4. The first 30 bytes of `SHA-256(authority_account ‖ sub ‖ salt)`, with `sub` read from the token, equal the first 30 bytes of the public address. The token's header and payload, its RSA signature, `sub`, `user_rand` and the salt are private inputs: the proof doesn't reveal them, and none goes on-chain. The token's header and payload can be up to 1,524 bytes in base64url, and the decoded payload up to 1,143 bytes. Validators rebuild all 29 public inputs, each a BN254 field element, from the signature and the signer's address, so a proof only verifies for the address it was made for. ## What validators check 1. **Signature verification.** The signature is at most 816 bytes. The signer's address carries tag `0x40` in byte 30 and the smallest bump. The Groth16 proof verifies against the rebuilt public inputs, and the session key's Ed25519 signature verifies over the message. 2. **Expiry.** The transaction is rejected once the current slot reaches `exp_slot`. 3. **Registry.** The authority account must exist and belong to the OpenID registry program. The `aud` registered on it must equal the signature's `aud`, and the hash of the signature's RSA key must be one of the keys it lists. Validators read provider keys from the on-chain registry, never from the provider. When a provider rotates its signing keys, the registry follows, and sessions proven with a retired key stop verifying. The GUM app then asks you to sign in again. ## Signature layout and size ```layout OpenIDZK (0x40) signature 1 byte tag, 0x40 32 bytes authority_account 1 byte key spec, 0 = RSA with RS256 2 + 256 bytes RSA modulus, with a compact-u16 length 1–2 + n bytes aud, with a compact-u16 length, n ≤ 160 2 + 256 bytes Groth16 proof, with a compact-u16 length 32 bytes session_pubkey 8 bytes exp_slot, u64 little-endian 64 bytes session key's Ed25519 signature over the message ``` The signature is 655 bytes plus the length of `aud`, or one byte more when `aud` is longer than 127 bytes, up to 816 bytes. A typical Google client ID is 72 bytes, which gives a 727-byte signature. See [Transaction wire format](/protocol/wire-format). ## Providers | Provider | Where the ID token comes from | | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Google | Google's OpenID Connect sign-in | | Apple | Sign in with Apple. New Apple sign-ups are paused during an Apple sign-in migration. | | X | X has no native OpenID Connect, so a GUM-run OpenID bridge signs you in with X and issues an RS256 ID token that carries your nonce. Its `sub` is a hash of your X user ID, not the ID itself. | --- ## Transaction wire format URL: https://docs.gum.ag/protocol/wire-format Markdown: https://docs.gum.ag/protocol/wire-format.md Description: The byte layout of a GUM Network transaction: typed signature records in front of an unchanged Solana legacy message, and the Solana features GUM Network removes. A GUM Network transaction is an unchanged Solana legacy message with typed signature records in front. **Standard Solana SDKs can't build or parse GUM Network transactions**: they write bare 64-byte Ed25519 signatures, without the length and tag GUM Network requires. For the signature types, see [Typed signatures and addresses](/protocol/typed-signatures). ## How it differs from Solana | | Solana | GUM Network | | ---------------------------------- | -------------------- | ----------------------------------------------------------------------- | | Signature schemes | Ed25519 only | Eight, identified by a type tag | | One signature on the wire | 64 bytes | Length, tag and payload: 66 bytes for Ed25519 | | Maximum transaction size | 1,232 bytes | 12,320 bytes | | Message formats | Legacy and v0 | Legacy, plus a batched format for GUM batch transactions | | Address lookup tables | Yes, in v0 messages | No | | Durable nonces | Yes | No | | Signature-verification precompiles | Ed25519, secp256k1 | None | | Transaction ID | The first signature | Derived from the first signature, see [Transaction ID](#transaction-id) | ## Layout ```layout compact-u16 n, the number of signatures n records, each: compact-u16 L, the record length (1 + payload length) u8 type tag L − 1 bytes payload message Solana legacy message, byte for byte ``` - `n` must equal the message's required signature count, its first byte. - Record _i_ signs for account key _i_ of the message, which for typed signers is a [typed address](/protocol/typed-signatures#addresses). Every record is verified against the serialized message. - Tools may mark an unsigned slot with a single `0x00` length byte, but validators reject a transaction until every slot is signed. **compact-u16** is Solana's variable-length integer (shortvec): 7 bits per byte, lowest first, top bit set when another byte follows. Values up to 127 take one byte. ### The message ```layout u8 required signature count u8 read-only signed account count u8 read-only unsigned account count compact-u16 account count, then 32 bytes per account key, signers first 32 bytes recent blockhash compact-u16 instruction count, then the instructions ``` The first byte must be below `0x80`, or `0x81` for GUM Network's batched format, which only approved senders can submit. ## Worked example: one Ed25519 signer ```layout offset bytes meaning 0 01 1 signature 1 41 record length 65 2 00 tag 0x00, Ed25519 3–66 64 bytes Ed25519 signature over the message 67– … Solana legacy message ``` ## Record sizes | Type | Record: tag and payload | On the wire, with length | | --------------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------------------------------- | | Ed25519 `0x00` | 65 bytes | 66 bytes | | Secp256k1 `0x01`, Secp256r1 `0x02`, Ethereum `0x10` | 98 bytes with a compressed key, 130 with an uncompressed key | 99 or 132 bytes | | Passkey `0x20` | 249 bytes or more, depending on the WebAuthn data | 251 bytes or more | | OpenIDZK `0x40` | 655 bytes plus the `aud` length, at most 816 | 657 bytes plus the `aud` length, at most 818 | | Delegation `0x06` | 105 bytes, plus the authorization and its length | 173 bytes with an Ed25519 authorization, 239 with an Ethereum one | | Sub-account delegation `0x60` | As `0x06`, plus 32 bytes | 205 bytes with an Ed25519 authorization, 271 with an Ethereum one | For an OpenIDZK `aud` longer than 127 bytes, add one byte. See [OpenIDZK proofs](/protocol/openidzk-proofs#signature-layout-and-size). ## Transaction ID A transaction's ID comes from its first signature and is written in base58: - **Ed25519:** the 64-byte signature itself, as on Solana. - **Every other type:** the SHA-512 hash of the typed signature bytes, tag included, also 64 bytes. ## Removed Solana features | Feature | On GUM Network | | ------------------------------------- | ------------------------------------------------------------------------------------------------- | | v0 messages and address lookup tables | Rejected, and there's no address lookup table program. List every account in the message itself. | | Durable nonces | Every nonce instruction in the System Program fails. Use a recent blockhash. | | Signature-verification precompiles | Not installed. Use typed signatures instead. | --- ## Overview URL: https://docs.gum.ag/universal-deposit/overview Markdown: https://docs.gum.ag/universal-deposit/overview.md Description: Get dollars to any supported chain. Send USDC, USDT, USDG — or a supported token — on whichever chain you like; swapping and bridging are handled for you. import { CardGroup_1 } from "../../components/universal-deposit/overview/CardGroup_1.jsx"; import { AccordionGroup_1 } from "../../components/universal-deposit/overview/AccordionGroup_1.jsx"; The preview is the real widget on mainnet. For generated deposit addresses, send only the network's dollar token (USDC; USDT on BSC, USDG on Robinhood), or a token the widget lists for that network, and meet the applicable minimum — unsupported tokens are **not recoverable**. ## Two ways to integrate ## Supported chains | Chain | Chain ID | Dollar token | Address format | Explorer | | --------- | -------- | ------------ | ---------------------------------------------- | ---------------------------------------------------------------------- | | Solana | `900` | USDC | Solana wallet address (base58, 32-byte pubkey) | [solscan.io](https://solscan.io) | | Ethereum | `1` | USDC | EVM address (`0x…`, 40 hex chars) | [etherscan.io](https://etherscan.io) | | Base | `8453` | USDC | EVM address (`0x…`, 40 hex chars) | [basescan.org](https://basescan.org) | | Arbitrum | `42161` | USDC | EVM address (`0x…`, 40 hex chars) | [arbiscan.io](https://arbiscan.io) | | BSC | `56` | USDT | EVM address (`0x…`, 40 hex chars) | [bscscan.com](https://bscscan.com) | | Robinhood | `4663` | USDG | EVM address (`0x…`, 40 hex chars) | [robinhoodchain.blockscout.com](https://robinhoodchain.blockscout.com) | | Sui | `101` | USDC | Sui address (`0x…`, 64 hex chars) | [suivision.xyz](https://suivision.xyz) | The **dollar token** is what a chain settles in: it's the token you send when depositing from that chain without a swap, and the token that lands when that chain is the destination. Any supported chain can be the destination or the source. Send only the chain's dollar token or a token listed as quotable by the [token APIs](/universal-deposit/api-reference/overview#building-a-token-picker), using the exact token address the API returns. Unsupported tokens sent to a deposit address or tokens sent to the wrong chains are not recoverable. ## FAQ --- ## Embed the widget URL: https://docs.gum.ag/universal-deposit/embed Markdown: https://docs.gum.ag/universal-deposit/embed.md Description: One iframe. Hand it a destination and it handles deposit addresses, QR codes, and wallet transfers. import { Card_1 } from "../../components/universal-deposit/embed/Card_1.jsx"; import { Accordion_1 } from "../../components/universal-deposit/embed/Accordion_1.jsx"; One ` ``` Replace `YOUR_ARBITRUM_ADDRESS` with the address that should receive the deposits, and `chainId` with its chain. Deposits go to that address only when `hideDestination=true`. By default, the widget has two tabs. **Transfer Manually** shows a deposit address and QR code for the sender to pay from anywhere. **Wallet Deposit** connects the sender's browser wallet, lets them pick a balance and amount, and signs the transfer in place. Funds go to the `destinationAddress` you set, but senders can switch it with **Change** unless you set `hideDestination=true`. Set `disableWalletDeposit=true` for manual deposits only: the deposit address and QR code remain, and both tabs are hidden. ## Parameters Everything is passed as query params on the iframe `src`. | Param | Meaning | | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `destinationAddress` | **Required.** Where the funds land, in the destination chain's own format (see [supported chains](/universal-deposit/overview#supported-chains)). | | `chainId` | The **destination** chain — `900` Solana, `1` Ethereum, `8453` Base, `42161` Arbitrum, `56` BSC, `4663` Robinhood, `101` Sui. Funds land as that chain's dollar token (USDC; USDT on BSC, USDG on Robinhood). Defaults to `900`. | | `alwaysSettleInUsdc` | `true` (default) or `false` — see below. | | `sourceChainId` | Pins the network the sender pays from (same IDs as `chainId`). The network selector becomes a static field, tokens are filtered to that network, and an unsupported pin shows an error instead of another network's address. Omit to let the sender pick. | | `mode` | `address` (default) opens on Transfer Manually; `wallet` opens on Wallet Deposit. Both tabs stay visible unless `disableWalletDeposit=true`. | | `disableWalletDeposit` | `true` locks the widget to Transfer Manually and hides both tabs, including when `mode=wallet`. Defaults to `false`. | | `hideDestination` | `true` hides the Destination rows and the **Change** button in every screen, so senders can't redirect their deposit. Set it whenever deposits must reach your address, such as top-ups and payments. The deposit address, QR code, and chain badges stay. Defaults to `false`. | | `theme` | `dark` (default), `light`, or `auto` — see [Theming](#theming). | | `backgroundColor` | Card background: `#RGB`, `#RRGGBB`, or `transparent`. Omit for the theme default. Encode `#` as `%23` in the URL — see [Card background](#card-background). | | `qrColor` | QR foreground: opaque `#RGB` or `#RRGGBB`. Colors the QR pattern and corner markers — see [QR colors](#qr-colors). | | `qrBackgroundColor` | QR card, quiet area, and logo backing: opaque `#RGB` or `#RRGGBB`. Omit both QR params for theme defaults — see [QR colors](#qr-colors). | The destination chain and address use the same values as the [deposit-addresses API](/universal-deposit/api-reference/get-deposit-addresses), so an address you already resolved there drops into the iframe URL unchanged. ### Always settle in USDC | `alwaysSettleInUsdc` | What the viewer sees | | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `true` (default) | Supported tokens settle as the destination network's dollar token (USDC; USDT on BSC, USDG on Robinhood) in both tabs, including deposits on the destination network. Wallet Deposit transfers the canonical dollar token directly when it is already on that network; other tokens are converted. | | `false` | Transfer Manually shows the raw receiving address when the sender picks the destination network — the token isn't converted, but the deposit still routes through Gum. Wallet Deposit also transfers on that network. Deposits from other networks route through Gum and settle as the destination network's dollar token. | ## Crediting deposits The widget doesn't tag a deposit with who sent it. Each destination has fixed [deposit addresses](/universal-deposit/how-it-works#deposit-addresses), so everyone who deposits to the same `destinationAddress` pays into the same addresses, and a shared address can't tell senders apart. To credit individual customers, give each customer their own destination address, for example a deposit account per customer in your wallet or custody system, and embed the widget with that customer's address. Credit what arrives there: the destination network's dollar token, after the fees in [Deposit costs and estimates](/universal-deposit/deposit-costs). ## Theming The widget defaults to dark. Pick its appearance with the `theme` param: | `theme` | What the viewer sees | | ---------------- | ------------------------------------------------------------------------------------------------------------ | | `dark` (default) | The dark widget, regardless of the viewer's OS setting. | | `light` | The light widget. | | `auto` | Follows the viewer's `prefers-color-scheme`, live — including OS appearance switches while the page is open. | The page around the card is transparent in every theme, so your own background shows through. ### Card background Set `backgroundColor` to a three- or six-digit hex color, or `transparent`. Values are trimmed and case-insensitive; missing, empty, or invalid values use the theme's default background. The override applies to the card in every screen, including loading and error states. The iframe page around it stays transparent. `theme` still controls text, inputs, menus, and default QR colors, so choose a theme that contrasts with your background. With `transparent`, your page's background shows through the card too. For example, configure manual deposits only with custom card and QR colors: ```js const params = new URLSearchParams({ chainId: "42161", destinationAddress: "YOUR_ARBITRUM_ADDRESS", disableWalletDeposit: "true", theme: "light", backgroundColor: "#f3f4f6", qrColor: "#1f2937", qrBackgroundColor: "#ffffff", }); const frame = document.querySelector('iframe[title="Universal Deposit"]'); frame.src = `https://gum.ag/embed/universal-deposit?${params}`; ``` `URLSearchParams` encodes `#` as `%23`. A raw `#` starts a URL fragment and will not reach the widget as a color. Changing card or QR colors requires updating the iframe `src`, which reloads it. The wallet's **Open in a new tab** link preserves valid background colors and the resolved custom QR palette. ### QR colors `qrColor` sets the QR pattern and corner markers. `qrBackgroundColor` sets the QR card, the clear area around the pattern, and the backing behind its logo. The outer widget card uses `backgroundColor` independently. Both QR params accept only opaque `#RGB` or `#RRGGBB` values. Values are trimmed and case-insensitive; transparent and alpha colors are unsupported. Invalid values are ignored individually. If only one valid QR color is supplied, the widget chooses black or white for the missing color, whichever gives higher luminance contrast. If both supplied colors are valid but their contrast is below **4.5:1**, the widget uses the theme's default QR colors instead. This is a conservative product guard; it does not guarantee scanning on every device. Test your palette with real QR scanners at your intended embed size before using it in production. A valid custom QR palette keeps both colors fixed across theme changes. Omit both QR params, or select **Default** in the playground, for QR colors that follow the theme. Low-contrast pairs also fall back to theme-following defaults. ### Live theme changes If your page has its own theme toggle, switch the widget in place, with no reload, by posting a message into the frame. Messages are idempotent, so rapid toggles settle on the last theme requested: ```js const frame = document.querySelector('iframe[title="Universal Deposit"]'); frame.contentWindow.postMessage( { type: "ud-embed:set-theme", theme: "light" }, // or "dark" / "auto" "https://gum.ag", ); ``` A reloaded frame boots from its URL's `theme` param, not the last message. If you swap the frame's `src` while your page keeps state, re-post the current theme on its `load` event. ## Sizing The widget is centered and capped at **375 px** wide, and shrinks to fit narrower containers. Start with a `375 × 620` iframe and `max-width:100%`. Wallet screens have different heights, so listen for the widget's resize messages and assign the height directly. They already include intermediate heights during transitions, so don't add your own transition on the iframe: ```js const frame = document.querySelector('iframe[title="Universal Deposit"]'); window.addEventListener("message", (event) => { if ( event.origin === "https://gum.ag" && event.source === frame.contentWindow && event.data?.type === "ud-embed:resize" && Number.isFinite(event.data.height) ) { frame.style.height = `${Math.max(200, event.data.height)}px`; } }); ``` Keep `allow="clipboard-write"` so the copy-address button inside the frame works. Some mobile wallet browsers only expose their connection to top-level pages; Wallet Deposit offers **Open in a new tab** inside iframes and carries every setting across. If you sandbox the iframe, allow scripts, same-origin access, popups, and popups escaping the sandbox. ## How wallet deposits work ## Content Security Policy If your page sets a Content Security Policy, allow the frame with `frame-src https://gum.ag`. The widget sends its own requests from inside the frame, so the hosted embed needs no other entries on your page. The policy under [Self-hosting](#self-hosting) applies only when you host the widget yourself. ## Self-hosting The hosted embed at `gum.ag` proxies every request it needs. If you host the widget yourself, the server-only `UD_EMBED_API_KEY` authenticates deposit-address and deposit-status requests and stays on the server. Use the same key for both, or status lookups return an empty list. Your page's Content Security Policy must allow `https://api.gum.ag` in `connect-src` for token balances, chain RPC, and quotes, plus `https://ultra-api.jup.ag` for Solana token-account discovery. Wallet transactions are signed and sent by the user's wallet, so no chain RPC origins need to be allowed on the page. If you configure devnet gum-services, also allow `https://dev-api.gum.ag`. --- ## How Universal Deposit works URL: https://docs.gum.ag/universal-deposit/how-it-works Markdown: https://docs.gum.ag/universal-deposit/how-it-works.md Description: What happens between a deposit landing on a source chain and dollars arriving at the destination. import { Steps_1 } from "../../components/universal-deposit/how-it-works/Steps_1.jsx"; import { AccordionGroup_1 } from "../../components/universal-deposit/how-it-works/AccordionGroup_1.jsx"; import { CardGroup_1 } from "../../components/universal-deposit/how-it-works/CardGroup_1.jsx"; A Universal Deposit address doesn't belong to a person. Every address the [deposit-address API](/universal-deposit/api-reference/get-deposit-addresses) returns leads to a **receiver**: an account on [GUM Network](/how-gum-works) controlled by an on-chain program. That program can only move the receiver's funds to the destination it was created for. ## Deposit addresses Each destination gets one receiver per API key, so two integrators get different deposit addresses for the same wallet. A receiver has one deposit address per chain family: one for EVM chains, one for Solana and one for Sui. The EVM chains share an address, but each has its own [dollar token and minimum](/universal-deposit/overview#supported-chains). Addresses never change, so they can be reused indefinitely. Every deposit goes through the receiver and pays the bridge fee, even one that starts and ends on the same chain. The widget's [direct transfer](/universal-deposit/deposit-costs#destination-token) is the exception: it skips Universal Deposit and sends tokens straight to the wallet. ## Detection and conversion GUM only acts on deposits recorded on GUM Network and attested by DOVES. The token and amount come from that record, and each deposit is processed once, so a deposit can't be paid out twice. Settlement happens in dollar tokens. A deposit in any other token is first swapped into the source chain's dollar token, within GUM's [slippage tolerance](/universal-deposit/deposit-costs#slippage). If the destination uses a different dollar token, for example USDC on Base to USDT on BNB Chain, it's converted as part of the payout. Only tokens with a live swap route can be converted, which is why the [token APIs](/universal-deposit/api-reference/overview#building-a-token-picker) only list quotable tokens. ## Delivery In one transaction, the program sends the [bridge fee](/universal-deposit/deposit-costs#bridge-and-swap-fees) to GUM and requests a withdrawal of the rest to the destination. DOVES then pay it out on the destination chain. Funds usually show up in the wallet within minutes; on Ethereum, Base, Arbitrum and Robinhood, final confirmation takes another 13 to 20 minutes. ## Custody and trust * **No private key controls a receiver.** Only the program can move its funds, and only to its own destination. * **GUM runs delivery.** GUM's operator submits each step and sets the fee rate. There's no claim a depositor can trigger themselves. The [security model](/universal-deposit/security-model) covers the program, its roles and its trust assumptions in detail. ## When something goes wrong --- ## Universal Deposit security model URL: https://docs.gum.ag/universal-deposit/security-model Markdown: https://docs.gum.ag/universal-deposit/security-model.md Description: What the forwarder program guarantees, and what you trust GUM for. Deposited funds sit in a **receiver** on [GUM Network](/how-gum-works), controlled by the forwarder program `udpZn12nNpW1LyEjDSdjXtH4quYqbJinFWBHDrRVDRp`. No private key controls a receiver. ## What the program guarantees - **Funds only go to your destination.** The destination is fixed when the receiver is created, and no one can send its funds anywhere else. - **Each deposit is paid out once,** for the amount recorded on GUM Network. ## What you trust GUM for - **Delivery.** Only GUM's operator can move funds forward. There's no claim or refund a depositor can trigger themselves. If the operator stops, funds wait in the receiver. - **Fees and slippage.** GUM sets the [fee rate](/universal-deposit/api-reference/get-deposit-addresses#fee-schedule) and [slippage tolerance](/universal-deposit/deposit-costs#slippage). These are GUM policy, not on-chain limits. - **DOVES.** Deposits are held in GUM's bank on the source chain and paid out by [DOVES](/how-gum-works#gum-runtime), as with every GUM deposit. GUM can pause the program in an emergency. A pause stops new swaps and payouts, but can't recall one already sent. --- ## Using the API URL: https://docs.gum.ag/universal-deposit/api-reference/overview Markdown: https://docs.gum.ag/universal-deposit/api-reference/overview.md Description: Public endpoints: run a deposit, resolve a deposit address back to its destination, build a token picker that only offers depositable tokens, and price the fee rate. import { CardGroup_1 } from "../../../components/universal-deposit/api-reference/overview/CardGroup_1.jsx"; Everything the embed widget does is plain HTTP. One host, read-only: | Base URL | Endpoints | Auth | CORS | | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | ------------------------------- | | `https://api.gum.ag/ud` | [`/v2/deposit-addresses`](/universal-deposit/api-reference/get-deposit-addresses), [`/v1/deposit-addresses/lookup`](/universal-deposit/api-reference/lookup-deposit-addresses), [`/token/search`](/universal-deposit/api-reference/get-token-search), [`/top-mcap`](/universal-deposit/api-reference/get-top-mcap), [`/v2/fees/stable-tokens`](/universal-deposit/api-reference/get-stable-tokens) | Public, no key | None — call it from your server | The test network is served from `https://gum-api.jup.net/ud/devnet`. All chains use the same numeric IDs everywhere: `900` Solana, `1` Ethereum, `8453` Base, `42161` Arbitrum, `56` BSC, `4663` Robinhood, `101` Sui (see [supported chains](/universal-deposit/overview#supported-chains)). ## The deposit loop 1. **Get deposit addresses for the destination.** Call [`/v2/deposit-addresses`](/universal-deposit/api-reference/get-deposit-addresses) with the destination `chainId` and `destinationAddress`. You get one deposit address per source chain, plus that chain's dollar token (`tokenAddress`), minimum deposit, flat fee, and health status. Anything sent to a deposit address is bridged to the destination and settles as the destination chain's dollar token. 2. **Only offer tokens the pipeline can convert.** The dollar token from step 1 always works. Any other token must be quotable: listed by [`/top-mcap`](/universal-deposit/api-reference/get-top-mcap) for that chain, or returned by [`/token/search`](/universal-deposit/api-reference/get-token-search) with `quotableOnly=true`. Quotable tokens are auto-swapped to the dollar token and settle like any other deposit, with the swap cost absorbed into the conversion. If the swap fails, it is retried until it clears; funds aren't lost, and the receiver can reach out on [Discord](https://discord.gg/gum-ag) if it still hasn't settled. Hide chains whose `status` from step 1 isn't healthy. 3. **Show the sender the address.** Display the deposit address and QR for the chain the sender picked, with the minimum and the token they must send. The destination chain is the source of truth for arrival; watch the destination address on its explorer. [How it works](/universal-deposit/how-it-works) covers what happens after the sender funds the address. ## Building a token picker If you let senders pay with tokens other than the dollar token, you need a list of tokens that Universal Deposit can actually convert. Two endpoints feed that list, and they carry different guarantees: | Endpoint | Scope | Guarantee | | --------------------------------------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------- | | [`/top-mcap?chainId=`](/universal-deposit/api-reference/get-top-mcap) | Top tokens on one chain | Every row is quotable. Use it as the default list. | | [`/token/search?query=`](/universal-deposit/api-reference/get-token-search) | Free text or address, all chains | Add `quotableOnly=true` to get only convertible tokens, then keep rows on your chain. | **What quotable means.** A token is quotable when a live \$1000 buy-and-sell round trip through the swap pipeline passed within the last 30 minutes. It is the same probe that decides whether a swapped deposit can be routed, so a quotable token is one Universal Deposit can convert. It does not consider the deposit minimum or whether the chain is up: apply `minDeposit` and `status` from `/v2/deposit-addresses` yourself. This is exactly what the embed widget does: `/top-mcap` populates the list, `/token/search` handles typing, and both are filtered to `isQuotable === true` on the selected chain. --- ## Deposit addresses URL: https://docs.gum.ag/universal-deposit/api-reference/get-deposit-addresses Markdown: https://docs.gum.ag/universal-deposit/api-reference/get-deposit-addresses.md Description: Returns a deposit address on each supported chain for your destination — whatever lands on them is bridged to the destination address you supplied. ## Query parameters | Parameter | Required | Description | | -------------------- | -------- | -------------------------------------------------------------------------------------- | | `chainId` | Yes | Destination chain ID: `900` (Solana), `1` (Ethereum), `8453` (Base), `42161` (Arbitrum), `56` (BSC), `4663` (Robinhood), `101` (Sui). | | `destinationAddress` | Yes | Address on the destination chain where the funds should end up. | The address must match the destination chain's format — base58 32-byte pubkey for Solana, `0x` + 40 hex chars for EVM chains, `0x` + 64 hex chars for Sui. Funds land as the destination chain's dollar token: USDC on most chains, USDT on BSC, USDG on Robinhood (see [supported chains](/universal-deposit/overview#supported-chains)). ## Response One entry per supported source chain in `chains[]`: | Field | Description | | ---------------- | ------------------------------------------------------------------ | | `chainId` | Source chain ID. | | `chainName` | Human-readable chain name. | | `chainType` | Chain family, e.g. `evm`, `solana`, `sui`. | | `status` | Chain health: `{ code, name }` — see below. | | `depositAddress` | Where to send funds on this chain. | | `tokenAddress` | This chain's dollar token — the token to send without a swap (USDC; USDT on BSC, USDG on Robinhood). | | `minDeposit` | Minimum deposit of the dollar token. Deposits below this may be lost. | | `feesUsd` | **Deprecated** — the [bridge fee](/universal-deposit/deposit-costs#bridge-and-swap-fees) at the base rate only, equal to `feeSchedule.baseUsd`. Use `feeSchedule`. | | `feeSchedule` | How the bridge fee scales with the deposit — see below. Absent on chains that charge `feesUsd` flat. | | `feeBps` | The rate applied to this chain's own dollar token, in basis points. Same as `feeSchedule.stableBps`. | | `feeRouteAvailable` | `false` when this chain currently has no route to the fee service. Its fees fall back to `feeSchedule`. | | `estimatedLandingSecs` | Median seconds from GUM crediting a deposit on this chain until it lands at your destination, measured over the last 7 days. `null` until enough deposits on the route have been observed. | `minDeposit` applies to the chain's dollar token. Other tokens are swapped first and must also cover the swap cost, so keep those deposits comfortably above it. ### Fee schedule The bridge fee is not flat. `feeSchedule` gives the rule so you can price a deposit of any size before it is sent: | Field | Description | | ------------ | ------------------------------------------------------------------------- | | `model` | Currently always `maxBaseBps`. Treat an unrecognised model as flat `feesUsd`. | | `formula` | The rule in full: `max(base,ceil(gross*bps/10000))`. | | `baseUsd` | The minimum fee in USD, as a decimal string. It depends on the **destination** chain, so the same source chain quotes more to Ethereum than to Arbitrum. | | `stableBps` | Rate for stablecoin deposits, in basis points. | | `otherBps` | Rate for everything else — ETH, SOL, WBTC, Earn tokens. | | `feeDecimals` | Decimal places the fee is rounded up to. | The base fee is the minimum; the bps leg takes over once the deposit is large enough. A $500 USDC deposit at 2 bps and a $0.30 base pays $0.30, while $300,000 pays $60. It reports only the base fee, so on any deposit large enough for the bps leg to take over it understates what is charged. Price deposits from `feeSchedule`. ```json { "chainId": 8453, "chainName": "Base", "chainType": "evm", "status": { "code": 0, "name": "healthy" }, "depositAddress": "0xb3b82925986054aedaea21f521EAb883A80008E5", "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "minDeposit": "3", "feesUsd": 0.3, "estimatedLandingSecs": 42, "feeBps": 2, "feeRouteAvailable": true, "feeSchedule": { "model": "maxBaseBps", "formula": "max(base,ceil(gross*bps/10000))", "baseUsd": "0.3", "stableBps": 2, "otherBps": 10, "feeDecimals": 6 } } ``` `estimatedLandingSecs` starts when GUM has credited the deposit, so it excludes the source chain's own confirmation time and any auto-swap. ### Chain status | `status.code` | Meaning | What to do | | ------------- | -------- | ------------------------------------------------------- | | `0` | Healthy | Safe to deposit. | | `1` | Degraded | Deposits work but may be slower than usual. | | `2` | Down | **Don't send funds on this chain** — retry later. | | `3` | Hidden | Chain isn't enabled on this network. It's omitted from `chains[]`. | Treat a chain as unavailable when `status.code` is `2` or higher, or `depositAddress` is missing. Do not display it as a deposit option — funds sent to an unavailable chain may be delayed. --- ## Resolve deposit addresses URL: https://docs.gum.ag/universal-deposit/api-reference/lookup-deposit-addresses Markdown: https://docs.gum.ag/universal-deposit/api-reference/lookup-deposit-addresses.md Description: Takes deposit addresses and returns the destination each one settles to — the reverse of /v2/deposit-addresses, for reconciling where funds actually land. [`/v2/deposit-addresses`](/universal-deposit/api-reference/get-deposit-addresses) goes one way: a destination in, a deposit address per chain out. This endpoint goes the other way. Give it deposit addresses and it returns the destination each one bridges to. Use it to reconcile transfer history. A sender funds a GUM-generated deposit address, so their on-chain record shows that address, not the destination the funds settle to. Batch those addresses through this endpoint to recover the real destination behind each one — which destination received the deposit, and on which chain. ## Request body | Field | Required | Description | | ----------------- | -------- | --------------------------------------------------------------------------- | | `depositAddresses` | Yes | Deposit addresses to resolve, 1–100 per call. Mix chains freely — Solana base58, EVM `0x`, Sui, all in one array. | ```json { "depositAddresses": [ "5Xz1wdD2S5VmUDTQQy8xfk3RmksvSfpZEjDHMQ72DVA1", "0x1c0d68b6d5937359c6291044d9dca230fbdd6d2d" ] } ``` An empty array, or more than 100 addresses, returns `400 INVALID_INPUT_PARAMS`. ## Response `results[]` holds one entry per address you sent, in the same order: | Field | Description | | ---------------- | ------------------------------------------------------------------------ | | `depositAddress` | The address you asked about, echoed back. | | `destination` | Where this deposit address settles, or `null` if it isn't a GUM deposit address — see below. | When `destination` is present: | Field | Description | | --------- | --------------------------------------------------------------------------------- | | `chainId` | Destination chain ID: `900` (Solana), `1` (Ethereum), `8453` (Base), `42161` (Arbitrum), `56` (BSC), `4663` (Robinhood), `101` (Sui). | | `address` | The destination address on that chain — where the funds end up. | ```json { "results": [ { "depositAddress": "5Xz1wdD2S5VmUDTQQy8xfk3RmksvSfpZEjDHMQ72DVA1", "destination": { "chainId": 8453, "address": "0xAbc6333EF3CC774A845905De7BAFA18A00d97908" } }, { "depositAddress": "0x1c0d68b6d5937359c6291044d9dca230fbdd6d2d", "destination": { "chainId": 8453, "address": "0xAbc6333EF3CC774A845905De7BAFA18A00d97908" } } ] } ``` Several deposit addresses can map to the same destination: every source chain's deposit address for a destination resolves back to that one destination. `destination` is `null` whenever the address isn't a live GUM deposit address — a wallet, a contract, a typo, or an address from a different system all come back `null` rather than erroring. A `null` means "not ours," not "lookup failed," so never treat it as a destination. --- ## Token search URL: https://docs.gum.ag/universal-deposit/api-reference/get-token-search Markdown: https://docs.gum.ag/universal-deposit/api-reference/get-token-search.md Description: Search tokens by name, symbol, or address across every supported chain, then keep the ones Universal Deposit can convert. Served from `https://api.gum.ag/ud`, the same base URL as deposit addresses. No API key. CORS is not open, so call it from your server or through a same-origin proxy. ## Query parameters | Parameter | Required | Description | | -------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | `query` | Yes | Free text (name or symbol) or a token address. Sui coin types (`0x…::module::SYMBOL`) work as addresses. | | `quotableOnly` | No | `true` returns only tokens Universal Deposit can convert (`isQuotable: true`), probing unchecked rows first. **Use this for a deposit picker.** | Search is **cross-chain**: one query returns matches from every supported chain, each row tagged with its `originChainId`. There is no chain filter on the request; filter the response. `ETH`, `WETH`, `BTC`, `WBTC`, `cbBTC`, and `SOL` also include that asset's wrapped version on each supported chain (Arbitrum ETH, Base cbBTC, Solana portal ETH, and so on). The canonical row stays first. ## Response `results` is an array of token rows ordered by relevance. Rows carry full market metadata, but these are the fields that matter for deposits: | Field | Meaning | | ----------------- | ------------------------------------------------------------------------------------------------------------- | | `symbol`, `name` | Display values. `name` and `uri` can be missing on some rows. | | `originChainId` | The chain this row lives on (`900`, `1`, `8453`, `42161`, `56`, `4663`, `101`). | | `originChainMint` | The token address on that chain. EVM addresses are checksummed; compare them case-insensitively. Sui addresses are zero-padded to 64 hex characters, except native SUI which is `0x2::sui::SUI`. | | `uri` | Icon URL. | | `isQuotable` | `true` when the token passed a live swap round trip within the last 30 minutes. **Absent** when it hasn't been checked, `false` when it failed. | | `isTradable` | Same probe, same value. Present for compatibility. | | `isVerified` | Listed on a verified registry. Informational only. | ## Keeping only depositable tokens The endpoint is shared with the GUM app's own search, so by default it returns popular tokens even when they aren't quotable. For a deposit picker pass `quotableOnly=true`, then keep the rows on the sender's chain: ```js const { results } = await fetch( `https://api.gum.ag/ud/token/search?quotableOnly=true&query=${encodeURIComponent(q)}`, ).then((r) => r.json()); const depositable = results.filter((t) => t.originChainId === chainId); ``` Without the flag, filter on `isQuotable === true` yourself; the field is present either way. A quotable token is one the swap pipeline can convert to the chain's dollar token, which is what makes it depositable. The check is cached for 30 minutes and ignores two things you still have to handle: - **Minimum amount.** Quotable says nothing about how much must be sent. A swapped deposit must also clear its swap cost, so keep senders comfortably above the chain's `minDeposit`. - **Chain status.** A token on a paused chain still shows as quotable. Use the `status` from [`/v2/deposit-addresses`](/universal-deposit/api-reference/get-deposit-addresses) to hide chains that are down. When `query` is a pasted address, the first response can come back before the quotability check has run, with no `isQuotable` field at all. The result is cached, so a second request a moment later carries the flag. The chain's own dollar token (USDC, USDT on BSC, USDG on Robinhood) is always depositable regardless of this flag; it's the `tokenAddress` returned by `/v2/deposit-addresses`. For a ready-made default list that is already filtered, use [`/top-mcap`](/universal-deposit/api-reference/get-top-mcap). --- ## Top tokens URL: https://docs.gum.ag/universal-deposit/api-reference/get-top-mcap Markdown: https://docs.gum.ag/universal-deposit/api-reference/get-top-mcap.md Description: The top tokens by market cap on one chain, already filtered to the ones Universal Deposit can convert. Served from `https://api.gum.ag/ud`, the same base URL as deposit addresses. No API key. CORS is not open, so call it from your server or through a same-origin proxy. ## Query parameters | Parameter | Required | Description | | --------- | -------- | ------------------------------------------------------------------------------------ | | `chainId` | Yes | The chain to list: `900`, `1`, `8453`, `42161`, `56`, `4663`, or `101`. Anything else is a `400`. | ## Response `results` holds up to 100 tokens ordered by market cap, and `total` is the count. Every row has passed the quotability check, so the list can go straight into a picker without further filtering: | Field | Meaning | | ----------------- | --------------------------------------------------------------------------- | | `symbol`, `name` | Display values. | | `originChainId` | Always the requested chain. | | `originChainMint` | Token address on that chain. The chain's dollar token is always included. | | `uri` | Icon URL. | | `isQuotable` | Always `true`. | | `isTradable`, `isVerified` | Informational; may be absent. | The list is rebuilt in the background and served with a 5-minute cache. During an upstream outage the previous list is served for up to 24 hours rather than an empty one, and a rebuild that would shrink the list sharply is rejected, so you won't see a picker suddenly empty out. ## Using it with search `/top-mcap` is the default list; when the sender starts typing, switch to [`/token/search`](/universal-deposit/api-reference/get-token-search) and apply its `isQuotable` filter. Neither list knows whether a chain is up: hide chains whose `status` from [`/v2/deposit-addresses`](/universal-deposit/api-reference/get-deposit-addresses) isn't healthy. --- ## Stable tokens URL: https://docs.gum.ag/universal-deposit/api-reference/get-stable-tokens Markdown: https://docs.gum.ag/universal-deposit/api-reference/get-stable-tokens.md Description: The stablecoins on one chain that Universal Deposit bills at the stable fee rate. A deposit is billed at one of two rates from the [fee schedule](/universal-deposit/api-reference/get-deposit-addresses#fee-schedule): `stableBps` for stablecoins and `otherBps` for everything else. This endpoint is the list of tokens on a chain that count as stablecoins, so you can tell a sender which rate a deposit will pay before it is sent. ## Query parameters | Parameter | Required | Description | | --------- | -------- | ------------------------------------------------------------------------------------ | | `chainId` | Yes | The chain to list: `900`, `1`, `8453`, `42161`, `56`, `4663`, or `101`. Anything else is a `400`. | ## Response `tokens` holds every stablecoin on the requested chain. Each row identifies a token by address; the fields are display-only: | Field | Meaning | | --------------- | ------------------------------------------------------------- | | `chainId` | Always the requested chain. | | `tokenAddress` | Token address on that chain. | | `symbol`, `name`| Display values. | | `tokenImageUrl` | Icon URL. | ```json { "chainId": 900, "tokens": [ { "chainId": 900, "tokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "symbol": "USDC", "name": "USD Coin", "tokenImageUrl": "https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png" }, { "chainId": 900, "tokenAddress": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB", "symbol": "USDT", "name": "USDT", "tokenImageUrl": "https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB/logo.svg" } ] } ``` This is a fee-classification list, not a deposit-eligibility one. A token being stable does not mean it is depositable — a swapped deposit must still be [quotable](/universal-deposit/api-reference/overview#building-a-token-picker), and the chain must be healthy. Use it to price the fee rate, not to build the token picker. --- ## Deposit costs and estimates URL: https://docs.gum.ag/universal-deposit/deposit-costs Markdown: https://docs.gum.ag/universal-deposit/deposit-costs.md Description: What lands at the destination, which fees come off along the way, and what the widget's estimate does and does not include. A deposit can be a plain transfer, a swap, a bridge between networks, or all three. Which fees apply depends on which steps your deposit needs. **Max slippage is not a cap on the total cost.** ## Destination token The receiving wallet gets the **destination chain's dollar token**, not necessarily USDC: | Destination | Token received | | ----------------------------------------------- | -------------- | | Solana, Ethereum, Base, Arbitrum, Sui | USDC | | BNB Chain | USDT | | Robinhood Chain | USDG | This holds for every routed deposit, including a same-network one: sending SOL to a Solana destination still settles as USDC on Solana. The widget names the token in its **You receive** line. The app hosting the widget can also allow **direct transfers** on the receiving network. A direct transfer keeps the token you send and never touches the bridge, so it has no bridge fee, swap fee, or slippage. It still pays the network fee. USDC that is already on the receiving network can move directly even when dollar-token settlement is enabled. ## Receive estimates **You receive** is an estimate for routed deposits: - For the source chain's dollar token, it is the amount sent minus the bridge fee. - For any other supported token, it is the token's latest market value in USD minus the bridge fee. The bridge fee is priced for the exact amount being sent, not assumed, so it already reflects the size of the deposit. The estimate still does **not** subtract the swap fee or price impact described below, so a swapped deposit usually lands slightly under it. The final amount is set when the deposit is [processed](/universal-deposit/how-it-works), minutes after you send; prices and fees can move in between. The preview does not lock a rate or promise a minimum. The preview refreshes every 30 seconds to pick up balances, prices, route availability, and network fees. The countdown keeps the details fresh; it is not a price lock. Direct transfers have no quote expiry. Transfer Manually does not know how much you will send, so it shows no amount-specific estimate. ## Network fees **Gas** or **network fee** is what the source network charges to process your sending transaction. You pay it separately, in that network's native coin such as SOL or ETH. It is never deducted from the receive estimate and is not part of the slippage percentage. In the **Wallet Deposit** tab, the amount field has a **Max** button that fills in your full balance. For a native coin such as SOL or ETH, Max transfer keeps back an estimated network fee so the transaction can still pay for itself. For any other token, Max fills the whole token balance, and your wallet still needs enough native coin on the side to pay the fee. ## Bridge and swap fees Three fees can come off a routed deposit. The widget shows only the first. **Bridge fee.** One rule for every routed deposit: fee = max(base fee, bps × amount). The rate depends on the token you deposit, the base fee on the destination chain. The base fee is the minimum you pay; the bps component takes over once the deposit is large enough. It is already subtracted from the receive estimate, and same-network routed deposits pay it too. | Deposit token | Rate | | ------------------------------------------------------------------ | ------ | | USDC and other stablecoins (USDT, USDS, PYUSD, …) | 2 bps | | Everything else, including Earn tokens (ETH, SOL, WBTC, jupSOL, …) | 10 bps | The exact list of tokens that qualify for the stable rate on a chain is served by [`/v2/fees/stable-tokens`](/universal-deposit/api-reference/get-stable-tokens). | Destination | Base fee (minimum) | | --------------------------- | ------------------------------------- | | Solana, Base, Arbitrum, Sui | $0.30 | | Ethereum | $1.00, indexed to gas with a $1 floor | For example, $500 USDC to Solana pays $0.30; $50,000 USDC to Ethereum pays $10. Both rates and the base fee are returned per route by the deposit-address API in `feeSchedule` (see [Deposit addresses](/universal-deposit/api-reference/get-deposit-addresses#fee-schedule)). Read them from the response instead of hard-coding the tables above. The older `feesUsd` field reports only the base fee and is deprecated. **Swap fee.** If you deposit something other than the source chain's dollar token, it is swapped to USD first. This is the source-chain DEX execution cost that non-stable deposits pay on top of the bridge fee, not a separate GUM rate: the swap takes a trading fee on the converted amount, and its output is subject to price impact and slippage. This is not in the widget's estimate, and the exact rate depends on the token being swapped. ## Minimums Each chain has a minimum deposit for its dollar token, returned as `minDeposit` by the deposit-address API. The widget suggests at least $3, or $10 on Ethereum, so a small deposit is still worth sending after fees. These are suggested deposit amounts, not fee floors. Swapped tokens must also cover the swap fee; below that the swap cannot run. A deposit under the minimum is not lost. It sits at the deposit address and is processed together with the next deposit to the same address once the combined amount clears the minimum. ## Price impact Price impact is how the size of a swap affects its execution price. A large swap, or a token with thin liquidity, gets a worse rate than the headline market price. It is part of swap pricing, not a separate fee. The widget's market value estimate does not measure it, and the slippage percentage does not cap it. ## Slippage Slippage is the difference between a swap's execution quote and what it actually returns. **Max slippage** limits how much less the swap may return than its quote before it is rejected instead of filled. For example, with a quote of **100 USDC** and a tolerance of **0.5%**, the swap needs at least **99.50 USDC** back or it does not execute. This applies to the swap leg only, not to the widget's receive estimate or the final amount after the other fees. GUM's swap tolerance is currently **0.5%** on mainnet, and the widget has no slippage setting. A swap that cannot clear its floor is never filled short; it is retried until it clears, so funds are not lost. If it still hasn't settled, reach out on [Discord](https://discord.gg/gum-ag). The tolerance does not include gas, bridge, swap, or conversion fees, and it does not bound how far the final amount can differ from the preview. --- ## Overview URL: https://docs.gum.ag/universal-bridge/overview Markdown: https://docs.gum.ag/universal-bridge/overview.md Description: Swap tokens or bridge assets across chains. Compare live routes and build your own interface with the API. import { CardGroup_1 } from "../../components/universal-bridge/overview/CardGroup_1.jsx"; import { AccordionGroup_1 } from "../../components/universal-bridge/overview/AccordionGroup_1.jsx"; Universal Swap & Bridge compares live routes from several bridge and swap routers for each transfer. The API quotes them, builds every transaction for the user's wallet to sign, and tracks the transfer until it arrives or refunds. To try it, swap or bridge at [gum.ag/bridge](https://gum.ag/bridge). To find a transfer by wallet address or transaction hash, open the [Bridge explorer](https://explorer.gum.ag/bridge). Each verified transfer has a shareable receipt with its route and latest recorded status. ## Integrate ## Supported chains Which routers GUM uses on each network, live from [Chains](/universal-bridge/v2/chains). Available routes depend on the tokens, amount, and direction. ## Provider availability Routing profiles and current fee/access rules determine which routers can participate. The table above shows access without an API key; opt-in routers appear only for keys that enable them. Read the effective `routers` list from [Chains](/universal-bridge/v2/chains); a provider's chain catalog entry does not guarantee a route for every token or amount. Layerswap (`layerswap`) is an explicit opt-in integration, not part of default public access. Its scope is direct Depository funding at zero GUM application fee from the EVM networks listed in [Chains](/universal-bridge/v2/chains), paid out on those networks or on Solana, for a key that routes it. GUM's own production partner access, public API/SDK redistribution terms, independent bridge v2 rollout and funded execution QA remain activation gates. Solana is a payout network only; no gasless mode or arbitrary deposit-address flow is included. deBridge (`debridge`) is opt-in per API key. It carries a native coin from EVM networks and TRON, and any token from Solana, to EVM networks, Solana or TRON, on networks other routers also serve. Its orders pay a fixed protocol fee in the source network's coin: inside the amount for a native coin, inside the order's own Solana transaction from Solana. An order deBridge's taker never fills is cancelled on the destination network, which repays the sender: by the sender between EVM networks when the sending account is controlled by a key, and by the recipient otherwise (a smart-contract wallet, or a destination that uses another address format). Bungee (`socket`) is enabled for GUM's first-party profile at zero GUM application fee, with GUM's own partner credentials and affiliate ID on the server. It supports validated direct EVM swaps and bridges; unknown transaction modes are excluded. Public/unkeyed and independent API/SDK profiles do not gain access automatically: redistribution permission remains a separate requirement. The SDK uses the same quotes, orders, signing steps and tracking as other routers; callers never supply Bungee credentials. THORChain is available to keys that enable it, for Bitcoin and the chains it swaps natively: Ethereum, Base, Avalanche, BNB Chain, Solana (SOL), the XRP Ledger and, as a destination, TRON. Its swaps are streamed: THORChain fills a large swap in parts over several blocks, and the route's ETA is THORChain's own estimate. If the price moves past your minimum partway, THORChain pays out the part that swapped and refunds the rest in the token you sent; the order then shows both the payout and the refund transaction. A quote also covers two tokens on the same chain, for example ETH to USDC on Base. Every router that supports it competes: Universal Swap, Relay, NEAR Intents and Mayan, plus Bungee and LI.FI Intents for keys that enable them. (Eco, also per key, moves stablecoins between chains only.) Universal Swap runs a same-chain swap through GUM as it does a cross-chain transfer, so GUM's payout transaction delivers it. ## FAQ --- ## Quickstart URL: https://docs.gum.ag/universal-bridge/v2/quickstart Markdown: https://docs.gum.ag/universal-bridge/v2/quickstart.md Description: Quote, sign and track a transfer in ten lines with @gumag/bridge, or in four HTTP calls. `@gumag/bridge` runs [API v2](/universal-bridge/v2/overview) with the user's own wallet. You don't name a router, build a transaction or post a hash: ```ts import { createBridge } from '@gumag/bridge'; const USDC_BASE = '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'; const USDC_ARBITRUM = '0xaf88d065e77c8cc2239327c5edb3a432268e5831'; const bridge = createBridge(); const quote = await bridge.quote({ from: { chain: 'evm:8453', token: USDC_BASE }, to: { chain: 'evm:42161', token: USDC_ARBITRUM }, amount: '100', sender, recipient, }); const order = await bridge.execute(quote, { wallet: window.ethereum }); for await (const status of bridge.watch(order.id)) render(status); ``` Install it with `npm install @gumag/bridge`. Chains are IDs from `bridge.chains()` (`evm:8453`, `solana:mainnet`), tokens are addresses from `bridge.tokens()` or `native`. `amount` is in the token's units; pass a `bigint` (`100000000n`) for base units. Before a wallet connects, leave out `sender` and `recipient` to show prices: those quotes have no `id`, so quote again with both to execute. `bridge.chains()` lists every chain the API serves, each with its `family`: show the families your app can connect a wallet for. A family newer than your `@gumag/bridge` still quotes, but `execute` from it throws `unsupported` until you update the package. Support for charging your own integrator fee is in development. See [Fees and limits](/universal-bridge/fees-and-limits) for the costs included in a quote today. ## The wallet Pass the wallet for the chain the transfer leaves from. It must hold `sender`. | From | `wallet` | | ------ | ---------------------------------------------------------------------------------------- | | EVM | An EIP-1193 provider: `window.ethereum`, or `await connector.getProvider()` with wagmi | | Solana | A wallet adapter (`useWallet()`) or an injected provider such as Phantom's | | Sui | `{ signAndExecuteTransaction }` from dapp-kit's `useSignAndExecuteTransaction()` | | TRON | A `@tronweb3/tronwallet-adapter-*` adapter (TronLink's), or `{ address, signTransaction }` | | TON | A TON Connect instance: `TonConnectUI` from `@tonconnect/ui`, connected | | Bitcoin | `{ address, signPsbt(psbt, indexes) }` over the wallet's PSBT signing, without finalizing or broadcasting | | XRP Ledger | xrpl-connect's `WalletManager`, connected, or `{ sign(payment) }` that signs without submitting | | HyperCore | The EVM wallet's EIP-1193 provider: HyperCore accounts are EVM addresses | The user sees one to three prompts. An EVM wallet on another network is asked to switch first. A token that needs an allowance asks for an approval of exactly the amount, then the transfer. Solana, Sui, TON, Bitcoin and the XRP Ledger sign once (on Bitcoin the API broadcasts what the wallet signed). On TRON and the XRP Ledger the API builds each transaction and the wallet only signs. The SDK reports its 65-byte hex signature; the API persists it before broadcasting and confirms each approval before preparing the next transaction. The SDK polls the order while a pending step has no transaction yet. Each step is checked against the quote before its prompt and reported as soon as the wallet returns it. `execute` resolves once the funding submission is recorded; `watch` follows the order until it is `delivered`, `refunded`, `failed` or `expired`. An `executing` order is not proof of source confirmation or delivery. ## Without JavaScript The same transfer in four calls. Amounts are base units, chains and tokens are IDs and addresses. ```bash API=https://bridge-api.gum.ag/api/bridge/v2 # 1. Quotes, best first curl -s $API/quotes --json '{ "from": { "chain": "evm:8453", "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" }, "to": { "chain": "evm:42161", "token": "0xaf88d065e77c8cc2239327c5edb3a432268e5831" }, "amount": "100000000", "sender": "0xYourWallet", "recipient": "0xYourWallet" }' # 2. An order for quotes[0]: its steps are what the wallet signs curl -s $API/orders --json '{ "quoteId": "" }' # 3. Each step, in order, once the wallet has sent it curl -s $API/orders//steps/1 --json '{ "txHash": "0x…" }' # 4. The order, every few seconds, until it settles curl -s $API/orders/ ``` [Create an order](/universal-bridge/v2/create-order#steps) says how to sign each step kind, and [report a step](/universal-bridge/v2/report-step) what to post for it. ## Errors The SDK throws a `BridgeError` with a `code`, and the `order` once there is one. The API answers `{ error, code }`. | `code` | What to do | | ------------------- | --------------------------------------------------------------------------------------------- | | `quote-expired` | The quote or its order ran out before signing, or its price moved below the quote's minimum. Quote again. | | `wallet-rejected` | The user refused in the wallet and nothing was sent. Run `execute` again while the quote lasts. | | `step-out-of-order` | Another tab or device is signing this order. Follow it with `watch` instead. | --- ## API v2 URL: https://docs.gum.ag/universal-bridge/v2/overview Markdown: https://docs.gum.ag/universal-bridge/v2/overview.md Description: Quote, order, sign and track a transfer with explicit IDs and base units, while the API runs the router behind it. API v2 runs a transfer as an order. Ask for quotes, order the first one, sign each step the order returns and report its transaction, then read the order until it settles. The API builds every transaction, submits what needs submitting and tracks delivery. v2 is served from `https://bridge-api.gum.ag/api/bridge/v2`. API v1 (the `/api/bridge/*` paths outside `/v2`) is deprecated: its responses carry a `Deprecation` header and a `Link` to this page. It still answers, so move to v2 at your pace; a sunset date will be announced in that header first. ## Conventions | Rule | What it means | | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Base units | Amounts are integer strings in the token's smallest unit: `"10000000"` is 10 USDC. | | Explicit IDs | Chains are [chain IDs](/universal-bridge/v2/chains) such as `evm:8453`, `solana:mainnet` and `sui:mainnet`. Tokens are contract addresses, or `native` for the gas coin. | | Routers are chosen for you | You never name a router. A quote or order says which one it runs on, as `route: { id, name, logo }`, so you can show it or key on it; you cannot ask for one. | | One quote, one order | Ordering the same quote again returns the same order. | | Times | `expiresAt` and `updatedAt` are Unix milliseconds. | ## The flow | Step | Endpoint | | -------- | -------------------------------------------------------------------------------------------- | | Discover | [Chains](/universal-bridge/v2/chains), [tokens](/universal-bridge/v2/tokens) | | Quote | [Quotes](/universal-bridge/v2/quotes): executable quotes, best first | | Order | [Create an order](/universal-bridge/v2/create-order) from `quotes[0].id` | | Sign | For each step in order: sign it, send it, then [report it](/universal-bridge/v2/report-step) | | Track | [Get the order](/universal-bridge/v2/get-order) until it settles | ## Order status | Status | Meaning | | -------------------- | ------------------------------------------------------------------------------------------------------- | | `awaiting_signature` | No funding transaction reported yet (sent by hand: no deposit seen yet). | | `executing` | The funding transaction is reported: the transfer is confirming or bridging. | | `dropped` | The funding transaction can't be found on chain. It may still land: keep reading. Show it as "Likely failed" and ask the user to check their wallet. | | `refunding` | The router is sending the funds back to the sender. | | `delivered` | The funds arrived. `received` is the amount, in base units. | | `refunded` | The funds went back to the sender. | | `failed` | The transfer failed. | | `expired` | Nothing was reported before `expiresAt`, or the source transaction still can't be found much later. Show it as "Not sent". | `delivered`, `refunded`, `failed` and `expired` are final. A `dropped` order keeps being checked on each read and returns to `executing` if the transaction lands after all. A delivered order is still read for `received` and `destinationTx` where the router reports them later. ## Keys and limits Keys work as in the current API: none for the public routing profile, or your key in the `x-bridge-api-key` header on quotes and order creation. Browser keys are pinned to their origins. Every response is `Cache-Control: no-store`. | Requests per minute, per caller | Limit | | ------------------------------------ | ----- | | Chains | 600 | | Tokens | 90 | | Quotes | 30 | | Order creation | 20 | | Step reports and order reads, shared | 120 | A key with its own limit spends it on quotes and order creation instead. A `429` carries `Retry-After`. ## Errors Every error is `{ "error": "", "code": "" }`. | Status | `code` | Action | | ------ | -------------------------------------------------------------- | ------------------------------------------------------------ | | `400` | `invalid-request`, `step-out-of-order`, `unsupported`, others | Fix the request; the message says what. | | `401` | `unauthorized` | Replace or remove the API key. | | `403` | `forbidden` | Use a key registered for this origin. | | `403` | `address-restricted` | The bridge won't serve this sender or recipient; `role` (`sender` or `recipient`) says which. | | `404` | `quote-not-found`, `order-not-found` | Check the ID. Quotes are kept 10 minutes past `expiresAt`. | | `409` | `step-conflict` | That step was already reported with another transaction. | | `409` | `order-uncertain` | An earlier try may hold this quote. Get a new quote. | | `410` | `quote-expired` | The quote ran out, or its price moved below its minimum. Get a new quote. | | `429` | `rate-limited` | Wait for `Retry-After`. | | `503` | `unavailable` | Retry with backoff. Keep the order ID of a transfer you sent. | --- ## Chains URL: https://docs.gum.ag/universal-bridge/v2/chains Markdown: https://docs.gum.ag/universal-bridge/v2/chains.md Description: Every chain you can send from or to, with its gas coin. No parameters. Send your API key if you have one: a chain that only Circle CCTP reaches is listed only for a key whose routing profile includes CCTP. ```bash curl https://bridge-api.gum.ag/api/bridge/v2/chains ``` ```json { "chains": [{ "id": "evm:8453", "name": "Base", "family": "evm", "nativeToken": { "address": "native", "symbol": "ETH", "decimals": 18 }, "icon": "https://assets.relay.link/icons/8453/light.png", "explorerUrl": "https://basescan.org", "rpcUrl": "https://base.drpc.org/", "providers": { "gum": "8453", "relay": "8453", "mayan": "base" }, "providerDirections": { "mayan": { "source": true, "destination": false } }, "providerSlugs": { "relay": "base" } }], "routers": [ { "id": "gum", "name": "GUM Universal Swap", "logo": "https://bridge-api.gum.ag/icon.svg" }, { "id": "mayan", "name": "Mayan", "mono": true, "logo": "https://bridge-api.gum.ag/bridge/providers/mayan.png" } ], "unavailableProviders": [] } ``` `routers` are the routers your key's quotes can come from, each with the `name` and `logo` its routes carry: show them before the first quote, and a router added later appears with no change on your side. `mono` marks a logo drawn in one colour for dark pages; darken it on a light one. | Field | Description | | ------------- | -------------------------------------------------------------------------------------------- | | `id` | The chain ID the other endpoints take: `evm:`, `solana:mainnet`, `sui:mainnet`, `tron:mainnet`, `ton:mainnet`, `bitcoin:mainnet`, `xrpl:mainnet` or `hypercore:mainnet`. | | `name` | Display name. | | `family` | `evm`, `svm`, `sui`, `tron`, `ton`, `bitcoin`, `xrpl` or `hypercore`: which kind of wallet signs on it. `hypercore` (Hyperliquid's exchange) signs with the EVM wallet; its `native` is perps USDC, and spot tokens are 16-byte HIP-1 token ids. | | `nativeToken` | The gas coin. Its `address` is always `native`. | | `rpcUrl` | Optional: a public RPC endpoint, for adding the chain to a wallet that doesn't know it. | | `icon` | Optional: the chain's mark (https). | | `explorerUrl` | Optional: the block explorer's base URL. | | `providers` | The routers that serve the chain, each with its own ID for it. | | `providerDirections` | Optional, per router: `source` or `destination` is `false` when it only carries transfers one way. A router not listed carries both. | | `providerSlugs` | Optional, per router: the chain's slug where a router names chains by one (Relay's `unichain`). Stable, so it can key the chain in a URL. | `unavailableProviders` lists routers that are down right now: their quotes are missing until they recover. A listed chain is not a promise of a route for every pair; a [quote](/universal-bridge/v2/quotes) is. Bungee (`socket`) appears only for profiles that explicitly enable it, with configured partner access and a zero GUM application fee. Its chain metadata retains source/destination restrictions. Public profiles do not inherit access from a configured partner key. --- ## Tokens URL: https://docs.gum.ag/universal-bridge/v2/tokens Markdown: https://docs.gum.ag/universal-bridge/v2/tokens.md Description: Search the tokens a chain can send or receive. | Parameter | Required | Description | | --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | `chain` | Yes | A [chain ID](/universal-bridge/v2/chains), for example `evm:8453`. | | `query` | No | A symbol, name or contract address, or on Elysium a pool ID or a GeckoTerminal or DEX Screener link. Without it, the chain's leading tokens. | | `address` | No | One token by address (`native` for the gas coin), with its `market` read fresh. In place of `query`. | ```bash curl -G https://bridge-api.gum.ag/api/bridge/v2/tokens \ -d chain=evm:8453 -d query=USDC ``` ```json { "tokens": [ { "chain": "evm:8453", "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "symbol": "USDC", "name": "USD Coin", "decimals": 6, "verified": true, "logo": "https://coin-images.coingecko.com/…/usdc.png", "market": { "priceUsd": 0.9998, "marketCapUsd": 75900000000, "volume24hUsd": 9100000000, "priceChange24hPercent": 0.01 } } ], "isPartial": false } ``` `address` is what [quotes](/universal-bridge/v2/quotes) take as `token`, and `native` for the chain's gas coin. `logo` is optional. Only tokens a router lists for the chain are returned; a listed token can still have no route for a given pair or amount. TON addresses are user-friendly and URL-safe: jettons bounceable (`EQ…`), wallets non-bounceable (`UQ…`). Requests take the raw `0:` form too. On Bitcoin the one token is BTC (`native`, 8 decimals). Addresses are any mainnet form: `bc1q…`, `bc1p…`, `1…` or `3…`. On the XRP Ledger the one token is XRP, address `xrp` (6 decimals). Accounts are classic `r…` addresses; X-addresses, which carry a destination tag, are refused, since no router sends a tag. `verified` marks the chain's gas coin and the tokens in its market rank. Lookalikes copy real symbols: Base lists six tokens called `USDC`, and only `0x8335…2913` is verified. Pick by address, or by the verified match. `market` is what the list knows of the token's price, market cap, 24-hour volume and change, and pool liquidity; any of them can be missing. Ask by `address` for one token's fresh numbers: an unlisted address answers `"tokens": []`. `isPartial` is `true` when a router's list couldn't be read just now, so a token may be missing: ask again shortly. --- ## Quotes URL: https://docs.gum.ag/universal-bridge/v2/quotes Markdown: https://docs.gum.ag/universal-bridge/v2/quotes.md Description: Every route that can run your transfer now, best first, each ready to order. ## Request | Field | Required | Description | | ------------- | -------- | ------------------------------------------------------------------------------------------------- | | `from`, `to` | Yes | `{ chain, token }`: a [chain ID](/universal-bridge/v2/chains) and a token address, or `native`. | | `amount` | Yes | What `sender` sends, in base units of `from.token`, as a string. | | `sender` | To order | The wallet on `from.chain` that signs and pays. Leave out both wallets to show prices before one connects: those quotes have no `id`. | | `recipient` | To order | The wallet on `to.chain` that receives. | | `recipientConnected` | No | `true` only when `recipient` is a wallet the user connected in your app and can sign with on `to.chain`. Some routes can only be cancelled by the recipient if no one fills them; they are quoted only when this is `true`. Leave it out, or `false` (the default), for an address the user typed or pasted. See [deBridge routes](#debridge-routes). | | `manual` | No | `true`: the user sends the deposit by hand, from any wallet or exchange, to an address the order shows. `sender` is then only where a refund goes, an address of any type (`1…`, `3…`, `bc1q…`, `bc1p…`). Only routers that take such a deposit are quoted: NEAR Intents, from Bitcoin. See [create an order](/universal-bridge/v2/create-order#sent-by-hand). | | `slippageBps` | No | 1 to 3000: one tolerance for every route. Omitted (as gum.ag does), the pair sets it: 10 between two dollar stablecoins at their peg (USDC to USDC, USDT to USDC), 120 otherwise (ETH to ETH too), and GUM Universal Swap quotes at 200, its floor. A route to or from Elysium (`evm:99901`) takes 1000 on every route, whatever the pair. Each quote's `slippageBps` says what applied. | ```js const API = 'https://bridge-api.gum.ag/api/bridge/v2'; const USDC_BASE = '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'; const USDC_ARBITRUM = '0xaf88d065e77c8cc2239327c5edb3a432268e5831'; const response = await fetch(`${API}/quotes`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ from: { chain: 'evm:8453', token: USDC_BASE }, to: { chain: 'evm:42161', token: USDC_ARBITRUM }, amount: '10000000', sender: '0xYourWallet', recipient: '0xYourWallet', }), }); const { quotes, failures } = await response.json(); ``` ## Response Quotes come ranked as gum.ag ranks them: by what the recipient nets once the source network fee is counted. Run `quotes[0]`. | Field | Description | | -------------- | ----------------------------------------------------------------------------------- | | `id` | Opaque. [Order it](/universal-bridge/v2/create-order) before `expiresAt`. Absent when the request had no wallets. | | `expiresAt` | Unix milliseconds; at most three minutes away. | | `from`, `to` | `{ chain, token, decimals, symbol }`. | | `amountIn` | What `sender` sends, base units. | | `amountOut` | What `recipient` should receive, base units. | | `minAmountOut` | The least `recipient` receives: the route's minimum, else `amountOut` less `slippageBps`. | | `slippageBps` | The tolerance this quote is bound to, basis points: yours (or the pair's when the request left it out), or less where the router's minimum holds more; a USDC transfer with no swap leg reads 0. | | `route` | `{ id, name, logo, label }`: the router's id (`gum`, `relay`, `mayan`, …) to key on, its display name and logo, and a label where it names the route. | Everything else on a quote is optional and present only when the router or the API reports it: | Field | Description | | ------------------------------------------ | ---------------------------------------------------------------------------------------------------- | | `netAmountOut` | `amountOut` less `sourceGasUsd` at the output token's price. Quotes are ranked by it. | | `feeUsd`, `deliveryGasUsd` | The route's fee in USD, and the part of it that is destination-chain gas. Never add them together. | | `sourceGasUsd` | The source network fee in USD, paid on top of `amountIn`. | | `sourceGasMaxAmount`, `sourceGasMaxUsd` | The most the source wallet may need for gas: native base units, and USD. EVM gas-times-price chains, and TRON. | | `appFeeBps`, `appFeeUsd` | The integrator fee on a third-party route, already netted out of `amountOut`. | | `additionalSourceFee` | `{ amount, symbol, decimals }`: an extra fee the source chain charges in its own token. | | `etaSeconds`, `etaP90Seconds` | Typical delivery time, and the time nine in ten measured deliveries landed within. | | `deliveryRate` | Share (0 to 1) of this router's funded transfers on the chain pair delivered in the last 14 days. | | `recentFailures` | Refunded or failed transfers on this exact token pair in the last 24 hours. | | `valueRatio` | USD value of `amountOut` over the USD value of `amountIn`, e.g. `0.994`. | | `warning` | `loses-value`: the route keeps under 90% of what is sent. Warn before running it. | `quotes` can be empty. `failures`, when present, lists the routers that were asked and had nothing: `{ route: { id, name }, reason, retryAt, detail }`. `reason` is `no-route`, `unsupported`, `unavailable`, `rate-limited`, `timeout` or `not-configured`; `retryAt` (Unix milliseconds) says when the router may quote again; `detail` is `route-unhealthy` when we paused the router on this pair after repeated failures, or `quote-implausible` when its quote was worth more than the input. `belowMinimum`, present when `amountIn` is under the pair's recommended minimum ($3, or $10 when either side is Ethereum), is `{ minimumUsd, minimumAmount }`. Quotes still come back; warn and offer `minimumAmount` (base units of `from.token`). Quotes arrive together, once the slowest router has answered or timed out. ## deBridge routes `route.id: "debridge"` identifies deBridge DLN, for keys whose profile enables it. From EVM networks and TRON a route sends the native coin: DLN's fixed fee comes out of `amountIn`, so the order's funding step is worth exactly the amount. From Solana a route sends any token, and DLN's fixed fee (0.015 SOL) is paid on top, shown as the route's additional source fee and not included in its network fee. The output is exact: the minimum is what the order may still name when it is built. An order no one fills stays open until it is cancelled on the destination network, and only its cancel address can do that. `sender` then gets back exactly what the order holds: the token and amount it gives, after any swap first (so USDC rather than POL on a swapped Polygon order). DLN's fixed fee isn't taken from that: on EVM networks and TRON it comes out of the native input before the order is funded, and from Solana it is paid separately in SOL. A Solana order giving 50 USDC pays 0.015 SOL on the side, and a cancel returns the 50 USDC. The API makes that the sender's own address between EVM networks from a wallet controlled by a key. Otherwise only the recipient can cancel: to another network family (EVM or TRON to Solana and back, EVM to TRON), or from a smart-contract wallet such as a Safe, which may not exist at the same address on the destination network. Those routes are quoted only with `recipientConnected: true`, so an address the user pasted, such as an exchange deposit address, never ends up holding the only way to get the funds back. An order for one is refused, too. One exception: a recipient equal to `sender` needs no flag, since the cancel address is that address either way. From a smart-contract wallet (a Safe sending to its own address on another network), make sure that address exists and is controlled on the destination network before you send: only it can cancel an order no one fills. ## Bungee routes `route.id: "socket"` identifies Bungee. These direct EVM routes are available only for an eligible API-key profile while GUM's partner credentials, shared request budget and zero GUM application fee are configured. The public/unkeyed profile and independent SDK profiles do not gain Bungee automatically. Use the supplied `route.name` and `route.logo`, then order the quote by `id` as usual. The server refreshes the route and validates its transaction, recipient and accepted minimum before returning signing steps. No Bungee key or raw upstream payload belongs in a client request. Pending orders use the same [order status](/universal-bridge/v2/get-order) endpoint as other routers. --- ## Create an order URL: https://docs.gum.ag/universal-bridge/v2/create-order Markdown: https://docs.gum.ag/universal-bridge/v2/create-order.md Description: Turn a quote into the transactions the sender signs. ```js const API = 'https://bridge-api.gum.ag/api/bridge/v2'; const response = await fetch(`${API}/orders`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ quoteId: quotes[0].id }), }); const order = await response.json(); ``` Send the same API key you quoted with. A new order answers `201`. Posting the same `quoteId` again answers `200` with that same order, so a retry never builds a second transfer. An expired quote answers `410`: get a new one. The response is the [order](/universal-bridge/v2/get-order) with `status: "awaiting_signature"`. Its amounts are the ones the order will run, which can differ slightly from the quote's. Sign its `steps` in order, and before `expiresAt`: a Solana order lasts 30 seconds. ## Steps Each step has `n` (from 1), `kind`, `status` (`pending` or `done`), `label` and the fields below. | `kind` | Fields | What to do | | ------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | | `evm-approve` | `chainId`, `token`, `spender`, `amount`, `data` | Send `data` to `token` with no value, wait for the receipt, report the hash. | | `evm` | `chainId`, `to`, `data`, `value`, `gas`, `funding`, `waitForReceipt` | Send it with `gas` when present, report the hash. With `waitForReceipt`, wait for the receipt before the next step. | | `svm` | `transaction` (base64), `submit`, `lifetime` | `submit: "broadcast"`: sign, send and report the signature. `submit: "return"`: sign only, don't send, and report the signed bytes; the API submits them. | | `sui` | `transaction` (`Transaction.toJSON()` output) | Sign and execute it, report the digest. | | `tron-approve` | `token`, `spender`, `amount`, `data`, optional `transaction` (base58 `T…` addresses) | Sign the API's `transaction` without broadcasting, then report `{ "signature": "<65-byte hex>" }`. | | `tron` | `to`, `data`, `value` (sun), `funding`, optional `transaction` | Sign the API's `transaction` without broadcasting, then report its 65-byte hex signature. | | `ton` | `validUntil`, `messages` (`address`, `amount`, `payload?`) | Send it with TON Connect (`network: "-239"`, `from` the sender), report the normalized hash of the message the wallet returns. A TON order has one step. | | `bitcoin` | `psbt` (base64, unsigned), `to`, `amount` (sats), `memo?` (hex), `fee` (sats), `funding` | Check the PSBT pays exactly `amount` to `to`, change back to the sender and at most one OP_RETURN carrying `memo`. Sign every input without finalizing or broadcasting, then report `{ "psbt": "" }`; the API sends it. A Bitcoin order has one step. | | `xrpl` | `to`, `amount` (drops), `memo?` (hex), `funding`, optional `payment` (XRPL transaction JSON) | Wait for the API's `payment`, sign it exactly as given without submitting, then report `{ "signedTransaction": "" }` (or the wallet's signed transaction JSON). The API checks and submits it. An XRP order has one step. | | `manual` | `to`, `amount` (base units), `deadline` (Unix ms), `refundTo`, `funding` | Show it: the user sends exactly `amount` to `to` from any wallet before `deadline`. Nothing to sign or report. See [sent by hand](#sent-by-hand). | | `hypercore` | `action` (`send-asset` or `relay-authorize`), `typedData`, optional `funding` | Sign `typedData` with the sender's EVM wallet (`eth_signTypedData_v4`, on Ethereum, chain id 1), then report `{ "signature": "<65-byte hex>" }`. The API sends it on. | `gas` and `lifetime` are optional. On a `failed` order, `refused` marks a step that never went out: an `svm` step with `submit: "return"` whose bundle the simulation refused, a `tron` or `tron-approve` step whose broadcast the node refused, or a `bitcoin` step whose first send the node definitely refused. It is `insufficient-gas` when the wallet can't pay the network fee (on Bitcoin, a fee below the node's minimum), else `provider`. Without `refused`, a failed order may already have moved funds: keep following it. Report each step with [report a step](/universal-bridge/v2/report-step) as soon as the wallet returns it. deBridge orders (`route.id: "debridge"`) are one funding step on EVM or TRON, or one Solana transaction under a blockhash the API sets. The API asks DLN for the order with your addresses, decodes it and holds it to the quote: recipient, output, minimum, and the sender as the only address a cancelled order repays. That holds on every source network. A Solana transaction is read instruction by instruction, and one that moves funds anywhere but into the order, or swaps first, is refused. When DLN swaps the input before the order (EVM networks and TRON), the API holds the swap to the token and amount the quote priced; whatever the swap makes above the order's amount goes to deBridge. DLN quotes 0.3% of the swap as its slippage allowance, but nothing caps the surplus: a swap that fills better than quoted sends deBridge more. Bungee orders (`route.id: "socket"`) use the same EVM approval and funding steps. The API builds and validates them; `@gumag/bridge` executes those generic step kinds without a Bungee-specific adapter. A refreshed route must preserve the accepted protocol, path and destination minimum, or the API refuses it. ## Sent by hand An order quoted with `manual: true` has one `manual` step: the router's deposit address for this order alone (`to`, also `deposit.address`), the exact `amount` and a `deadline` an hour out, which is also the order's `expiresAt`. Show the address, the amount and the time left; a QR code of `bitcoin:?amount=` (BIP-21) lets a wallet fill in both. Check `to` is `deposit.address`, `amount` is `amountIn` and `refundTo` is the `sender` you quoted before showing them. Nothing is reported: read the [order](/universal-bridge/v2/get-order). It stays `awaiting_signature` until the deposit shows (in NEAR Intents' status for the address, or in the mempool), then becomes `executing` with the deposit as `sourceTx`, and goes on as any other order. Past `deadline` with no deposit it reads `expired`: don't show the address any more, and quote again. A deposit that still arrives is followed for a day and moves the order on. Less than `amount` is refunded to `refundTo`; more is swapped and the rest refunded there. Reporting the step answers `400`. ## HyperCore signing HyperCore (`hypercore:mainnet`) is Hyperliquid's exchange. Its accounts are EVM addresses, so the sender's EVM wallet signs; nothing is sent from the wallet. Each step is EIP-712 typed data the API built: - `send-asset`: Hyperliquid's `sendAsset` action, which moves the funds (`funding: true`). The API posts it to Hyperliquid's `/exchange`. - `relay-authorize`: Relay's nonce mapping, which ties that send to Relay's order. The API posts it to Relay before the send. Both name chain id 1 in their domain: a wallet that checks the active network must be on Ethereum to sign. Before signing a `send-asset`, check it moves exactly `amountIn` of `from.token` (perps USDC, `native`, from `sourceDex: ""`; a spot token from `"spot"`), on `Mainnet`, from the main account (`fromSubAccount: ""`), to an address other than the sender's. On a deposit order it must pay `deposit.address`. `@gumag/bridge` makes these checks. The API keeps each signature before sending it, and Hyperliquid accepts a nonce once, so a retried report can't send twice. HyperCore gives a send no hash until it is recorded: the order's `sourceTx` and the step's `confirmed: true` appear once the API reads it from the sender's ledger. Hyperliquid takes 1 USDC once from a new account's first send (its activation fee); there is no gas. ## TRON signing The API builds one TRON transaction at a time, including its reference block, expiry and fee limit. `@gumag/bridge` checks its bytes and wallet-facing JSON against the step; the wallet only signs. Direct integrations must make the same checks before signing. A pending step may have no `transaction` yet. Poll [the order](/universal-bridge/v2/get-order) until that field is present; do not build a replacement. The API persists each reported signature before broadcasting and confirms an approval on chain before preparing the next transaction. Step status remains `pending` or `done`: for TRON, `done` means the signature was recorded, not that the transaction confirmed. Its `confirmed` field becomes `true` only after a successful chain receipt. If the node refuses the step's broadcast, the order is `failed` and the step carries `refused` (above): `insufficient-gas` means not enough TRX, energy or bandwidth. Once a transaction is signed, do not rebuild or sign it again after a timeout. Repeat the same signature report or read the order. The API keeps the same transaction and signature; it does not automatically refresh or reissue them. The SDK handles this reporting and polling. --- ## Report a step URL: https://docs.gum.ag/universal-bridge/v2/report-step Markdown: https://docs.gum.ag/universal-bridge/v2/report-step.md Description: Tell the API what the wallet did with one step. Report step `n` of order `id` as soon as the wallet returns it. The answer is the updated [order](/universal-bridge/v2/get-order). | Step | Body | | ---------------------------------------- | ---------------------------- | | `evm-approve`, `evm` | `{ "txHash": "0x…" }` | | `svm` with `submit: "broadcast"` | `{ "txHash": "" }` | | `sui` | `{ "txHash": "" }` | | `tron-approve`, `tron` | `{ "signature": "<65-byte hex>" }` | | `ton` | `{ "txHash": "<64 hex>" }` | | `bitcoin` | `{ "psbt": "" }` | | `xrpl` | `{ "signedTransaction": "" }` | | `hypercore` | `{ "signature": "<65-byte hex>" }` | | `svm` with `submit: "return"` | `{ "signed": [""] }` | | `manual` | Nothing: sent by hand, the order follows its address (`400`) | ```js const API = 'https://bridge-api.gum.ag/api/bridge/v2'; await fetch(`${API}/orders/${order.id}/steps/${step.n}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ txHash }), }); ``` - **TON.** The hash is the TEP-467 normalized hash of the external message TON Connect's `sendTransaction` returns (`boc`), in hex. `@gumag/bridge` computes it; Tonviewer opens it. - **Bitcoin.** Report the step's PSBT signed by the sender, base64 or hex, finalized or not. The API checks it is this step's transaction with every input signed by the quoted sender (`400` otherwise), saves it, broadcasts it and follows it to a block; `sourceTx` is its txid. The first signed copy accepted stands. If the node definitely refuses that first send, the order is `failed` and the step carries `refused` (`insufficient-gas` for a fee below its minimum, else `provider`): nothing was sent. An uncertain send is sent again, never marked. Send from a native SegWit (`bc1q…`) or Taproot (`bc1p…`) address; any Bitcoin address can receive. - **XRP Ledger.** Report the blob the wallet signed (`tx_blob`), or its signed transaction JSON when it returns no blob (WalletConnect wallets). The API answers `400` unless it is the step's `payment`, field for field, signed by the sender's key, then keeps it and submits it; the payment's hash becomes the order's `sourceTx`. - **In order.** Reporting a step before the one ahead of it answers `400` (`step-out-of-order`). - **Once.** Repeating a report changes nothing. A different transaction for a step already reported answers `409` (`step-conflict`). - **Funding.** The step that moves the funds makes the order `executing`, with `sourceTx` set. From then on, [read the order](/universal-bridge/v2/get-order) to follow it. - **Return steps.** Sign without sending, preserving the signatures already on the transaction. Post each one's signed bytes on its own step, or all of them in order on the first. Once every return step is signed, the API submits them together. If the simulation refuses them, the order is `failed` with a `detail`, and each of them carries `refused` (`insufficient-gas` or `provider`): nothing was sent. - **TRON steps.** Sign the API's `step.transaction` without broadcasting and post the wallet's 65-byte hex signature. The API verifies the signature against that transaction and sender, persists it before broadcast, then submits the transaction. `done` means the signature was recorded; `confirmed: true` means a successful source-chain receipt; `refused` means the node refused its broadcast and the order failed, so it never went out. The next step may still lack `transaction` while the preceding approval confirms. Poll the order until it is ready. An unanswered report is retried with the same signature; do not rebuild, refresh or sign a replacement transaction. `@gumag/bridge` handles retries during execution. For reload recovery, persist `onSubmitted.signature` with the API origin, order, step and transaction ID before reporting. - **HyperCore steps.** Sign `step.typedData` with the sender's EVM wallet and post the 65-byte hex signature. The API checks it recovers to the sender over exactly that typed data, keeps it, then posts it on (Relay's `/authorize`, or Hyperliquid's `/exchange` for the send). The send goes only after Relay accepts the mapping; if Relay refuses it, the order fails and nothing moves. A refused send fails the order with Hyperliquid's reason only once its ledger, read in full for two minutes after the refusal, holds no send of exactly that action: a retry of a send Hyperliquid already took is refused too. The API keeps posting and looking up a reported signature on its own, so a client may stop reading the order once it is reported. Report a transaction even after `expiresAt`: if it moved funds, the order tracks it. For TRON, an already accepted signature remains reportable after expiry. A signature first reported after expiry is refused with `410` (`quote-expired`). Read the existing order after an uncertain response; never create another transaction to replace an uncertain submission. --- ## Get an order URL: https://docs.gum.ag/universal-bridge/v2/get-order Markdown: https://docs.gum.ag/universal-bridge/v2/get-order.md Description: Follow an order from signature to delivery or refund. ```js const API = 'https://bridge-api.gum.ag/api/bridge/v2'; const order = await fetch(`${API}/orders/${id}`).then((response) => response.json(), ); ``` Each read checks an executing transfer with its router and its source chain, at most every 2 seconds. Poll every 2–3 seconds until `delivered`, `refunded` or `failed`, keep polling while your page is hidden so a delivery is not missed, and honor `Retry-After` on a `429`. | Field | Description | | ----------------------------- | ----------------------------------------------------------------------------------- | | `id`, `quoteId` | The order, and the quote it was made from. | | `status` | See [order status](/universal-bridge/v2/overview#order-status). | | `expiresAt` | Unix milliseconds. Unreported by then, the order is `expired`. | | `ref` | The transfer's reference, as the wallet history and dashboard name it (`${route.id}:${ref}`): the router's own id where it has one, else the funding transaction once reported. | | `sourceTx` | The funding transaction, once reported. | | `sourceSubmittedAt`, `sourceConfirmedAt` | Unix milliseconds: when the funding transaction was reported, and when it was first seen in a block. Until `sourceConfirmedAt`, the transfer is confirming on its source chain whatever the router says. | | `destinationTx`, `refundTx` | Delivery and refund transactions, when the router reports them. | | `received` | What `recipient` received, base units, once delivered. | | `detail` | A short line about the current state, for the person who sent the transfer. | | `route` | `{ name, logo }`, for display only, and `etaSeconds`: the quote's estimate when the order was placed (absent on older orders). | | `deposit` | `{ address }` when the order is one plain transfer to the router. Before signing, check the step pays exactly `amountIn` of `from.token` to that address and nothing else. | | `sender`, `recipient` | The wallet that funds the transfer and the one it pays, as the order was placed. | | `from`, `to` | `{ chain, token, decimals, symbol }`. | | `amountIn`, `amountOut`, `minAmountOut` | Base units, as the order runs. | | `steps` | The [steps](/universal-bridge/v2/create-order#steps), each `pending` or `done`. | | `createdAt`, `updatedAt` | Unix milliseconds: when the order was placed, and its last change. | Optional fields are absent until they apply. An unknown `id` answers `404`. --- ## Wallet history URL: https://docs.gum.ag/universal-bridge/v2/list-orders Markdown: https://docs.gum.ag/universal-bridge/v2/list-orders.md Description: Every transfer a wallet sent or received, newest first. | Parameter | Required | Description | | --------- | -------- | ---------------------------------------------- | | `address` | Yes | One to 12 wallet addresses, comma-separated: a wallet in each family plus the recipients you sent to. | | `limit` | No | Transfers per page, 1 to 100. Default 25. | | `cursor` | No | The `nextCursor` of the previous page. | ```bash curl -G https://bridge-api.gum.ag/api/bridge/v2/orders \ -d address=0x1111111111111111111111111111111111111111 -d limit=10 ``` ```json { "orders": [ { "id": "0420f976-89a5-4d42-858a-ade95c89cb40", "ref": "0x7c1f…", "route": { "id": "relay", "name": "Relay", "logo": "https://…/relay.svg" }, "status": "delivered", "from": { "chain": "evm:8453", "token": "0x8335…2913", "decimals": 6, "symbol": "USDC" }, "to": { "chain": "solana:mainnet", "token": "native", "decimals": 9, "symbol": "SOL" }, "amountIn": "25000000", "amountOut": "301204819", "received": "301100000", "sender": "0x1111111111111111111111111111111111111111", "recipient": "F5p1…s113", "sourceTx": "0x9a2e…", "destinationTx": "4Zb1…", "role": "sender", "createdAt": 1794441600000, "updatedAt": 1794441660000 } ], "nextCursor": null } ``` Every transfer the wallets sent or received through GUM, whichever app or API started it, in an [order](/universal-bridge/v2/get-order)'s terms: v2 statuses, base units, `native` for a gas coin. `received` is what was delivered. `role` is the asked wallet's side: `sender`, `recipient` or `both`. `id` is present only for a transfer ordered through this API, and reads at [Get an order](/universal-bridge/v2/get-order). A transfer found on chain without an order has no `id`; it is known by `route.id` and `ref`, as an order names it too. No API key is needed; the history is public on chain. --- ## Fees and limits URL: https://docs.gum.ag/universal-bridge/fees-and-limits Markdown: https://docs.gum.ag/universal-bridge/fees-and-limits.md Description: Read quote costs correctly and handle minimum amounts and request limits. ## Quote costs Use the current route's output and fee fields rather than a hard-coded total. | Field | Meaning | | ------------------------ | ------------------------------------------------------------------------------------------------------------ | | `outAmount` | Expected amount received, in destination atomic units. Application fees are already reflected in this value. | | `minOutAmount` | Optional minimum output in destination atomic units. Do not invent one when absent. | | `feeUsd` | Router fee estimate in USD, excluding the application fee. On Universal Swap, only validated live destination execution and recipient-setup cost, excluding protocol margin, overhead and pricing surplus. | | `deliveryGasUsd` | Optional Universal Swap network-delivery cost in USD. The same amount already reported in `feeUsd`, not an additional charge. | | `appFeeUsd`, `appFeeBps` | Application fee in USD and, where supplied, basis points. | | `sourceGasUsd` | Estimated source-chain network fee in USD, paid in the source chain's native token. | | `sourceGasMaxAmount`, `sourceGasMaxUsd` | Optional most a wallet may check the balance for to send the route, in native atomic units and USD: its gas limit at twice the base fee plus the wallet's default tip (2 gwei on Ethereum). Keep at least this much of the native token. | | `netOutAmount` | Optional `outAmount` less `sourceGasUsd` at the output token's price. Routes are ranked by it. | | `additionalSourceFee` | Optional additional source fee with its own amount, symbol, and decimals. | Fee fields are optional. An absent estimate is not a zero-cost promise. Do not subtract the application fee or Universal Swap's protocol fee from `outAmount` again. Source-chain gas is separate from the input token amount; users need enough native currency for signing and execution. Final output can be affected by price movement and slippage. For Universal Swap, the GUM widget shows only reported `sourceGasUsd` plus validated `deliveryGasUsd` as Network fees. Protocol pricing, including any surplus, remains reflected in the quoted rate and receive amount and is not itemized. Separately quoted `appFeeUsd` or `appFeeBps` retains its existing display, including on Universal Swap. Both `feeUsd` and `deliveryGasUsd` are reported only when live upstream cost data is valid and no larger than an internally validated protocol total. Missing, static or malformed cost data, or an unverifiable total, omits both fields; the network line shows only known source gas in that case. Missing network estimates are unavailable, not zero. Universal Swap's normalized fee fields exclude protocol margin, overhead and pricing surplus. There is no separate total-protocol-fee field. This corrects the earlier `feeUsd` semantics that included the whole protocol fee; quoted amounts, rates and route ranking are unchanged. Never add `feeUsd` and `deliveryGasUsd` together: they report the same cost. `appFeeUsd` remains a separate integrator fee; it does not represent Universal Swap's pricing surplus. ## GUM fee eligibility GUM's application fee is currently **0 bps**; router fees and network gas can still apply. Fee configuration is server-controlled, not a caller parameter. A future positive fee, including 10 bps, requires proof that the exact route collects the required retained GUM fee. A quote echoing a fee percentage is not payment evidence. Layerswap has no qualified positive GUM fee mechanism. It is eligible only for explicitly enabled, qualified profiles at zero fee. A positive-fee change removes new quotes, cached/streamed routes and all new build responses, including already prepared READY orders. Existing issued/funded transfers keep their original zero-fee snapshot and remain trackable. THORChain routes carry THORChain's own fees inside the quoted amount: its liquidity fee and the payout's network fee. THORChain takes that network fee after it checks the swap against your minimum, so the order's price floor is set to your minimum plus twice the fee quoted when the order is built: you receive at least the minimum unless that chain's fee more than doubles before the payout. THORChain pays ETH, BNB and AVAX with a fixed gas allowance, so a smart-contract wallet that can't receive within it (a Safe on Ethereum or BNB Chain, for example) isn't offered THORChain for those coins; tokens, and every other wallet, are. Because of that floor, THORChain is offered only where your slippage tolerance covers one payout fee (at 1.2%, about $50 into Bitcoin). GUM's own fee on THORChain routes is 0 bps; a positive fee would be paid through THORChain's affiliate share and is off until that is set up. Even at zero fee, each Layerswap quote is ordered once: posting it again returns the same order ([Create an order](/universal-bridge/v2/create-order)). Layerswap's receive amount and quoted minimum are offchain estimates. Its source Depository transaction does not enforce a destination recipient or minimum payout. A local quote expiry does not fix the eventual deposit-time rate; show the selected route's warning before signing. deBridge (`debridge`) pays a positive GUM fee as DLN's affiliate fee, which the API reads from the order itself before signing. It is paid automatically only on orders from EVM networks, so a positive fee leaves deBridge routes from Solana and TRON out. Its fixed protocol fee in the source network's coin is separate from GUM's fee. Bungee (`socket`) also requires zero GUM application fee. Its upstream service fee is separate and does not prove collection of a GUM fee. Restoring a positive GUM fee excludes new Bungee quotes and builds until that collection is qualified; pending transfers remain trackable with retained credentials. Profile, access and transaction-validation requirements still apply at zero. ## Minimum trade size The API recommends at least **$3**, or **$10** when either the input or output chain is Ethereum (`evm:1`). A smaller amount is still quoted, and the quote response and every stream snapshot flag it with `belowMinimum`. A quote for 5 USDC from Ethereum, shortened to one route: ```json { "routes": [ { "provider": "gum", "outAmount": "4996100", "expiresAt": 1792540830000 } ], "failures": [], "quotedAt": 1792540800000, "belowMinimum": { "minimumUsd": 10, "minimumAmount": "10005692" } } ``` `minimumUsd` is the recommended minimum in USD, and `minimumAmount` is that minimum in the input token's atomic units at the price the service checked the amount with. `belowMinimum` is absent at or above the minimum. The API no longer answers HTTP 400 with `reason: "below-minimum"`. A small quote isn't always a bad one, so warn only when it is. When a quote carries `belowMinimum`, ask the user to confirm before you request a build if the selected route: - carries `warning: "loses-value"`, or - keeps under 90% of what the user spends, counting the source-chain network fee: `outputUsd < 0.9 × (inputUsd + sourceGasUsd)`, with `sourceGasUsd` as 0 when the route doesn't report it. Without a USD value for both tokens, only the route's own warning counts. When you warn, offer `minimumAmount` as a one-tap amount; offer it as well when no route comes back at all. Round it up a little so a price move doesn't leave it short: the GUM app adds 0.5% and rounds up to three significant digits, so `"10005692"` of USDC becomes 10.1. A quote under the minimum that keeps its value needs no warning. The GUM app follows these rules. Every router, Universal Swap (`gum`) included, is asked at any amount; a router that can't carry an amount that small refuses it itself. If the service cannot price the input, the quote answers HTTP 400 with `reason: "price-unavailable"` and `minimumUsd`: without a price nothing protects the transfer's value. Do not treat a missing price as zero. `price-unavailable` won't change on a retry until the token is priced; an outage of the price source answers 503 instead, which is worth retrying. ## Request limits Public limits are per client IP over a 60-second window: | Operation | Requests per minute | | -------------------------------------------------- | ------------------- | | Chain catalog | 600 | | Token search | 90 | | Token market | 180 | | Quotes | 30 | | Build, submit, and provider-specific native quotes | 20 shared | | Transfer tracking | 120 | An API key can have its own budget shared across quote and build requests. An HTTP 429 response includes `Retry-After` in seconds; wait for that duration before retrying. Debounce token searches and avoid polling multiple copies of the same transfer. Keep valid results during a temporary failure, but never present an expired quote as executable. --- ## Overview URL: https://docs.gum.ag/trading-api/overview Markdown: https://docs.gum.ag/trading-api/overview.md Description: Buy, sell, deposit and withdraw on GUM from your own code, with a Solana or EVM wallet as your account. import { CardGroup_1 } from "../../components/trading-api/overview/CardGroup_1.jsx"; 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](/protocol/typed-signatures). See [Sign with your wallet](/trading-api/signing). 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](/trading-api/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`](/trading-api/signing#perps-order-and-cancel-quotes) 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`](/trading-api/reference/get-tokens) | Find tokens and stocks you can trade | | [`GET /v1/balances/{address}`](/trading-api/reference/get-balances) | Your USD and token balances | | [`GET /v1/deposit-addresses/{address}`](/trading-api/reference/get-deposit-addresses) | Where to send funds, per chain | | [`GET /v1/history/{address}`](/trading-api/reference/get-history) | Deposits, swaps and withdrawals | | [`POST /v1/swap/quote`](/trading-api/reference/post-swap-quote) | Quote a buy or a sell | | [`POST /v1/swap`](/trading-api/reference/post-swap) | Submit a signed quote | | [`GET /v1/swap/{id}`](/trading-api/reference/get-swap) | A trade's status, polled or streamed | | [`POST /v1/withdraw/quote`](/trading-api/reference/post-withdraw-quote) | Quote a withdrawal | | [`POST /v1/withdraw`](/trading-api/reference/post-withdraw) | Submit a signed withdrawal | | [`GET /v1/withdraw/{id}`](/trading-api/reference/get-withdraw) | A withdrawal's status, polled or streamed | | [`GET /v1/chains`](/trading-api/reference/get-chains) | Supported chains and their dollar tokens | ### GUM Perps | Endpoint | What it does | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | | [`GET /v1/perps/markets`](/trading-api/reference/get-perps-markets) | Markets, live hourly & annualized funding, fees and tiers | | [`GET /v1/perps/markets/{symbol}/orderbook`](/trading-api/reference/get-perps-orderbook) | L2 orderbook bids and asks | | [`GET /v1/perps/markets/{symbol}/funding-history`](/trading-api/reference/get-perps-funding-history) | Historical hourly funding rates and average APR | | [`GET /v1/perps/accounts/{address}`](/trading-api/reference/get-perps-account) | Sub-accounts, margin balances, open positions & open orders | | [`POST /v1/perps/deposit/quote`](/trading-api/reference/post-perps-deposit-quote) / [`POST /v1/perps/deposit`](/trading-api/reference/post-perps-deposit) | Transfer USD from GUM spot into a Perps sub-account (free) | | [`POST /v1/perps/withdraw/quote`](/trading-api/reference/post-perps-withdraw-quote) / [`POST /v1/perps/withdraw`](/trading-api/reference/post-perps-withdraw) | Transfer free USD margin back to GUM spot (free) | | [`POST /v1/perps/leverage/quote`](/trading-api/reference/post-perps-leverage-quote) / [`POST /v1/perps/leverage`](/trading-api/reference/post-perps-leverage) | Set leverage for a market (cross or isolated) | | [`POST /v1/perps/orders/quote`](/trading-api/reference/post-perps-orders-quote) / [`POST /v1/perps/orders`](/trading-api/reference/post-perps-orders) | Quote and place market, limit or post-only Perps orders | | [`POST /v1/perps/orders/cancel/quote`](/trading-api/reference/post-perps-cancel-quote) / [`POST /v1/perps/orders/cancel`](/trading-api/reference/post-perps-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.** `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](/trading-api/errors-and-limits). --- ## Quickstart URL: https://docs.gum.ag/trading-api/quickstart Markdown: https://docs.gum.ag/trading-api/quickstart.md Description: Buy $5 of SOL: quote, sign, submit, track. ```js import bs58 from "bs58"; import nacl from "tweetnacl"; const API = "https://api.gum.ag/app/v1"; const secretKey = bs58.decode(process.env.SOLANA_SECRET_KEY); const address = bs58.encode(secretKey.slice(32)); const call = async (path, body) => { const res = await fetch(API + path, { method: body ? "POST" : "GET", headers: { "content-type": "application/json" }, body: body && JSON.stringify(body), }); const data = await res.json(); if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`); return data; }; ``` ## 1. Quote ```js const quote = await call("/swap/quote", { address, side: "buy", chainId: 900, token: "So11111111111111111111111111111111111111112", amount: "5", }); ``` To sell, set `side: "sell"` and give `amount` in tokens. ## 2. Sign ```js const message = Uint8Array.from(atob(quote.message), (c) => c.charCodeAt(0)); const signature = bs58.encode(nacl.sign.detached(message, secretKey)); ``` With an EVM wallet, pass your `0x` address and sign with `personal_sign`, e.g. viem's `account.signMessage({ message: { raw: message } })`. See [Sign with your wallet](/trading-api/signing). ## 3. Submit ```js const { id } = await call("/swap", { transaction: quote.transaction, signature, }); ``` ## 4. Track ```js let trade; do { await new Promise((resolve) => setTimeout(resolve, 2000)); trade = await call(`/swap/${id}`); } while (!trade.final); ``` Or stream `/v1/swap/{id}/events`. See [Track status](/trading-api/status). --- ## Sign with your wallet URL: https://docs.gum.ag/trading-api/signing Markdown: https://docs.gum.ag/trading-api/signing.md Description: What a quote's message and transaction are, how your signature becomes a GUM Network typed signature, and how to sign with a Solana or EVM key in JavaScript, Python, Rust or Go, or with a browser wallet. Every quote returns two base64 strings: - `transaction`: the whole GUM Network transaction, in its [wire format](/protocol/wire-format). Send it back unchanged. - `message`: the part of `transaction` that signatures cover. Sign these bytes with your wallet. The quote's `signer.address` is the GUM account that must sign, and `signer.signWith` says how: `solana` or `evm`. In the examples, `message` is the decoded bytes. ## What's in the transaction A GUM Network transaction is a Solana legacy message with [typed signature](/protocol/typed-signatures) records in front, one per signer. Each record is a length, a one-byte type tag and the signature, and record _i_ signs for account _i_ of the message. GUM's fee payer comes first and has already signed, so every quote starts like this: ```layout offset bytes meaning 0 02 2 records: GUM's fee payer, then you 1 41 00 length 65, tag 0x00 (Ed25519) 3–66 64 bytes the fee payer's signature 67 41 00 length 65, tag 0x00 69–132 64 zeros your slot, empty until you sign 133– … the Solana legacy message: message ``` You never build a record, and a Solana SDK can't: it writes bare 64-byte signatures, without the length and tag. Sign `message` the way your wallet signs anything and send only the signature. The API turns it into your typed signature, checks it against `message` exactly as GUM Network validators will, writes it into your slot and submits the transaction: | `signWith` | You send | Your record becomes | | ---------- | --------------------------------------------------- | --------------------------------------------------------------------------- | | `solana` | The 64-byte Ed25519 signature | `41` (length 65), `00`, then the signature: 66 bytes | | `evm` | The 65-byte `personal_sign` signature: `r`, `s`, `v` | `82 01` (length 130), `10`, then your 65-byte public key, `r` and `s`: 132 bytes | For an EVM wallet, the API recovers your public key from the signature and drops `v`, because a typed signature carries the key instead. It also switches a high `s` to the low form GUM Network requires. Your account is the address your record signs for. For a Solana wallet, that's its public key. For an EVM wallet, it's a [typed address](/protocol/typed-signatures#addresses) built from your `0x` address and tag `0x10`. Pass either form as `address`. ## Solana keys Sign the raw `message` bytes with Ed25519. Send the 64-byte signature as base58, base64 or hex. ```js tab import bs58 from "bs58"; import nacl from "tweetnacl"; const signature = bs58.encode(nacl.sign.detached(message, secretKey)); ``` ```python tab from solders.keypair import Keypair keypair = Keypair.from_base58_string(secret_key) signature = str(keypair.sign_message(message)) ``` ```rust tab use ed25519_dalek::{Signer, SigningKey}; let keypair: [u8; 64] = bs58::decode(secret_key).into_vec()?.try_into().unwrap(); let signing_key = SigningKey::from_keypair_bytes(&keypair)?; let signature = bs58::encode(signing_key.sign(&message).to_bytes()).into_string(); ``` ```go tab import ( "crypto/ed25519" "github.com/mr-tron/base58" ) key, err := base58.Decode(secretKey) if err != nil { return err } signature := base58.Encode(ed25519.Sign(ed25519.PrivateKey(key), message)) ``` ## Solana browser wallets Wallets don't sign arbitrary bytes that look like a transaction, so wrap `message` in one and ask the wallet to sign it. The signature covers the same bytes. This is how the GUM app signs. Send only your signature: the transaction the wallet returns is in Solana's format, which GUM Network can't read. ```js import { VersionedMessage, VersionedTransaction } from "@solana/web3.js"; import bs58 from "bs58"; const solanaMessage = VersionedMessage.deserialize(message); const signed = await wallet.signTransaction( new VersionedTransaction(solanaMessage) ); const index = solanaMessage.staticAccountKeys.findIndex((key) => key.equals(wallet.publicKey) ); const signature = bs58.encode(signed.signatures[index]); ``` ### Perps order and cancel quotes Perps margin deposits, withdrawals and leverage updates return a GUM Network transaction message (sign them with `signTransaction` above). Perps **order** (`/v1/perps/orders/quote`) and **cancel** (`/v1/perps/orders/cancel/quote`) quotes instead return serialized GUM Perps action bytes, not a Solana transaction message. Decode `message` from base64 and sign those bytes directly with `wallet.signMessage`: ```js import bs58 from "bs58"; const bytes = Uint8Array.from(atob(quote.message), (c) => c.charCodeAt(0)); const signatureBytes = await wallet.signMessage(bytes); const signature = bs58.encode(signatureBytes); ``` Raw Solana keys (Ed25519 over the decoded `message` bytes) and EVM wallets (`personal_sign`) sign both transaction messages and Perps action bytes the same way. ## EVM keys and wallets Sign the raw `message` bytes with `personal_sign` (EIP-191). Send the 65-byte signature as hex. ```js tab="viem" const signature = await account.signMessage({ message: { raw: message } }); ``` ```js tab="ethers" const signature = await wallet.signMessage(message); ``` ```js tab="Browser wallet" const hex = Array.from(message, (byte) => byte.toString(16).padStart(2, "0")); const signature = await window.ethereum.request({ method: "personal_sign", params: [`0x${hex.join("")}`, address], }); ``` ```python tab from eth_account import Account from eth_account.messages import encode_defunct signed = Account.sign_message(encode_defunct(primitive=message), private_key=key) signature = signed.signature.hex() ``` ```rust tab use alloy::signers::{local::PrivateKeySigner, Signer}; let signer: PrivateKeySigner = private_key.parse()?; let signature = signer.sign_message(&message).await?; let signature = alloy::hex::encode_prefixed(signature.as_bytes()); ``` ```go tab import ( "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" ) sig, err := crypto.Sign(accounts.TextHash(message), privateKey) if err != nil { return err } signature := hexutil.Encode(sig) ``` --- ## Track status URL: https://docs.gum.ag/trading-api/status Markdown: https://docs.gum.ag/trading-api/status.md Description: Follow a trade or withdrawal until it settles: poll it, or stream live updates. Submitting returns an `id` plus a `statusUrl` and an `eventsUrl`. Both give the same object: `status`, a `final` flag, and, while it's pending, a human-readable `step`. | `status` | Meaning | Final | | ----------- | -------------------------------------------------------------------------------- | ----- | | `pending` | Submitted and in progress. `step` says what's happening. | No | | `completed` | Done. `receive` (swaps) or `amount` (withdrawals) shows what arrived. | Yes | | `failed` | Didn't go through. `reason` says why. A failed swap's funds come back on their own, and it then turns `refunded`. | Swaps: no. Withdrawals: yes | | `refunded` | A failed swap's funds are back in your balance. | Yes | | `cancelled` | A withdrawal was cancelled and its funds returned. | Yes | Stop when `final` is `true`. Most trades settle in seconds; withdrawals take about a minute, and a few minutes on Ethereum. ## Poll ```js let status; do { await new Promise((resolve) => setTimeout(resolve, 2000)); status = await (await fetch(trade.statusUrl)).json(); } while (!status.final); ``` ## Stream The `/events` routes are server-sent events. Each message is the full status object. The first one is the current status, so a late or reconnecting client never misses the outcome. The stream closes after the final status. ```bash curl -N https://api.gum.ag/app/v1/swap//events ``` In a browser, `EventSource` reconnects for you: ```js const events = new EventSource(trade.eventsUrl); events.onmessage = (event) => { const status = JSON.parse(event.data); console.log(status.status, status.step ?? ""); if (status.final) events.close(); }; ``` In Node, read the stream and reconnect when it drops: ```js const API = "https://api.gum.ag/app/v1"; const url = `${API}/swap/${process.argv[2]}/events`; for (;;) { try { const response = await fetch(url); const decoder = new TextDecoder(); let buffer = ""; for await (const chunk of response.body) { buffer += decoder.decode(chunk, { stream: true }); let end = buffer.indexOf("\n\n"); while (end >= 0) { const data = buffer .slice(0, end) .split("\n") .filter((line) => line.startsWith("data: ")) .map((line) => line.slice(6)) .join("\n"); buffer = buffer.slice(end + 2); end = buffer.indexOf("\n\n"); if (!data) continue; const status = JSON.parse(data); console.log(status.status, status.step ?? ""); if (status.final) process.exit(0); } } } catch { // The connection dropped; reconnect below. } await new Promise((resolve) => setTimeout(resolve, 3000)); } ``` Use `/withdraw/{id}/events` the same way for withdrawals. ## Deposits `GET /v1/deposits/{address}/events` streams deposits as they reach your account: one message when a deposit is seen, another when it's credited. It's live only, so open it before you send funds. To find past deposits, use [`GET /v1/history/{address}?type=deposit`](/trading-api/reference/get-history). ```bash curl -N https://api.gum.ag/app/v1/deposits/
/events ``` --- ## CLI URL: https://docs.gum.ag/trading-api/cli Markdown: https://docs.gum.ag/trading-api/cli.md Description: Trade from your terminal with gumag, or connect it to an MCP client. `gumag` is the Trading API as commands. They are generated from the API's OpenAPI spec, so every operation has one, and they print JSON. It signs with a wallet kept on your machine, and agents find their way with `gumag cli search` instead of reading help pages. ```bash npx @gumag/cli auth login # a bot wallet; fund it from `npx @gumag/cli deposit` npx @gumag/cli buy SOL 5 # quote, confirm, sign, submit, wait npx @gumag/cli cli search "withdraw usdc to base" ``` `npm install -g @gumag/cli` installs the `gumag` command (and its shorter alias `gumx`), which the rest of this page uses. ## Commands Commands are `gumag `, with shortcuts for the everyday tasks: | Command | What it does | | --- | --- | | `gumag chains list` | Supported chains and their dollar tokens | | `gumag tokens search ` | Tradable tokens and stocks | | `gumag balance [address]` | Cash and token balances (`balances get`) | | `gumag deposit [address]` | Your deposit address on every chain (`deposit-addresses get`) | | `gumag deposits watch` | Deposits as they arrive | | `gumag history list [--all]` | Deposits, swaps and withdrawals | | `gumag swaps quote --side buy --token SOL --amount 5` | Price a trade without making it | | `gumag buy `, `gumag sell ` | Trade (`swaps create`) | | `gumag swaps get [--wait]`, `gumag swaps watch ` | Track a trade | | `gumag withdraw --to
--chain ` | Withdraw (`withdrawals create`) | | `gumag withdrawals get `, `gumag withdrawals watch ` | Track a withdrawal | | `gumag perps markets list` | Active GUM Perps markets, funding rates, fees and tiers | | `gumag perps orderbook get [--depth 20]` | L2 orderbook bids and asks | | `gumag perps funding list [--limit 168]` | Hourly funding history and average APR | | `gumag perps account get [address]` | Perps sub-accounts, balances, margin, configured leverage, positions and open orders | | `gumag perps positions [address] [--symbol ]` | Open Perps positions across sub-accounts | | `gumag perps orders list [address] [--symbol ]` | Open resting Perps orders across sub-accounts | | `gumag long `, `gumag short ` | Open or add to a Perps position in USD notional (`perps orders create`) | | `gumag perps close [size]` | Close all or part of an open Perps position (reduce-only market order) | | `gumag perps orders quote --symbol --side buy\|sell --size ` | Preview a Perps order without signing | | `gumag perps orders cancel [--order-id \| --cancel-all]` | Cancel one order or every open order in a market | | `gumag perps deposit `, `gumag perps withdraw ` | Move USD between GUM spot and Perps margin (free) | | `gumag perps leverage set ` | Set leverage for a Perps market | `gumag schema ` prints any command's arguments and flags with their types, and `gumag api ` calls any operation in the spec, including ones newer than your copy of the CLI. Tab completion: `gumag completion bash|zsh|fish`. ## Output Results are JSON on stdout: indented on a terminal, one line when piped or run by an agent (`--pretty` and `--compact` choose). `watch` and `history list --all` print one JSON object per line. Failures are `{ "error": { "code", "message", "details" } }` on stderr with exit code 1. ## Wallets and profiles `gumag auth login` creates a key (Solana, or EVM with `--evm`) or imports one with `--import` from stdin or a hidden prompt. Each profile keeps its own key, network and USD limit: ```bash gumag auth login --profile devbot --network devnet --max-usd 25 gumag auth status gumag auth use default ``` Profile names are lowercase letters, digits, `-` and `_`. Keys live in `~/.config/gum/keys`, readable only by you; `auth logout` moves a key to `keys/archive` rather than deleting it. `GUM_SOLANA_SECRET_KEY` or `GUM_EVM_PRIVATE_KEY` override the profile's key, and `GUM_API_URL` points at another API, for example `http://localhost:4000/v1`. ## Safety - **Limits.** A trade or withdrawal is refused above the lowest of `--max-usd`, `GUM_MAX_TRADE_USD` and the profile's limit, and refused outright when a limit is set but the quote can't be valued in USD. - **Confirmation.** On a terminal, `gumag` shows the quote and asks before signing. With nobody at the terminal (a script, CI or an agent), it stops with `confirmation_required` and the quote in `details` unless you pass `--yes`. - **Dry runs.** `--dry-run` quotes and signs, then has the API check the signature without executing anything. - **API.** `gumag` signs the transactions the API builds and checks limits against the USD value it reports. Leave `GUM_API_URL` unset, or point it only at an API you trust; on a terminal, `gumag` warns before signing for a host that isn't gum.ag. ## Agents Install the GUM trading skill for Claude Code, Codex, Cursor, and other coding agents: ```bash npx skills add jupnet/gum-cli ``` Or run `gumag cli agents-md` to print a section for your project's `AGENTS.md`. Source code and releases live at [github.com/jupnet/gum-cli](https://github.com/jupnet/gum-cli). When `gumag` detects a coding agent (Claude Code, Codex, Cursor and others), its help and errors point the agent at `gumag cli search` and `gumag schema`. ## MCP server Connect `gumag` to Claude Code, Codex, Cursor or any MCP client. For Claude Code: ```bash claude mcp add gum -- npx -y @gumag/cli@latest mcp ``` Its tools are: - **Spot & account:** `whoami`, `list_chains`, `search_tokens`, `get_balances`, `get_deposit_addresses`, `get_history`, `quote`, `trade`, `get_swap`, `quote_withdrawal`, `withdraw`, `get_withdrawal`. - **GUM Perps:** `list_perps_markets`, `get_perps_orderbook`, `get_perps_funding_history`, `get_perps_account`, `quote_perps_order`, `perps_place_order`, `perps_close_position`, `perps_cancel_order`, `perps_deposit`, `perps_withdraw`, `perps_set_leverage`. - **Discovery:** `search_api` and `call_api` for any other operation. The key stays in the server process, so the agent never sees it through MCP. An agent that can also run shell commands as you can read `~/.config/gum/keys`, so fund a bot wallet only with what you'd let the agent spend. `trade`, `withdraw`, `perps_place_order`, `perps_close_position`, `perps_cancel_order`, `perps_deposit`, `perps_withdraw` and `perps_set_leverage` sign with your wallet and move real funds or orders. They run only when the server has a USD limit (`GUM_MAX_TRADE_USD` or the profile's), including `dryRun` (which still signs locally without executing). Use `quote`, `quote_withdrawal`, and `quote_perps_order` for unsigned quotes, and clients that honour destructive hints ask before each write tool. --- ## Errors and limits URL: https://docs.gum.ag/trading-api/errors-and-limits Markdown: https://docs.gum.ag/trading-api/errors-and-limits.md Description: Every error has the same shape and a stable code; rate limits are per IP and come back in response headers. ## Errors Every error has the same shape. Branch on `code`; `message` is for people and its wording can change. ```json { "error": { "code": "invalid_signature", "message": "signature was not made by GP8Z… over this quote's `message`" } } ``` | Code | Status | What to do | | ---------------------- | ------ | ------------------------------------------------------------------------------------------- | | `invalid_request` | 400 | Fix the field `message` names: a missing value, an amount with too many decimals, a bad cursor. | | `invalid_address` | 400 | Use a Solana address, an EVM `0x` address or a GUM address. For withdrawals, check `destination`. | | `unsupported_account` | 400 | The address belongs to a Google, Apple, X or passkey account. Trade with a Solana or EVM wallet. | | `unsupported_chain` | 400 | Use a chain from `GET /v1/chains`. USD can't be withdrawn to BSC or Robinhood. | | `token_not_found` | 404 | Find the token's address with `GET /v1/tokens`. | | `quote_failed` | 400 | No route right now: the amount may be too small, or the token too illiquid. Try again later or change the amount. | | `quote_expired` | 400 | Quotes last about 30 seconds. Get a new quote, sign it and submit right away. | | `invalid_transaction` | 400 | Send the quote's `transaction` unchanged, to the matching endpoint (`/swap` or `/withdraw`). | | `invalid_signature` | 401 | Sign `message` with the account in `signer.address`. See [Sign with your wallet](/trading-api/signing). | | `submit_failed` | 400 | The trade or withdrawal was rejected, for example for an insufficient balance. Read `message`. | | `not_found` | 404 | Unknown endpoint or id. `GET /v1` lists every endpoint. | | `method_not_allowed` | 405 | Quotes and submissions are `POST`s with a JSON body. | | `rate_limited` | 429 | Wait `Retry-After` seconds. | | `too_many_streams` | 429 | Close a live stream, or poll instead. | | `upstream_unavailable` | 502, 503 | A GUM service didn't answer. Retry with backoff. | | `internal_error` | 500 | Retry with backoff; report it on [Discord](https://discord.gg/gum-ag) if it persists. | A submit that times out or returns a 5xx may still have gone through. Check [`GET /v1/history/{address}`](/trading-api/reference/get-history) before you submit again, so you don't trade twice. A quote can only be submitted once. ## Rate limits Limits are per IP address, per minute. Every request counts toward the overall limit, and some also count toward a tighter one: | What | Limit | | ---------------------------------------- | --------------- | | All requests | 120 per minute | | Quotes (`/swap/quote`, `/withdraw/quote`) | 30 per minute | | Submissions (`/swap`, `/withdraw`) | 20 per minute | | Deposit-address lookups | 10 per minute | | Open live streams (`/events`) | 10 at a time | Every response reports the limit closest to running out: | Header | Meaning | | --------------------- | -------------------------------------------- | | `RateLimit-Limit` | Requests allowed in the current window | | `RateLimit-Remaining` | Requests left in the current window | | `RateLimit-Reset` | Seconds until the window resets | | `Retry-After` | On a 429: seconds to wait before retrying | To stay under the limits, stream status instead of polling it, and quote only when you're about to trade. If you need more, ask on [Discord](https://discord.gg/gum-ag). --- ## Using the API URL: https://docs.gum.ag/trading-api/reference/overview Markdown: https://docs.gum.ag/trading-api/reference/overview.md Description: Base URL, the objects every endpoint shares, and pagination. Base URLs: | Environment | Base URL | | --- | --- | | Production | `https://api.gum.ag/app/v1` | | Devnet | `https://dev-api.gum.ag/app/v1` | Both use the same `/app/v1` prefix. Examples and the playground use production. `GET /v1` lists every endpoint and `GET /v1/openapi.json` is the OpenAPI 3.1 spec. Errors and rate limits are on [Errors and limits](/trading-api/errors-and-limits). ## Activity History, status and the live streams return the same object for a swap, withdrawal or deposit. A field that doesn't apply to the type is left out; one that applies but isn't known yet is `null`. | Field | For | What it means | | ------------- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | All | The request's account on GUM Network, in base58. Pass a swap's to `GET /v1/swap/{id}` and a withdrawal's to `GET /v1/withdraw/{id}`. A swap that settles in one transaction (selling BSC USDT or Robinhood USDG) uses its transaction id. | | `type` | All | `swap`, `withdrawal` or `deposit`. It decides which fields below appear. | | `status` | All | `pending` until it finishes, then `completed`, `failed`, `refunded` (a failed swap's funds are back in your balance) or `cancelled` (a cancelled withdrawal). See [Track status](/trading-api/status). | | `final` | All | `true` once nothing can change: stop polling. A `failed` swap isn't final until its funds are back and it turns `refunded`. | | `step` | Pending | What's happening now, for display, e.g. "Executing swap on Solana" or "Crediting your balance". The wording can change, so don't parse it. | | `reason` | Failed | Why it failed, for display, e.g. "Not filled in time. The amount is being refunded to your balance." | | `side` | Swaps | `buy` spends USD on `token`. `sell` turns `token` into USD. | | `token` | All | The token involved: `address` (its mint or contract on its home chain), `chainId`, `decimals` and `symbol`. Your USD balance shows as `USD` with no address. A USD withdrawal shows the dollar token it pays out, e.g. USDC on Base. | | `pay` | Swaps | `{ amount, symbol }` that left your balance: USD on a buy, the token on a sell. | | `receive` | Swaps | `{ amount, symbol }` that reached your balance. `amount` is `null` until the swap fills. | | `amount` | Withdrawals, deposits | `{ amount, symbol }`: what arrives at `destination`, after `fee`, for a withdrawal; what was credited to your balance for a deposit. | | `fee` | Swaps, withdrawals | `{ amount, symbol }`: GUM's trading fee in USD for a swap, or `null` until the swap completes (the fee is only charged then, and a failed swap is refunded in full); the network fee in the withdrawn token for a withdrawal, already taken out of `amount`. | | `destination` | Withdrawals | The address on `chainId` that receives the funds. | | `chainId` | All | The other chain involved: where a swap's token trades, where a withdrawal goes, where a deposit came from. `900` is Solana; [`GET /v1/chains`](/trading-api/reference/get-chains) lists them all. | | `txHash` | All | The transaction on `chainId`: the swap, the withdrawal's payout or the deposit you sent. `null` until there is one. | | `explorerUrl` | All | `txHash` on that chain's block explorer, or `null` without a `txHash`. | | `createdAt` | All | When the request was made, as an ISO 8601 UTC timestamp. | | `completedAt` | All | When it finished, as an ISO 8601 UTC timestamp. `null` while pending. | ## Amounts Every amount is a decimal string in whole units, like `"0.042203755"`. Send amounts the same way; the API rejects more decimal places than a token has rather than rounding. ## Pagination `GET /v1/history/{address}` returns `nextCursor`. Pass it back as `cursor` to get the next page; it's `null` on the last one. --- ## Tokens URL: https://docs.gum.ag/trading-api/reference/get-tokens Markdown: https://docs.gum.ag/trading-api/reference/get-tokens.md Description: Search the tokens and tokenized stocks you can trade right now. ## Query parameters | Parameter | Required | Description | | --------- | -------- | ------------------------------------------------------------- | | `query` | No | Symbol, name or address. Empty returns popular tokens. | | `chainId` | No | Only tokens on this chain. | | `limit` | No | 1–50, default 20. | ## Response `tokens` lists matches that are tradable right now, most relevant first: | Field | Meaning | | ----------------------- | ------------------------------------------------------------------------ | | `chainId`, `address` | Pass these as `chainId` and `token` to [quote a swap](/trading-api/reference/post-swap-quote). | | `symbol`, `name`, `decimals`, `logoUrl` | Display values. | | `priceUsd` | Latest USD price, when known. | | `type` | `token` or `stock`. | | `verified`, `riskLevel` | Listed on a verified registry; `low`, `medium` or `high` risk. | Many tokens share a symbol, and some copy famous names. Pick by `address`, and prefer `verified: true`. --- ## Balances URL: https://docs.gum.ag/trading-api/reference/get-balances Markdown: https://docs.gum.ag/trading-api/reference/get-balances.md Description: An account's USD cash and every token it holds, with USD values. ## Path parameters | Parameter | Required | Description | | --------- | -------- | ---------------------------------------------------- | | `address` | Yes | A Solana address, an EVM `0x` address or a GUM address. | ## Response | Field | Meaning | | ---------- | ------------------------------------------------------------------------------------------- | | `account` | The GUM account. For an EVM address, this is the GUM address it maps to. | | `usd` | Cash you can spend on buys. | | `tokens` | Everything else you hold, largest first: `chainId`, `address`, `symbol`, `amount`, `valueUsd`, `priceUsd`. Sell with these `chainId` and `address` values. | | `totalUsd` | `usd` plus your tokens' value. | | `perpsUsd` | Your GUM Perps balance, or `null` when it can't be read right now. Not included in `totalUsd`. | --- ## Your deposit addresses URL: https://docs.gum.ag/trading-api/reference/get-deposit-addresses Markdown: https://docs.gum.ag/trading-api/reference/get-deposit-addresses.md Description: Your own deposit address on every supported chain. Anything you send there is credited to your GUM account. ## Path parameters | Parameter | Required | Description | | --------- | -------- | ---------------------------------------------------- | | `address` | Yes | Your Solana address or EVM `0x` address. | ## Response `chains` has one entry per supported chain: | Field | Meaning | | ---------------- | ------------------------------------------------------------------------------- | | `depositAddress` | Send funds here, on this chain. EVM chains share one address. | | `status` | `healthy`, `degraded` (slower than usual), `down` (don't send now) or `unknown`. | | `dollarToken` | The chain's dollar token, credited to you as USD. | Send any token worth more than `minimumUsd` ($2). Smaller transfers wait at the address until the total passes the minimum. Deposits usually arrive within seconds of the chain confirming them; watch them with [`/v1/deposits/{address}/events`](/trading-api/status#deposits). The first call creates the addresses, so this endpoint has a tighter [rate limit](/trading-api/errors-and-limits#rate-limits). Store them; they don't change. --- ## History URL: https://docs.gum.ag/trading-api/reference/get-history Markdown: https://docs.gum.ag/trading-api/reference/get-history.md Description: An account's deposits, swaps and withdrawals, newest first. ## Parameters | Parameter | In | Required | Description | | --------- | ----- | -------- | -------------------------------------------------- | | `address` | path | Yes | A Solana address, an EVM `0x` address or a GUM address. | | `type` | query | No | `deposit`, `swap` or `withdrawal`. Omit for all. | | `limit` | query | No | 1–100, default 20. | | `cursor` | query | No | The previous page's `nextCursor`. | | `chainId` | query | No | Only one market: the token's chain. Pass it with `token`. | | `token` | query | No | Only one market: the token's address on `chainId`. Pass it with `chainId`. | | `mint` | query | No | Only one market, by its GUM mint. Use instead of `chainId` and `token`. | The market filter works with every `type`: a swap's token, or the token a deposit or withdrawal moved. Keep it on every page you fetch with `cursor`. ## Response `items` holds [Activity](/trading-api/reference/overview#activity) objects, newest first. `nextCursor` fetches the next page and is `null` on the last. --- ## Quote a swap URL: https://docs.gum.ag/trading-api/reference/post-swap-quote Markdown: https://docs.gum.ag/trading-api/reference/post-swap-quote.md Description: Price a buy or a sell and get the message to sign. Quotes last about 30 seconds. ## Body | Field | Required | Description | | ------------- | -------- | -------------------------------------------------------------------------------- | | `address` | Yes | Your Solana address or EVM `0x` address. | | `side` | Yes | `buy` spends USD on the token; `sell` sells the token for USD. | | `chainId` | Yes | The token's chain. | | `token` | Yes | The token's address on `chainId`, from [`GET /v1/tokens`](/trading-api/reference/get-tokens). | | `amount` | Yes | Buy: USD to spend. Sell: tokens to sell. A decimal string. | | `slippageBps` | No | Defaults to 100 (1%), or 200 on Ethereum and Robinhood. At most 1000. | ## Response | Field | Meaning | | -------------------- | ------------------------------------------------------------------------------- | | `pay` | What leaves your balance. | | `receive` | `amount` you should get, and `minimum`: the trade fails rather than fill below it. | | `fee` | GUM's fee, in USD, already counted in `receive`. | | `priceUsd` | The effective price per token. | | `usdValue` | USD the trade moves: spent on a buy, received on a sell. Null when it can't be priced. | | `priceImpact` | As a fraction (`"0.0024"` is 0.24%), when known. | | `expiresAt` | Submit before this. | | `signer` | `{ address, signWith }`: the GUM account that signs, and `solana` or `evm`. | | `message` | The Solana legacy message inside `transaction`, base64. [Sign it with your wallet](/trading-api/signing). | | `transaction` | The GUM Network transaction in its [wire format](/protocol/wire-format), base64, signed by GUM's fee payer and waiting for your signature. Send it back unchanged to [`POST /v1/swap`](/trading-api/reference/post-swap). | A quote doesn't reserve anything: nothing happens until you submit it. --- ## Submit a swap URL: https://docs.gum.ag/trading-api/reference/post-swap Markdown: https://docs.gum.ag/trading-api/reference/post-swap.md Description: Submit a signed quote. The trade settles in seconds; track it with the returned id. ## Body | Field | Required | Description | | ------------- | -------- | --------------------------------------------------------------------------- | | `transaction` | Yes | The quote's `transaction`, unchanged. | | `signature` | Yes | Your signature of the quote's `message`. See [Sign with your wallet](/trading-api/signing). | ## Response `202` with the trade's `id`, `status: "pending"`, and two URLs to track it: `statusUrl` and `eventsUrl` (live). See [Track status](/trading-api/status). Submit each quote once. If the request times out, check [`GET /v1/history/{address}`](/trading-api/reference/get-history) before trying again with a new quote. --- ## Swap status URL: https://docs.gum.ag/trading-api/reference/get-swap Markdown: https://docs.gum.ag/trading-api/reference/get-swap.md Description: A trade's status by id, polled or streamed live. ## Path parameters | Parameter | Required | Description | | --------- | -------- | ----------------------------------- | | `id` | Yes | The `id` from `POST /v1/swap`. | ## Response An [Activity](/trading-api/reference/overview#activity). Poll until `final` is `true`. ## Live updates `GET /v1/swap/{id}/events` streams the same object as server-sent events. The first message is the current status and the stream closes after the final one. See [Track status](/trading-api/status). If a trade can't fill before its quote's window closes, it reads `failed` and GUM refunds it automatically; it then reads `refunded`. --- ## Quote a withdrawal URL: https://docs.gum.ag/trading-api/reference/post-withdraw-quote Markdown: https://docs.gum.ag/trading-api/reference/post-withdraw-quote.md Description: Prepare a withdrawal to an address on another chain and get the message to sign. ## Body | Field | Required | Description | | ------------- | -------- | ----------------------------------------------------------------------------------- | | `address` | Yes | Your Solana address or EVM `0x` address. | | `token` | Yes | `"USD"` to withdraw cash as the chain's dollar token, or the address of a token you hold on `chainId`. | | `chainId` | Yes | The destination chain. USD can't go to BSC or Robinhood. | | `amount` | Yes | A decimal string. | | `destination` | Yes | The address on `chainId` that receives the funds. | ## Response The same signing fields as a swap quote (`signer`, `message`, `transaction`, `expiresAt`), plus `amount`, `token`, `destination`, `warnings` about the destination, `fee` (the chain's withdrawal fee in USD, taken out of the amount on delivery), and `usdValue`: the withdrawal's USD value, or null when the token has no price. Withdrawals can't be reversed. Check `chainId` and `destination` before you submit. --- ## Submit a withdrawal URL: https://docs.gum.ag/trading-api/reference/post-withdraw Markdown: https://docs.gum.ag/trading-api/reference/post-withdraw.md Description: Submit a signed withdrawal and track it with the returned id. ## Body | Field | Required | Description | | ------------- | -------- | ---------------------------------------------------- | | `transaction` | Yes | The withdrawal quote's `transaction`, unchanged. | | `signature` | Yes | Your signature of the quote's `message`. | ## Response `202` with the withdrawal's `id`, `status: "pending"`, `statusUrl` and `eventsUrl`. Withdrawals usually arrive in about a minute; Ethereum takes a few minutes. --- ## Withdrawal status URL: https://docs.gum.ag/trading-api/reference/get-withdraw Markdown: https://docs.gum.ag/trading-api/reference/get-withdraw.md Description: A withdrawal's status by id, polled or streamed live. ## Path parameters | Parameter | Required | Description | | --------- | -------- | ------------------------------------ | | `id` | Yes | The `id` from `POST /v1/withdraw`. | ## Response An [Activity](/trading-api/reference/overview#activity): `amount` is what arrives after the fee, and `txHash` links the delivery once it lands. `GET /v1/withdraw/{id}/events` streams it live, like [swap status](/trading-api/reference/get-swap#live-updates). --- ## Chains URL: https://docs.gum.ag/trading-api/reference/get-chains Markdown: https://docs.gum.ag/trading-api/reference/get-chains.md Description: The chains GUM supports, and the dollar token it credits and pays out on each. ## Response `chains` lists each supported chain: | Field | Meaning | | ----------------- | --------------------------------------------------------------------------------- | | `chainId` | Use it as `chainId` everywhere else. | | `name`, `family` | Display name, and `svm`, `evm` or `sui`. | | `dollarToken` | `{ address, decimals, symbol }`: USDC on most chains, USDT on BSC, USDG on Robinhood. | | `usdWithdrawable` | `false` on BSC and Robinhood: USD can't be withdrawn there, but their dollar token can. | --- ## Perps markets URL: https://docs.gum.ag/trading-api/reference/get-perps-markets Markdown: https://docs.gum.ag/trading-api/reference/get-perps-markets.md Description: List active GUM Perps markets with live mark/index prices, hourly and annualized funding rates, fees and margin tiers. ## Response `markets` lists every active GUM Perps market: | Field | Meaning | | --- | --- | | `symbol`, `pubkey` | Market symbol (`SOL`, `BTC`, `ETH`, `SPCX`, …) and on-chain market address. | | `markPrice`, `indexPrice`, `midPrice`, `bestBid`, `bestAsk`, `lastTradePrice` | Live pricing as decimal strings. | | `volume24hUsd`, `openInterestUsd`, `openInterestBase`, `priceChangePercent24h` | 24-hour activity and open interest. | | `fundingRateBps1h`, `hourlyFundingRate`, `annualizedFundingRate`, `predictedFundingRate`, `nextFundingAt` | Live hourly and annualized funding rates (`annualizedFundingRate` is `rateBps1h / 10000 * 8760`). | | `maxLeverage`, `maxAccountPositionNotionalUsd`, `riskTiers` | Position limits and initial/maintenance margin tiers. | | `makerFeeBps`, `takerFeeBps`, `liquidationFeeBps` | Market fees in basis points. | | `tickSize`, `stepSize` | Minimum price and size increments. | --- ## Perps orderbook URL: https://docs.gum.ag/trading-api/reference/get-perps-orderbook Markdown: https://docs.gum.ag/trading-api/reference/get-perps-orderbook.md Description: L2 orderbook bids and asks for a GUM Perps market. ## Parameters | Parameter | In | Required | Description | | --- | --- | --- | --- | | `symbol` | Path | Yes | Market symbol from [`GET /v1/perps/markets`](/trading-api/reference/get-perps-markets). | | `depth` | Query | No | Number of price levels per side (1–50, default 20). | ## Response | Field | Meaning | | --- | --- | | `symbol` | Normalized market symbol. | | `bids`, `asks` | Arrays of `[price, size]` decimal-string tuples, best price first. | | `timestamp` | Snapshot time as ISO 8601 UTC. | --- ## Perps funding history URL: https://docs.gum.ag/trading-api/reference/get-perps-funding-history Markdown: https://docs.gum.ag/trading-api/reference/get-perps-funding-history.md Description: Historical hourly funding rates and average annualized funding rate for a GUM Perps market. ## Parameters | Parameter | In | Required | Description | | --- | --- | --- | --- | | `symbol` | Path | Yes | Market symbol from [`GET /v1/perps/markets`](/trading-api/reference/get-perps-markets). | | `limit` | Query | No | Hourly entries to return (1–720, default 168 / 7 days). | ## Response | Field | Meaning | | --- | --- | | `symbol` | Normalized market symbol. | | `averageAnnualizedRate` | Mean annualized funding rate across the returned window, or `null` when empty. | | `entries` | Hourly entries with `timestamp`, `rateBps1h` and `annualizedRate`. | --- ## Perps account URL: https://docs.gum.ag/trading-api/reference/get-perps-account Markdown: https://docs.gum.ag/trading-api/reference/get-perps-account.md Description: An account's GUM Perps sub-accounts, balances, margin, configured market leverage, open positions and resting orders. ## Parameters | Parameter | In | Required | Description | | --- | --- | --- | --- | | `address` | Path | Yes | Solana address, EVM `0x` address or GUM address. | | `subaccountId` | Query | No | Filter to one sub-account index (0–4). Omit for all sub-accounts. | ## Response | Field | Meaning | | --- | --- | | `account`, `address` | Canonical GUM account and the input address. | | `exists` | `true` once a Perps trading account exists for this wallet. | | `subaccounts` | Each sub-account's `accountValueUsd`, `availableToTradeUsd`, `freeBalanceUsd`, `maintenanceMarginUsd`, `leverages`, `positions` and `openOrders`. | --- ## Quote a Perps deposit URL: https://docs.gum.ag/trading-api/reference/post-perps-deposit-quote Markdown: https://docs.gum.ag/trading-api/reference/post-perps-deposit-quote.md Description: Prepare a free USD transfer from your GUM spot balance into a GUM Perps sub-account. ## Body | Field | Required | Description | | --- | --- | --- | | `address` | Yes | Your Solana address or EVM `0x` address. | | `amount` | Yes | USD amount to transfer, as a decimal string (up to 6 decimal places). | | `subaccountId` | No | Target Perps sub-account index (0–4, default 0). | ## Response Returns `amount`, `usdValue`, `tradingAccount`, `expiresAt`, `signer`, `message` and `transaction`. Sign `message` and submit to [`POST /v1/perps/deposit`](/trading-api/reference/post-perps-deposit). Locked promotional credit cannot be transferred into Perps margin. --- ## Submit a Perps deposit URL: https://docs.gum.ag/trading-api/reference/post-perps-deposit Markdown: https://docs.gum.ag/trading-api/reference/post-perps-deposit.md Description: Submit a signed Spot → Perps USD margin deposit. ## Body | Field | Required | Description | | --- | --- | --- | | `transaction` | Yes | The quote's `transaction`, unchanged. | | `signature` | Yes | Your wallet's signature of the quote's `message`. | | `dryRun` | No | Set `true` to verify the signature without submitting. | ## Response Returns `200` with `type: "perps_deposit"`, `status: "completed"`, `final: true`, `transactionId` and `explorerUrl`. --- ## Quote a Perps withdrawal URL: https://docs.gum.ag/trading-api/reference/post-perps-withdraw-quote Markdown: https://docs.gum.ag/trading-api/reference/post-perps-withdraw-quote.md Description: Prepare a free USD transfer from a GUM Perps sub-account back to your GUM spot cash balance. ## Body | Field | Required | Description | | --- | --- | --- | | `address` | Yes | Your Solana address or EVM `0x` address. | | `amount` | Yes | Free USD margin to withdraw back to spot, as a decimal string. | | `subaccountId` | No | Source Perps sub-account index (0–4, default 0). | ## Response Returns `amount`, `usdValue`, `tradingAccount`, `expiresAt`, `signer`, `message` and `transaction`. Sign `message` and submit to [`POST /v1/perps/withdraw`](/trading-api/reference/post-perps-withdraw). --- ## Submit a Perps withdrawal URL: https://docs.gum.ag/trading-api/reference/post-perps-withdraw Markdown: https://docs.gum.ag/trading-api/reference/post-perps-withdraw.md Description: Submit a signed Perps → Spot USD margin withdrawal. ## Body | Field | Required | Description | | --- | --- | --- | | `transaction` | Yes | The quote's `transaction`, unchanged. | | `signature` | Yes | Your wallet's signature of the quote's `message`. | | `dryRun` | No | Set `true` to verify the signature without submitting. | ## Response Returns `200` with `type: "perps_withdraw"`, `status: "completed"`, `final: true`, `transactionId` and `explorerUrl`. --- ## Quote a Perps leverage update URL: https://docs.gum.ag/trading-api/reference/post-perps-leverage-quote Markdown: https://docs.gum.ag/trading-api/reference/post-perps-leverage-quote.md Description: Prepare a target leverage update for a GUM Perps market. ## Body | Field | Required | Description | | --- | --- | --- | | `address` | Yes | Your Solana address or EVM `0x` address. | | `symbol` | Yes | Perps market symbol. | | `leverage` | Yes | Integer target leverage (1 up to the market's `maxLeverage`). | | `marginMode` | No | `cross` (default) or `isolated`. | | `subaccountId` | No | Perps sub-account index (0–4, default 0). | ## Response Returns `symbol`, `leverage`, `marginMode`, `expiresAt`, `signer`, `message` and `transaction`. Sign `message` and submit to [`POST /v1/perps/leverage`](/trading-api/reference/post-perps-leverage). --- ## Submit a Perps leverage update URL: https://docs.gum.ag/trading-api/reference/post-perps-leverage Markdown: https://docs.gum.ag/trading-api/reference/post-perps-leverage.md Description: Submit a signed GUM Perps leverage update. ## Body | Field | Required | Description | | --- | --- | --- | | `transaction` | Yes | The quote's `transaction`, unchanged. | | `signature` | Yes | Your wallet's signature of the quote's `message`. | | `dryRun` | No | Set `true` to verify the signature without submitting. | ## Response Returns `200` with `type: "perps_leverage"`, `status: "completed"`, `final: true`, `transactionId` and `explorerUrl`. --- ## Quote a Perps order URL: https://docs.gum.ag/trading-api/reference/post-perps-orders-quote Markdown: https://docs.gum.ag/trading-api/reference/post-perps-orders-quote.md Description: Price a GUM Perps market, limit or post-only order and get the action message to sign. ## Body | Field | Required | Description | | --- | --- | --- | | `address` | Yes | Your Solana address or EVM `0x` address. | | `symbol` | Yes | Market symbol from [`GET /v1/perps/markets`](/trading-api/reference/get-perps-markets). | | `side` | Yes | `buy` (long) or `sell` (short). | | `size` | Yes | Order size as a decimal string — base units by default, or USD when `sizeCurrency` is `"USD"`. | | `sizeCurrency` | No | `base` (default) or `USD`. | | `orderType` | No | `market` (default), `limit` or `postOnly`. | | `price` | Conditional | Required for `limit` and `postOnly` orders; ignored for `market` orders (which price from the live book with `slippageBps`). | | `timeInForce` | No | Request accepts `GTC`, `IOC` or `FOK` (defaults to `IOC` for market orders, `GTC` for limit/postOnly). Responses return the canonical value (`GoodTilCanceled`, `ImmediateOrCancel` or `FillOrKill`). | | `reduceOnly` | No | `true` to only reduce an open position. | | `slippageBps` | No | Slippage guard for market orders (0–400 bps, default 100). | | `marginMode` | No | `cross` (default) or `isolated`. | | `subaccountId` | No | Perps sub-account index (0–4, default 0). | | `clientOrderId` | No | Optional client-assigned u64 string id for tracking and cancellation. | ## Response Returns `symbol`, `side`, `orderType`, `quantity`, `price`, `usdValue`, `timeInForce` (`GoodTilCanceled`, `ImmediateOrCancel` or `FillOrKill`), `reduceOnly`, `expiresAt`, `signer`, `message` (base64 Borsh action bytes to sign) and `transaction` (base64 action envelope). Sign the decoded `message` bytes with your wallet (in Solana browser wallets, use [`wallet.signMessage`](/trading-api/signing#perps-order-and-cancel-quotes) instead of `signTransaction`) and submit to [`POST /v1/perps/orders`](/trading-api/reference/post-perps-orders). --- ## Submit a Perps order URL: https://docs.gum.ag/trading-api/reference/post-perps-orders Markdown: https://docs.gum.ag/trading-api/reference/post-perps-orders.md Description: Submit a signed GUM Perps order. ## Body | Field | Required | Description | | --- | --- | --- | | `transaction` | Yes | The quote's `transaction`, unchanged. | | `signature` | Yes | Your wallet's signature of the quote's `message`. | | `dryRun` | No | Set `true` to verify the signature without placing the order. | ## Response Returns `200` with `type: "perps_order"`, `status: "accepted"`, `final: false`, `symbol` and `clientOrderId`. This acknowledges matching-engine acceptance rather than a final fill; inspect live positions and resting orders via [`GET /v1/perps/accounts/{address}`](/trading-api/reference/get-perps-account). --- ## Quote a Perps cancel URL: https://docs.gum.ag/trading-api/reference/post-perps-cancel-quote Markdown: https://docs.gum.ag/trading-api/reference/post-perps-cancel-quote.md Description: Prepare cancellation of one open Perps order or every open order in a market. ## Body | Field | Required | Description | | --- | --- | --- | | `address` | Yes | Your Solana address or EVM `0x` address. | | `symbol` | Yes | Perps market symbol. | | `orderId` | Conditional | Open order id to cancel (required unless `clientOrderId` or `cancelAll: true` is set). | | `clientOrderId` | Conditional | Client order id to cancel. | | `cancelAll` | Conditional | Set `true` to cancel every open order in `symbol`. | | `marginMode` | No | `cross` (default) or `isolated`. | | `subaccountId` | No | Perps sub-account index (0–4, default 0). | ## Response Returns `symbol`, `cancelAll`, `orderId`, `clientOrderId`, `expiresAt`, `signer`, `message` (base64 Borsh action bytes to sign) and `transaction`. Sign the decoded `message` bytes with your wallet (in Solana browser wallets, use [`wallet.signMessage`](/trading-api/signing#perps-order-and-cancel-quotes) instead of `signTransaction`) and submit to [`POST /v1/perps/orders/cancel`](/trading-api/reference/post-perps-cancel). --- ## Submit a Perps cancel URL: https://docs.gum.ag/trading-api/reference/post-perps-cancel Markdown: https://docs.gum.ag/trading-api/reference/post-perps-cancel.md Description: Submit a signed GUM Perps order cancellation. ## Body | Field | Required | Description | | --- | --- | --- | | `transaction` | Yes | The quote's `transaction`, unchanged. | | `signature` | Yes | Your wallet's signature of the quote's `message`. | | `dryRun` | No | Set `true` to verify the signature without cancelling. | ## Response Returns `200` with `type: "perps_cancel"`, `status: "accepted"`, `final: false` and `symbol`. This acknowledges cancellation submission to the matching engine; confirm open orders via [`GET /v1/perps/accounts/{address}`](/trading-api/reference/get-perps-account). --- ## Glossary URL: https://docs.gum.ag/glossary Markdown: https://docs.gum.ag/glossary.md Description: Short definitions of the terms used across the GUM docs, each linked to the page that explains it. ## B ### Basis point (bps) One hundredth of a percent (0.01%). Fees are often quoted in basis points. See [Fees](/fees). ## C ### Cross margin The default margin mode: all positions in a perps [sub-account](#sub-account) share one pool of collateral, so a large loss can put all of them at risk of [liquidation](#liquidation). See [Margin and leverage](/perps/margin-and-leverage). ## D ### Dollar token The stablecoin a chain settles in on GUM. See [Supported chains](/how-gum-works#supported-chains) for the current token on each chain. ## F ### Funding Hourly payments between longs and shorts in a [perp](#perp-perpetual-futures) market, based on the gap between its order book price and the [oracle price](#oracle-price). When the rate is positive, longs pay shorts; when it's negative, shorts pay longs. See [Funding](/perps/funding). ## G ### GUM Network The chain GUM runs on. Your [Universal Account](#universal-account) and balances live there, and so does the GUM Perps order book. See [How GUM works](/how-gum-works#gum-runtime). ## H ### Home chain The chain a token was issued on. GUM carries out each trade on the token's home chain. See [Trade tokens](/trade/tokens). ## I ### Isolated margin A margin mode in which a position has its own collateral, separate from the rest of its [sub-account](#sub-account). Liquidating it doesn't touch your other positions. See [Margin and leverage](/perps/margin-and-leverage). ## L ### Leverage Opening a position larger than the collateral behind it. Higher leverage moves your liquidation price closer to the current price, and each market sets its own maximum. See [Margin and leverage](/perps/margin-and-leverage). ### Liquidation What happens when a perps account's value falls below its [maintenance margin](#margin) plus a buffer for the fees to close its positions: GUM Perps closes positions and charges a liquidation fee. See [Liquidation](/perps/liquidation). ## M ### Maker and taker A maker order rests on the order book until someone fills it; a taker order fills straight away. Each pays a different fee. See [Orders](/perps/orders) and [Fees](/fees). ### Margin The collateral behind a perps position. Initial margin is what you need to open a position; maintenance margin is the minimum you need to keep it open. See [Margin and leverage](/perps/margin-and-leverage). ### Mark price The price GUM Perps uses to value positions, check margin and trigger [liquidation](#liquidation): an [oracle price](#oracle-price) of the underlying asset, not the order book's last traded price. See [Perps overview](/perps/overview). ### Meta-aggregation How GUM prices a trade: it compares quotes from several aggregators (services that search a chain's trading venues for the best price) and uses the best one. See [Trade tokens](/trade/tokens). ## O ### OpenIDZK GUM's private social login, used when you sign in with Google or X. Your email and social account ID never go on-chain, and GUM doesn't store them. See [Private social login](/accounts/openidzk). ### Oracle price An asset price brought on-chain by an oracle, a service that publishes outside market prices to a blockchain. See [Perps overview](/perps/overview). ## P ### Passkey A sign-in key stored on your device or in your password manager, unlocked with your fingerprint, face or screen lock. Each passkey opens its own [Universal Account](#universal-account). See [Universal Accounts](/accounts/universal-accounts). ### Perp (perpetual futures) A contract that tracks an asset's price and has no expiry date. You go long to profit if the price rises or short to profit if it falls. See [Perps overview](/perps/overview). ## S ### Session A temporary key created when you sign in, so you don't have to approve every action; it lasts about two weeks. **It can do anything your account can, and it can't be revoked, so sign in only on devices you trust.** See [Approvals and sessions](/accounts/universal-accounts#approvals-and-sessions). ### Slippage The difference between the price you're quoted and the price your trade actually gets. Slippage is fixed at 1% (2% on Ethereum and Robinhood Chain) and may change: every trade carries a minimum output that you sign and the chain enforces. See [Trade tokens](/trade/tokens). ### Stock token A token that tracks the price of a stock or an ETF. The stocks in the GUM app are tokenized stocks issued on Solana by third parties, with no redemption through GUM. See [Stocks](/trade/stocks). ### Sub-account A separate perps account under your Universal Account, with its own collateral and positions. You can have up to 5. Deposits and transfers have no account-value cap. See [Perps accounts](/perps/accounts). ## U ### Universal Account Your GUM account, opened by signing in with Google, X, a passkey, or a Solana or Ethereum wallet, with no new seed phrase. Each sign-in method creates its own account. See [Universal Accounts](/accounts/universal-accounts). ### Universal Deposit (for integrators) A separate product, with its own fee, for apps that accept deposits from any supported chain. You don't need it to fund your GUM account; depositing into GUM is free. See [Universal Deposit](/universal-deposit/overview). ### USD balance Your dollar balance in the GUM app. See [Deposit](/funds/deposit) for how assets are credited and [Withdraw](/funds/withdraw) for where USD can be sent.