Get Trades History
POST/private/TradesHistory
Retrieve information about trades/fills. 50 results are returned at a time, the most recent by default.
- Unless otherwise stated, costs, fees, prices, and volumes are specified with the precision for the asset pair (
pair_decimals
andlot_decimals
), not the individual assets' precision (decimals
).
API Key Permissions Required: Orders and trades - Query closed orders & trades
Request
- application/json
Body
required
Nonce used in construction of API-Sign
header
Possible values: [all
, any position
, closed position
, closing position
, no position
]
Default value: all
Type of trade
Whether or not to include trades related to position in output
Starting unix timestamp or trade tx ID of results (exclusive)
Ending unix timestamp or trade tx ID of results (inclusive)
Result offset for pagination
Default value: true
Whether or not to consolidate trades by individual taker trades
Whether or not to include related ledger ids for given trade
Note that setting this to true will slow request performance
Responses
- 200
Trade history retrieved.
- application/json
- Schema
- Example (from schema)
Schema
closing
— Trade closes all or part of a position
result object
Trade History
Amount of available trades matching criteria
trades object
Trade info
property name* Trade
Trade Info
Order responsible for execution of trade
Position responsible for execution of trade
Asset pair
Unix timestamp of trade
Type of order (buy/sell)
Order type
Average price order was executed at (quote currency)
Total cost of order (quote currency)
Total fee (quote currency)
Volume (base currency)
Initial margin (quote currency)
Amount of leverage used in trade
Comma delimited list of miscellaneous info:
List of ledger ids for entries associated with trade
Unique identifier of trade executed
true
if trade was executed with user as the maker, false
if taker
Position status (open/closed)
Only present if trade opened a position
Average price of closed portion of position (quote currency)
Only present if trade opened a position
Total cost of closed portion of position (quote currency)
Only present if trade opened a position
Total fee of closed portion of position (quote currency)
Only present if trade opened a position
Total fee of closed portion of position (quote currency)
Only present if trade opened a position
Total margin freed in closed portion of position (quote currency)
Only present if trade opened a position
Net profit/loss of closed portion of position (quote currency, quote currency scale)
Only present if trade opened a position
List of closing trades for position (if available)
Only present if trade opened a position
{
"error": [],
"result": {
"trades": {
"THVRQM-33VKH-UCI7BS": {
"ordertxid": "OQCLML-BW3P3-BUCMWZ",
"postxid": "TKH2SE-M7IF5-CFI7LT",
"pair": "XXBTZUSD",
"time": 1688667796.8802,
"type": "buy",
"ordertype": "limit",
"price": "30010.00000",
"cost": "600.20000",
"fee": "0.00000",
"vol": "0.02000000",
"margin": "0.00000",
"misc": "",
"trade_id": 40274859,
"maker": true
},
"TCWJEG-FL4SZ-3FKGH6": {
"ordertxid": "OQCLML-BW3P3-BUCMWZ",
"postxid": "TKH2SE-M7IF5-CFI7LT",
"pair": "XXBTZUSD",
"time": 1688667769.6396,
"type": "buy",
"ordertype": "limit",
"price": "30010.00000",
"cost": "300.10000",
"fee": "0.00000",
"vol": "0.01000000",
"margin": "0.00000",
"misc": "",
"trade_id": 39482674,
"maker": true
}
}
}
}