List Clearing Trades
POSThttps://api.gemini.com/v1/clearing/trades
Retrieve settled and in-flight clearing trades for the account.
curl --request POST \
--url https://api.gemini.com/v1/clearing/trades \
--header 'Content-Type: application/json' \
--header 'X-GEMINI-APIKEY: <string>' \
--header 'X-GEMINI-PAYLOAD: <string>' \
--header 'X-GEMINI-SIGNATURE: <string>' \
--data '
{
"request": "/v1/clearing/trades",
"nonce": "<nonce>",
"timestamp_nanos": 1630382206000000000,
"limit_per_account": 50
}
'
Roles
The API key you use to access this endpoint must have the Trader role assigned. See Roles for more information.
The OAuth scope must have clearing:read assigned to access this endpoint. See OAuth Scopes for more information.
Headers
X-GEMINI-APIKEYstring·required
Your API keyX-GEMINI-SIGNATUREstring·required
HEX-encoded HMAC-SHA384 of payload signed with API secretX-GEMINI-PAYLOADstring·required
Base64-encoded JSON payloadContent-Typestring
Default: text/plainContent-Lengthstring
Default: 0Cache-Controlstring
Default: no-cacheRequest Body
requeststring·required
The literal string "/v1/clearing/trades"nonceTimestampType | integer·required
timestampExample: 1495127793000timestamp_nanosinteger
Only return transfers on or after this timestamp in nanoslimit_per_accountinteger
The maximum number of clearing trades to return. The default is 100 and the maximum is 300.accountstring
Only required when using a master api-key. The name of the account within the subaccount group.symbolstring
The trading pairtimestampstring | integer
Gemini strongly recommends using milliseconds instead of seconds for timestamps.Timestamp format
Example
Supported request type
string (seconds)
1495127793
POST only
string (milliseconds)
1495127793000
POST only
whole number (seconds)
1495127793
GET, POST
whole number (milliseconds)
1495127793000
GET, POST
Example: 1495127793000limit_tradesinteger
The maximum number of trades to return{
"request": "/v1/clearing/trades",
"nonce": "<nonce>"
}
Responses
Successful operation
results[].sourceAccountstring
A account that corresponds with the counterparty sourcing the clearing traderesults[].targetAccountstring
A account that corresponds with the counterparty where the clearing trade is targetedresults[].pairstring
The trading pair of the clearing traderesults[].sourceSidestring·enum
"buy" or "sell"Enum values: buysellresults[].pricestring
The price the clearing order was executed atresults[].quantitystring
The amount that was executedresults[].clearingIdstring
The clearing IDresults[].statusstring
A description of the status of the orderresults[].expirationTimeMsstring | integer
Gemini strongly recommends using milliseconds instead of seconds for timestamps.Timestamp format
Example
Supported request type
string (seconds)
1495127793
POST only
string (milliseconds)
1495127793000
POST only
whole number (seconds)
1495127793
GET, POST
whole number (milliseconds)
1495127793000
GET, POST
Example: 1495127793000results[].createdMsstring | integer
Gemini strongly recommends using milliseconds instead of seconds for timestamps.Timestamp format
Example
Supported request type
string (seconds)
1495127793
POST only
string (milliseconds)
1495127793000
POST only
whole number (seconds)
1495127793
GET, POST
whole number (milliseconds)
1495127793000
GET, POST
Example: 1495127793000results[].lastUpdatedMsstring | integer
Gemini strongly recommends using milliseconds instead of seconds for timestamps.Timestamp format
Example
Supported request type
string (seconds)
1495127793
POST only
string (milliseconds)
1495127793000
POST only
whole number (seconds)
1495127793
GET, POST
whole number (milliseconds)
1495127793000
GET, POST
Example: 1495127793000results[].hasBrokerboolean
Broker traderesults[].wasNotifiedboolean
Broker was notified{
"results": [
{
"sourceAccount": "primary",
"targetAccount": "primary",
"pair": "BTCUSD",
"sourceSide": "buy",
"price": "1",
"quantity": "1000",
"clearingId": "41M23L5Q",
"status": "Settled",
"expirationTimeMs": 1662567706120,
"createdMs": 1662481306139,
"lastUpdatedMs": 1662481561668,
"hasBroker": false,
"wasNotified": false
},
{
"sourceAccount": "primary",
"targetAccount": "primary",
"pair": "BTCUSD",
"sourceSide": "buy",
"price": "12",
"quantity": "1000",
"clearingId": "0EMOYLJ5",
"status": "AwaitTargetConfirm",
"expirationTimeMs": 1662567728123,
"createdMs": 1662481328126,
"lastUpdatedMs": 1662481561415,
"hasBroker": false,
"wasNotified": true
}
]
}