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
        Symbols & PricingBooks, Trades & CandlesNetworks & Derivatives
      Trading
      Prediction Markets
      Account Services
      Clearing & Instant
      PerpetualsMarginWebSocket
    Deep Dives
Market Data

TypeScript SDK — Market Data: Networks & Derivatives

Network and token discovery, FX rates, and perpetual funding data. All methods are on client.marketData. This group mixes public and authenticated endpoints — check the access level on each method. All are GET-backed and auto-retry on transient failures (429, 502, 503, 504).

getAssetsForNetwork

GET /v2/networks/{network}/assets · Authenticated

Returns the enabled assets (tokens) available for deposit and withdrawal on a specified blockchain network, filtered by your account's access permissions.

Code
const result = await client.marketData.getAssetsForNetwork({ network: "ethereum" }); console.log(result.assets); // ["ETH", "USDC", "USDT", ...]

The assets array is sorted alphabetically and contains only assets where your account has deposit and withdraw access enabled.

Tip: Your API key must have the Fund Manager or Auditor role. See Authentication for key setup.

Note: If the network is not supported or has no enabled assets, the API returns a 400 error.

getTokenNetworkV2

GET /v2/network/{token} · Authenticated

Returns the blockchain networks available for a given token, filtered by your account's deposit and withdraw permissions. Use this to discover which networks support a token before initiating a deposit or withdrawal.

Code
const result = await client.marketData.getTokenNetworkV2({ token: "USDC" }); console.log(result.network); // ["ethereum", "solana", "base", "arbitrum", "optimism", "avalanche"]

The network field is always an array and may contain one or more supported networks.

Tip: This is the recommended v2 replacement for the retired v1 network endpoint. Your API key must have the Fund Manager or Auditor role.

Note: If the token is not supported or your account has no available networks, the API returns a 404 with reason: "UnsupportedNetwork".

getFXRate

GET /v2/fxrate/{symbol}/{timestamp} · Authenticated

Returns the FX rate for a given symbol at a specific point in time. Useful for historical reporting and reconciliation.

Code
const rate = await client.marketData.getFXRate({ symbol: "AUDUSD", timestamp: 1594651859000, }); console.log(rate.fxPair); // "AUDUSD" console.log(rate.rate); // 0.69 (number) console.log(rate.asOf); // 1594651859000 console.log(rate.provider); // "bcb"

The timestamp parameter accepts seconds or milliseconds since the Unix epoch. Gemini strongly recommends using milliseconds. The SDK accepts both bigint and number for this field — see Data Types for details on bigint timestamp handling.

Tip: The rate field is a number (not a string). Use a decimal library if you need exact arithmetic with FX rates.

getFundingAmount

GET /v1/fundingamount/{symbol} · Public

Returns the current and estimated next funding amount for a perpetual symbol.

Code
const funding = await client.marketData.getFundingAmount({ symbol: "BTCGUSDPERP" }); console.log(funding.symbol); // "BTCGUSDPERP" console.log(funding.fundingDateTime); // "2025-04-22T18:00:00.000Z" console.log(funding.fundingTimestampMilliSecs); // 1745344800000 console.log(funding.nextFundingTimestamp); // 1745348400000 console.log(funding.amount); // -1.50991 console.log(funding.estimatedFundingAmount); // -2.10595

Tip: Use this alongside getRiskStats (in the Perpetuals namespace) for a complete view of perp market conditions.

getFundingAmountReportFile

GET /v1/fundingamountreport/records.xlsx · Public

Downloads a funding amount report as an Excel file. Unlike most SDK methods, this returns a file rather than a parsed JSON response.

Code
const report = await client.marketData.getFundingAmountReportFile({ symbol: "BTCGUSDPERP", fromDate: "2024-04-10", toDate: "2024-04-25", numRows: 1000, }); // report.bytes is a Uint8Array containing the .xlsx file // report.contentType is the MIME type (optional, e.g. "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") // report.contentDisposition is the Content-Disposition header value (optional) import { writeFile } from "node:fs/promises"; await writeFile("funding-report.xlsx", report.bytes);

Available query parameters:

ParameterTypeRequiredDescription
symbolstringYesPerpetual symbol (e.g. "BTCGUSDPERP").
fromDatestringNoStart date in YYYY-MM-DD format. Mandatory if toDate is set.
toDatestringNoEnd date in YYYY-MM-DD format. Mandatory if fromDate is set.
numRowsnumberNoMaximum rows to return. Defaults to 8760 if omitted.

When both a date range and numRows are specified, the API returns the minimum of the records in the date range and numRows.

Caveat: This method returns { bytes: Uint8Array, contentType?: string, contentDisposition?: string }, not a JSON object. The SDK does not parse the file contents — you receive the raw bytes.

Tip: Omitting both date fields fetches up to numRows records starting from the present and going backward.

What's next

  • Symbols & Pricing — symbol discovery, ticker data, and price feeds
  • Books, Trades & Candles — order book snapshots, trade history, and OHLCV data
  • Data Types — decimal strings, bigint timestamps, and safe arithmetic
  • Authentication — HMAC and OAuth setup for authenticated endpoints
  • Error Handling — how the SDK surfaces API errors
  • Full API Specifications — complete request/response schemas
Last modified on August 14, 2026
Books, Trades & CandlesOrder Lifecycle
On this page
  • What's next
TypeScript
TypeScript
TypeScript
TypeScript
TypeScript