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
        Order LifecycleHistory & Volume
      Prediction Markets
      Account Services
      Clearing & Instant
      PerpetualsMarginWebSocket
    Deep Dives
Trading

TypeScript SDK — Trading: History & Volume

Methods for querying active orders, historical orders, past trades, and trading-volume statistics. All methods are on client.trading.

Every method in this namespace is a POST mutation — the SDK will not automatically retry on failure.

See the API Specifications for full request/response schemas.

listActiveOrders

POST /v1/orders · Authenticated

Retrieve all currently active (live) orders on the account.

Code
const orders = await client.trading.listActiveOrders({}); for (const order of orders) { console.log(order.order_id, order.symbol, order.side, order.price); }

Tip: For real-time order updates without polling, subscribe to client.websocket.orders() instead. See the WebSocket Reference.

listPastOrders

POST /v1/orders/history · Authenticated

Retrieve historical orders. You can filter by timestamp to paginate through results.

Code
const orders = await client.trading.listPastOrders({ symbol: "BTCUSD", timestamp: 1625000000000n, // only orders after this time limit_trades: 50, }); for (const order of orders) { console.log(order.order_id, order.type, order.executed_amount); }

Caveat: The timestamp field is a millisecond epoch value and may be bigint. The SDK accepts both bigint and number for int64 input fields.

listPastTrades

POST /v1/mytrades · Authenticated

Retrieve your executed trades (fills). Each entry represents one side of a matched trade.

Code
const trades = await client.trading.listPastTrades({ symbol: "BTCUSD", timestamp: 1625000000000n, limit_trades: 100, }); for (const trade of trades) { console.log(trade.tid); // trade ID (bigint) console.log(trade.price); // execution price (decimal string) console.log(trade.amount); // fill amount (decimal string) console.log(trade.fee_amount); // fee charged (decimal string) console.log(trade.fee_currency); // fee currency }

Caveat: The tid (trade ID) field in the response is a bigint. The timestamp input accepts both bigint and number.

Tip: Prices, amounts, and fees are decimal strings. See Data Types.

getTradingVolume

POST /v1/tradevolume · Authenticated

Retrieve your 30-day trading volume, broken down by fee tier and trading pair.

Code
const volume = await client.trading.getTradingVolume({}); for (const entry of volume) { console.log(entry.symbol); // e.g. "btcusd" console.log(entry.base_currency); // e.g. "BTC" console.log(entry.total_volume_base); // total volume in base currency (decimal string) console.log(entry.buy_maker_notional); // buy maker notional volume (decimal string) console.log(entry.sell_maker_notional);// sell maker notional volume (decimal string) console.log(entry.buy_maker_count); // number of buy maker trades }

Tip: Volume values are decimal strings. Count values (buy_maker_count, etc.) are numbers.

getNotionalTradingVolume

POST /v1/notionalvolume · Authenticated

Retrieve your 30-day notional trading volume in USD. This is used to determine your fee tier.

Code
const result = await client.trading.getNotionalTradingVolume({}); console.log(result.notional_30d_volume); // 30-day USD volume (decimal string) console.log(result.api_maker_fee_bps); // current maker fee in basis points (number) console.log(result.api_taker_fee_bps); // current taker fee in basis points (number)

Tip: The notional_30d_volume field is a decimal string, while api_maker_fee_bps and api_taker_fee_bps are numbers (basis points).

What's next

  • Trading: Order Lifecycle — place, cancel, and inspect orders
  • WebSocket Reference — real-time order and trade streams
  • Patterns — pagination and common workflows
  • Data Types — decimal strings and bigint handling
Last modified on August 14, 2026
Order LifecycleEvents & Discovery
On this page
  • What's next
TypeScript
TypeScript
TypeScript
TypeScript
TypeScript