Skip to main content

Get Transaction Log

Query transaction logs in the derivatives wallet (classic account), and inverse derivatives account (upgraded to UTA)

Permission: "Contract - Position"
Apply to: classic account, UTA1.0(inverse)

HTTP Request

GET /v5/account/contract-transaction-log

Request Parameters

ParameterRequiredTypeComments
currencyfalsestringCurrency, uppercase only
baseCoinfalsestringBaseCoin, uppercase only. e.g., BTC of BTCPERP
typefalsestringTypes of transaction logs
startTimefalseintegerThe start timestamp (ms)
  • startTime and endTime are not passed, return 7 days by default
  • Only startTime is passed, return range between startTime and startTime+7 days
  • Only endTime is passed, return range between endTime-7 days and endTime
  • If both are passed, the rule is endTime - startTime <= 7 days
endTimefalseintegerThe end timestamp (ms)
limitfalseintegerLimit for data size per page. [1, 50]. Default: 20
cursorfalsestringCursor. Use the nextPageCursor token from the response to retrieve the next page of the result set

Response Parameters

ParameterTypeComments
listarrayObject
> idstringUnique id
> symbolstringSymbol name
> categorystringProduct type
> sidestringSide. Buy,Sell,None
> transactionTimestringTransaction timestamp (ms)
> typestringType
> qtystringQuantity
  • Perps & Futures: it is the quantity for each trade entry and it does not have direction
> sizestringSize. The rest position size after the trade is executed, and it has direction, i.e., short with "-"
> currencystringcurrency
> tradePricestringTrade price
> fundingstringFunding fee
  • Positive value means deducting funding fee
  • Negative value means receiving funding fee
> feestringTrading fee
  • Positive fee value means expense
  • Negative fee value means rebates
> cashFlowstringCash flow, e.g., (1) close the position, and unRPL converts to RPL, (2) transfer in or transfer out. This does not include trading fee, funding fee
> changestringChange = cashFlow - funding - fee
> cashBalancestringCash balance. This is the wallet balance after a cash change
> feeRatestring
  • When type=TRADE, then it is trading fee rate
  • When type=SETTLEMENT, it means funding fee rate. For side=Buy, feeRate=market fee rate; For side=Sell, feeRate= - market fee rate
> bonusChangestringThe change of bonus
> tradeIdstringTrade ID
> orderIdstringOrder ID
> orderLinkIdstringUser customised order ID
nextPageCursorstringRefer to the cursor request parameter

Request Example

GET /v5/account/contract-transaction-log?limit=1&symbol=BTCUSD HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1714035117255
X-BAPI-RECV-WINDOW: 5000

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": {
"list": [
{
"id": "467153",
"symbol": "BTCUSD",
"category": "inverse",
"side": "Sell",
"transactionTime": "1714032000000",
"type": "SETTLEMENT",
"qty": "1000",
"size": "-1000",
"currency": "BTC",
"tradePrice": "63974.88",
"funding": "-0.00000156",
"fee": "",
"cashFlow": "0.00000000",
"change": "0.00000156",
"cashBalance": "1.1311",
"feeRate": "-0.00010000",
"bonusChange": "",
"tradeId": "423a565c-f1b6-4c81-bc62-760cd7dd89e7",
"orderId": "",
"orderLinkId": ""
}
],
"nextPageCursor": "cursor_id%3D467153%26"
},
"retExtInfo": {},
"time": 1714035117258
}