GeminiGemini
SandboxGet API key
  • Crypto Trading
  • Prediction Markets
  • SDKs & Tools
Changelog
Gemini Crypto Exchange LogoGemini Crypto Exchange Logo

© 2026 Gemini Space Station, Inc.

Overview
TypeScript SDK
    QuickstartAuthenticationWebSocketError HandlingPatterns & Recipes
    API Reference
      Overview
      Market Data
      Trading
      Prediction Markets
      Account Services
      Clearing & Instant
        Clearing OrdersInstant Orders
      PerpetualsMarginWebSocket
    Deep Dives
Clearing & Instant

TypeScript SDK — Clearing: Instant Orders

Get instant quotes and execute instant trades. All methods are on client.clearingInstant.

See the API specifications for full request/response schemas and the authentication guide for setup.

Methods

getInstantQuote

POST /v1/instant/quote · Authenticated

Requests a price quote for an instant trade. The request uses totalSpend to specify the trade size. For buy orders, totalSpend is the fiat amount you want to spend (e.g. USD). For sell orders, totalSpend is the CCY1 quantity you want to sell (e.g. BTC amount), not a dollar amount.

Code
const quote = await client.clearingInstant.getInstantQuote({ symbol: "BTCUSD", side: "buy", totalSpend: "100.00", }); console.log(`Quote: ${quote.price} per BTC, fee: ${quote.fee}`); console.log(`Quantity: ${quote.quantity} ${quote.quantityCurrency}`); console.log(`Total spend: ${quote.totalSpend} ${quote.totalSpendCurrency}`); console.log(`Quote ID: ${quote.quoteId}`); // number — pass this to executeInstantOrder

Tip: Quotes are time-limited (maxAgeMs tells you how long). Execute promptly or request a fresh quote. quoteId is a number (not bigint or string). Prices, quantities, and fees are decimal strings.

This is a POST mutation — never automatically retried.

executeInstantOrder

POST /v1/instant/execute · Authenticated

Executes an instant trade using a previously obtained quote. The request body is validated client-side. The SDK enforces:

  • symbol — required string
  • quantity — required string
  • price — required string
  • fee — required string
  • side — required enum: "buy" or "sell"
  • quoteId — required number
Code
const result = await client.clearingInstant.executeInstantOrder({ symbol: "BTCUSD", side: "buy", quantity: quote.quantity!, price: quote.price!, fee: quote.fee!, quoteId: quote.quoteId!, }); // orderId is optional in the response if (result.orderId != null) { console.log(`Order ID: ${result.orderId}`); } console.log(`Executed: ${result.quantity} ${result.quantityCurrency} @ ${result.price}`);

Caveat: This is a POST mutation — never automatically retried. The quoteId must reference a valid, unexpired quote from getInstantQuote. All string fields (quantity, price, fee) must match the quote response values exactly. The quoteId in the request is a number.

Typical instant trade flow

  1. Request a quote with getInstantQuote using totalSpend
  2. Display the quote to the user (price, quantity, fees)
  3. Execute with executeInstantOrder, passing the quoteId and the exact price, quantity, and fee from the quote
Code
// 1. Get a quote — specify how much to spend const quote = await client.clearingInstant.getInstantQuote({ symbol: "ETHUSD", side: "buy", totalSpend: "500.00", }); // 2. Execute the quote — pass exact values from the quote response const execution = await client.clearingInstant.executeInstantOrder({ symbol: "ETHUSD", side: "buy", quantity: quote.quantity!, price: quote.price!, fee: quote.fee!, quoteId: quote.quoteId!, });

What's next

  • Clearing Orders — standard OTC clearing order management
  • Request Validation — how client-side validation works
  • Data Types — decimal strings and bigint fields
Last modified on August 14, 2026
Clearing OrdersPerpetuals
On this page
  • Methods
    • getInstantQuote
    • executeInstantOrder
  • Typical instant trade flow
  • What's next
TypeScript
TypeScript
TypeScript