Get Account 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.
Headers
X-GEMINI-APIKEYstring · requiredYour API key
X-GEMINI-SIGNATUREstring · requiredHEX-encoded HMAC-SHA384 of payload signed with API secret
X-GEMINI-PAYLOADstring · requiredBase64-encoded JSON payload
Content-TypestringDefault: text/plainContent-LengthstringDefault: 0Cache-ControlstringDefault: no-cache
Request Body
requeststring · requiredThe API endpoint path
Example: /v1/marginnonceTimestampType · requiredtimestamp
symbolstring · requiredTrading pair symbol. See symbols and minimums
accountstringRequired 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
Responses
JSON object
margin_assets_valuestring · decimalThe $ equivalent value of all the assets available in the current trading account that can contribute to funding a derivatives position.
initial_marginstring · decimalThe $ amount that is being required by the accounts current positions and open orders.
available_marginstring · decimalThe difference between the
margin_assets_valueandinitial_margin.margin_maintenance_limitstring · decimalThe minimum amount of
margin_assets_valuerequired before the account is moved to liquidation status.leveragestring · decimalThe ratio of Notional Value to Margin Assets Value.
notional_valuestring · decimalThe $ value of the current position.
estimated_liquidation_pricestring · decimalThe estimated price for the asset at which liquidation would occur.
initial_margin_positionsstring · decimalThe contribution to
initial_marginfrom open positions.reserved_marginstring · decimalThe contribution to
initial_marginfrom open orders.reserved_margin_buysstring · decimalThe contribution to
initial_marginfrom open BUY orders.reserved_margin_sellsstring · decimalThe contribution to
initial_marginfrom open SELL orders.buying_powerstring · decimalThe amount of that product the account could purchase based on current
initial_marginandmargin_assets_value.selling_powerstring · decimalThe amount of that product the account could sell based on current
initial_marginandmargin_assets_value.
List Funding Payments
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.
query Parameters
sinceIf specified, only return funding payments after this point. Default value is 24h in past. See Timestamps for more information
timestamp
toIf specified, only returns funding payment until this point. Default value is now. See Timestamps for more information
timestamp
Headers
X-GEMINI-APIKEYstring · requiredYour API key
X-GEMINI-SIGNATUREstring · requiredHEX-encoded HMAC-SHA384 of payload signed with API secret
X-GEMINI-PAYLOADstring · requiredBase64-encoded JSON payload
Content-TypestringDefault: text/plainContent-LengthstringDefault: 0Cache-ControlstringDefault: no-cache
Request Body
requeststring · requiredThe API endpoint path
Example: /v1/perpetuals/fundingPaymentnonceTimestampType · requiredtimestamp
accountstringRequired 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
Responses
The response will be an array of funding payment objects.
eventTypestring · enum · requiredEvent type
Enum values:Hourly Funding TransferhourlyFundingTransferobject · required
Get Funding Payment Report File
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
query Parameters
fromDatestring · dateIf empty, will only fetch records by numRows value.
toDatestring · dateIf empty, will only fetch records by numRows value.
numRowsintegerIf empty, default value '8760'
Headers
X-GEMINI-APIKEYstring · requiredYour API key
X-GEMINI-SIGNATUREstring · requiredHEX-encoded HMAC-SHA384 of payload signed with API secret
X-GEMINI-PAYLOADstring · requiredBase64-encoded JSON payload
Content-TypestringDefault: text/plainContent-LengthstringDefault: 0Cache-ControlstringDefault: no-cache
Request Body
requeststring · requiredThe API endpoint path
Example: /v1/perpetuals/fundingpaymentreport/records.xlsxnonceTimestampType · requiredtimestamp
accountstringRequired 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
Responses
XLSX file downloaded containing funding payment report.
Get Funding Payment Report 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
query Parameters
fromDatestring · dateIf empty, will only fetch records by numRows value.
toDatestring · dateIf empty, will only fetch records by numRows value.
numRowsintegerIf empty, default value '8760'
Headers
X-GEMINI-APIKEYstring · requiredYour API key
X-GEMINI-SIGNATUREstring · requiredHEX-encoded HMAC-SHA384 of payload signed with API secret
X-GEMINI-PAYLOADstring · requiredBase64-encoded JSON payload
Content-TypestringDefault: text/plainContent-LengthstringDefault: 0Cache-ControlstringDefault: no-cache
Request Body
requeststring · requiredThe API endpoint path
Example: /v1/perpetuals/fundingpaymentreport/records.json?fromDate=2024-04-10&toDate=2024-04-25&numRows=1000nonceTimestampType · requiredtimestamp
accountstringRequired 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
Responses
JSON response containing funding payment report.
eventTypestring · enum · requiredEvent type
Enum values:Hourly Funding TransfertimestamprequiredTime of the funding payment
assetCodestring · requiredAsset symbol
actionstring · enum · requiredCredit or Debit
Enum values:CreditDebitquantityobject · requiredA nested JSON object describing the transaction amount
instrumentSymbolstringSymbol of the underlying instrument. Note that this is only attached to requests from 16th April 2024 onwards.
Get Open 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.
Headers
X-GEMINI-APIKEYstring · requiredYour API key
X-GEMINI-SIGNATUREstring · requiredHEX-encoded HMAC-SHA384 of payload signed with API secret
X-GEMINI-PAYLOADstring · requiredBase64-encoded JSON payload
Content-TypestringDefault: text/plainContent-LengthstringDefault: 0Cache-ControlstringDefault: no-cache
Request Body
requeststring · requiredThe literal string "/v1/positions"
accountstringRequired 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.
Responses
Successful operation
openPositionsobject[]
Get Risk Stats
path Parameters
symbolstring · requiredPerps Trading pair symbol
BTCGUSDPERP, etc. See symbols and minimums.
Responses
The response will be an json object
product_typestring · enumContract type for which the symbol data is fetched
Enum values:PerpetualSwapContractmark_pricestring · decimalCurrent mark price at the time of request
index_pricestring · decimalCurrent index price at the time of request
open_intereststring · decimalstring representation of decimal value of open interest
open_interest_notionalstring · decimalstring representation of decimal value of open interest notional

