Gemini Crypto Exchange Logo
REST API

Derivatives (1.0.0)

Endpoint

Get Account Margin

POST
https://api.gemini.com
/v1/margin

Roles

The API key you use to access this endpoint must have the Trader or Auditor role assigned. See Roles for more information.

The OAuth scope must have orders:read assigned to access this endpoint. See OAuth Scopes for more information.

Get Account MarginHeaders

  • X-GEMINI-APIKEYstring · required

    Your API key

  • X-GEMINI-SIGNATUREstring · required

    HEX-encoded HMAC-SHA384 of payload signed with API secret

  • X-GEMINI-PAYLOADstring · required

    Base64-encoded JSON payload

  • Content-Typestring
    Default: text/plain
  • Content-Lengthstring
    Default: 0
  • Cache-Controlstring
    Default: no-cache

Get Account Margin Request Body

  • requeststring · required

    The API endpoint path

    Example: /v1/margin
  • nonceTimestampType · required

    timestamp

  • symbolstring · required

    Trading pair symbol. See symbols and minimums

  • accountstring

    Required for Master API keys as described in Private API Invocation. The name of the account within the subaccount group. Specifies the account on which you intend to place the order. Only available for exchange accounts.

    Example: primary

Get Account Margin Responses

JSON object

  • margin_assets_valuestring · decimal

    The $ equivalent value of all the assets available in the current trading account that can contribute to funding a derivatives position.

  • initial_marginstring · decimal

    The $ amount that is being required by the accounts current positions and open orders.

  • available_marginstring · decimal

    The difference between the margin_assets_value and initial_margin.

  • margin_maintenance_limitstring · decimal

    The minimum amount of margin_assets_value required before the account is moved to liquidation status.

  • leveragestring · decimal

    The ratio of Notional Value to Margin Assets Value.

  • notional_valuestring · decimal

    The $ value of the current position.

  • estimated_liquidation_pricestring · decimal

    The estimated price for the asset at which liquidation would occur.

  • initial_margin_positionsstring · decimal

    The contribution to initial_margin from open positions.

  • reserved_marginstring · decimal

    The contribution to initial_margin from open orders.

  • reserved_margin_buysstring · decimal

    The contribution to initial_margin from open BUY orders.

  • reserved_margin_sellsstring · decimal

    The contribution to initial_margin from open SELL orders.

  • buying_powerstring · decimal

    The amount of that product the account could purchase based on current initial_margin and margin_assets_value.

  • selling_powerstring · decimal

    The amount of that product the account could sell based on current initial_margin and margin_assets_value.


List Funding Payments

POST
https://api.gemini.com
/v1/perpetuals/fundingPayment

Roles

The API key you use to access this endpoint must have the Trader or Auditor role assigned. See Roles for more information.

The OAuth scope must have orders:read assigned to access this endpoint. See OAuth Scopes for more information.

List Funding Paymentsquery Parameters

  • since

    If specified, only return funding payments after this point. Default value is 24h in past. See Timestamps for more information

    timestamp

  • to

    If specified, only returns funding payment until this point. Default value is now. See Timestamps for more information

    timestamp

List Funding PaymentsHeaders

  • X-GEMINI-APIKEYstring · required

    Your API key

  • X-GEMINI-SIGNATUREstring · required

    HEX-encoded HMAC-SHA384 of payload signed with API secret

  • X-GEMINI-PAYLOADstring · required

    Base64-encoded JSON payload

  • Content-Typestring
    Default: text/plain
  • Content-Lengthstring
    Default: 0
  • Cache-Controlstring
    Default: no-cache

List Funding Payments Request Body

  • requeststring · required

    The API endpoint path

    Example: /v1/perpetuals/fundingPayment
  • nonceTimestampType · required

    timestamp

  • accountstring

    Required for Master API keys as described in Private API Invocation. The name of the account within the subaccount group. Specifies the account on which you intend to place the order. Only available for exchange accounts.

    Example: primary

List Funding Payments Responses

The response will be an array of funding payment objects.

  • eventTypestring · enum · required

    Event type

    Enum values:
    Hourly Funding Transfer
  • hourlyFundingTransferobject · required

Get Funding Payment Report File

GET
https://api.gemini.com
/v1/perpetuals/fundingpaymentreport/records.xlsx

Roles

The API key you use to access this endpoint must have the Trader or Auditor role assigned. See Roles for more information.

The OAuth scope must have orders:read assigned to access this endpoint. See OAuth Scopes for more information.

Examples

  • &fromDate=2024-04-10&toDate=2024-04-25&numRows=1000
    Compare and obtain the minimum records between (2024-04-10 to 2024-04-25) and 1000. If (2024-04-10 to 2024-04-25) contains 360 records. Then fetch the minimum between 360 and 1000 records only.

  • &numRows=2024-04-10&toDate=2024-04-25
    If (2024-04-10 to 2024-04-25) contains 360 records. Then fetch 360 records only.

  • &numRows=1000
    Fetch maximum 1000 records starting from Now to a historical date

  • <blank>
    Fetch maximum 8760 records starting from Now to a historical date

Get Funding Payment Report Filequery Parameters

  • fromDatestring · date

    If empty, will only fetch records by numRows value.

  • toDatestring · date

    If empty, will only fetch records by numRows value.

  • numRowsinteger

    If empty, default value '8760'

Get Funding Payment Report FileHeaders

  • X-GEMINI-APIKEYstring · required

    Your API key

  • X-GEMINI-SIGNATUREstring · required

    HEX-encoded HMAC-SHA384 of payload signed with API secret

  • X-GEMINI-PAYLOADstring · required

    Base64-encoded JSON payload

  • Content-Typestring
    Default: text/plain
  • Content-Lengthstring
    Default: 0
  • Cache-Controlstring
    Default: no-cache

Get Funding Payment Report File Request Body

  • requeststring · required

    The API endpoint path

    Example: /v1/perpetuals/fundingpaymentreport/records.xlsx
  • nonceTimestampType · required

    timestamp

  • accountstring

    Required for Master API keys as described in Private API Invocation. The name of the account within the subaccount group. Specifies the account on which you intend to place the order. Only available for exchange accounts.

    Example: primary

Get Funding Payment Report File Responses

XLSX file downloaded containing funding payment report.

string

Get Funding Payment Report JSON

POST
https://api.gemini.com
/v1/perpetuals/fundingpaymentreport/records.json

This endpoint retrieves funding payment report in JSON format.

Examples

  • &fromDate=2024-04-10&toDate=2024-04-25&numRows=1000
    Compare and obtain the minimum records between (2024-04-10 to 2024-04-25) and 1000. If (2024-04-10 to 2024-04-25) contains 360 records. Then fetch the minimum between 360 and 1000 records only.

  • &numRows=2024-04-10&toDate=2024-04-25
    If (2024-04-10 to 2024-04-25) contains 360 records. Then fetch 360 records only.

  • &numRows=1000
    Fetch maximum 1000 records starting from Now to a historical date

  • <blank>
    Fetch maximum 8760 records starting from Now to a historical date

Get Funding Payment Report JSONquery Parameters

  • fromDatestring · date

    If empty, will only fetch records by numRows value.

  • toDatestring · date

    If empty, will only fetch records by numRows value.

  • numRowsinteger

    If empty, default value '8760'

Get Funding Payment Report JSONHeaders

  • X-GEMINI-APIKEYstring · required

    Your API key

  • X-GEMINI-SIGNATUREstring · required

    HEX-encoded HMAC-SHA384 of payload signed with API secret

  • X-GEMINI-PAYLOADstring · required

    Base64-encoded JSON payload

  • Content-Typestring
    Default: text/plain
  • Content-Lengthstring
    Default: 0
  • Cache-Controlstring
    Default: no-cache

Get Funding Payment Report JSON Request Body

  • requeststring · required

    The API endpoint path

    Example: /v1/perpetuals/fundingpaymentreport/records.json?fromDate=2024-04-10&toDate=2024-04-25&numRows=1000
  • nonceTimestampType · required

    timestamp

  • accountstring

    Required for Master API keys as described in Private API Invocation. The name of the account within the subaccount group. Specifies the account on which you intend to place the order. Only available for exchange accounts.

    Example: primary

Get Funding Payment Report JSON Responses

JSON response containing funding payment report.

  • eventTypestring · enum · required

    Event type

    Enum values:
    Hourly Funding Transfer
  • timestamprequired

    Time of the funding payment

  • assetCodestring · required

    Asset symbol

  • actionstring · enum · required

    Credit or Debit

    Enum values:
    Credit
    Debit
  • quantityobject · required

    A nested JSON object describing the transaction amount

  • instrumentSymbolstring

    Symbol of the underlying instrument. Note that this is only attached to requests from 16th April 2024 onwards.


Get Open Positions

POST
https://api.gemini.com
/v1/positions

Roles

The API key you use to access this endpoint must have the Trader or Auditor role assigned. See Roles for more information.

The OAuth scope must have orders:read assigned to access this endpoint. See OAuth Scopes for more information.

Get Open PositionsHeaders

  • X-GEMINI-APIKEYstring · required

    Your API key

  • X-GEMINI-SIGNATUREstring · required

    HEX-encoded HMAC-SHA384 of payload signed with API secret

  • X-GEMINI-PAYLOADstring · required

    Base64-encoded JSON payload

  • Content-Typestring
    Default: text/plain
  • Content-Lengthstring
    Default: 0
  • Cache-Controlstring
    Default: no-cache

Get Open Positions Request Body

  • requeststring · required

    The literal string "/v1/positions"

  • noncerequired

    The nonce, as described in Private API Invocation

  • accountstring

    Required for Master API keys as described in Private API Invocation. The name of the account within the subaccount group. Specifies the account on which the orders were placed. Only available for exchange accounts.

Get Open Positions Responses

Successful operation

  • openPositionsobject[]

Get Risk Stats

GET
https://api.gemini.com
/v1/riskstats/{symbol}

Get Risk Statspath Parameters

Get Risk Stats Responses

The response will be an json object

  • product_typestring · enum

    Contract type for which the symbol data is fetched

    Enum values:
    PerpetualSwapContract
  • mark_pricestring · decimal

    Current mark price at the time of request

  • index_pricestring · decimal

    Current index price at the time of request

  • open_intereststring · decimal

    string representation of decimal value of open interest

  • open_interest_notionalstring · decimal

    string representation of decimal value of open interest notional