资产接口
我的资产
GET /api/v1/perpetual/account/assets/{contractCode}
请求参数:
路径参数
| 参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
|---|---|---|---|---|---|
| contractCode | y | string | 合约code |
Query
| 参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
|---|---|---|---|---|---|
| AccessKeyId | y | string | 访问key | ||
| SignatureVersion | y | string | 版本 | ||
| SignatureMethod | y | string | 签名方法 | HmacSHA256 | |
| Signature | y | string | 签名 | ||
| Timestamp | y | string | 时间戳 |
Response
{
"nextRewardTimestamp": 86400000,
"accountRights": "211.73425366",
"realizedSurplus": "-1996.67028101",
"unRealizedSurplus": "0",
"orderMargin": "111.32734888",
"positionMargin": "55.30721388",
"env": 0,
"currencyCode": "usdt",
"currencyCodeDisplayName": "USDT",
"availableMargin": "45.09969088"
}
返回:
| 参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
|---|---|---|---|---|---|
| currencyCode | y | string | 币种 | ||
| currencyCodeDisplayName | y | string | 币种显示名称 | ||
| env | y | int | 是否测试币 0:线上币,1:测试币 | ||
| availableMargin | y | string | 可用保证金 | ||
| realizedSurplus | y | string | 已实现盈亏 | ||
| orderMargin | y | string | 委托保证金 | ||
| positionMargin | y | string | 仓位保证金 | ||
| unRealizedSurplus | y | string | 未实现盈亏 | ||
| accountRights | y | string | 账户权益 |
资产列表
GET /api/v1/perpetual/account/assets
请求参数:
Query
| 参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
|---|---|---|---|---|---|
| AccessKeyId | y | string | 访问key | ||
| SignatureVersion | y | string | 版本 | ||
| SignatureMethod | y | string | 签名方法 | HmacSHA256 | |
| Signature | y | string | 签名 | ||
| Timestamp | y | string | 时间戳 |
Response
[
{
"accountRightsBtcValue": "0.000000",
"accountRightsCnValue": "0.00",
"accountRightsEthValue": "0.000000",
"accountRightsValue": "0.000000",
"appLogo": "",
"availableBalance": "21684.671205",
"availableDonation": "0.000000",
"availableMargin": "0.000000",
"bizType": "perpetual",
"btcValue": "0.00000000",
"cnPrice": "0.00",
"contractCode": "ultiusdt",
"currencyCode": "USDT",
"currencyCodeDisplayName": "USDT",
"currentOrderMargin": "0.000000",
"decimalPlaces": 0,
"donationAccountRights": "0.000000",
"donationBtcValue": "0.000000",
"donationCnyValue": "0.00",
"donationEthValue": "0.000000",
"donationFrozen": "0.000000",
"donationOrderMargin": "0.000000",
"donationPositionMargin": "0.000000",
"donationValue": "0.000000",
"env": 0,
"exchange": false,
"fee": "0.000000",
"followRealizedSurplus": "0.000000",
"followUnRealizedSurplus": "0.000000",
"frozenBalance": "0.000000",
"maintenanceMargin": "0.000000",
"manuallyFreezeBalance": "0.000000",
"nextRewardTimestamp": 0,
"openCardId": 0,
"openCardRatio": "0",
"openMargin": "0.000000",
"orderFee": "0.000000",
"orderMargin": "25.180794",
"positionAccountRights": "21709.852000",
"positionMargin": "0.000000",
"price": "0.00000",
"rate": [],
"realAvailableBalance": "0.000000",
"realAvailableDonation": "0.000000",
"realPositionAccountRights": "21709.852000",
"realizedSurplus": "-512.148000",
"realizedSurplusValue": "-512.148000",
"rechargeable": false,
"risk": "",
"skill": 0,
"sort": 3,
"totalAccountBalance": "0.000000",
"totalAccountBalanceCny": "0.00",
"totalDonationAccount": "0.000000",
"totalDonationAccountCny": "0.00",
"totalOpenCardValue": "0.000000",
"totalShadowMargin": "0.000000",
"transfer": 1,
"transferOpenCardInvalid": false,
"type": 0,
"unRealizedSurplus": "0.000000",
"unRealizedSurplusBtcValue": "0.000000",
"unRealizedSurplusValue": "0.000000",
"webLogo": "",
"welfareTotalProfit": 0,
"welfareTotalProfitIn24Hours": 0,
"withdrawable": true
}
]
返回:
| 参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
|---|---|---|---|---|---|
| availableBalance | y | string | 可用余额 | ||
| currencyCode | y | string | 币种 | ||
| currencyCodeDisplayName | y | string | 币种显示名称 | ||
| env | y | int | 是否测试币 0:线上币,1:测试币 | ||
| frozenBalance | y | string | 可用冻结(出现在划转审核) | ||
| orderMargin | y | string | 订单保证金 | ||
| positionMargin | y | string | 仓位保证金 | ||
| positionAccountRights | y | string | 账户权益 | ||
| realizedSurplus | y | string | 已实现盈亏 | ||
| unRealizedSurplus | y | string | 未实现盈亏 |
成交记录
GET /api/v1/perpetual/bills/deal-record
请求参数:
Query
| 参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
|---|---|---|---|---|---|
| AccessKeyId | y | string | 访问key | ||
| SignatureVersion | y | string | 版本 | ||
| SignatureMethod | y | string | 签名方法 | HmacSHA256 | |
| Signature | y | string | 签名 | ||
| Timestamp | y | string | 时间戳 | ||
| startDate | n | long | 开始时间 | ||
| endDate | n | long | 结束时间 | ||
| contractCode | n | string | 合约code | ||
| page | n | integer | 页数 | 1 | |
| pageSize | n | integer | 每页数量 | 20 | |
| startId | n | long | 开始id | ||
| endId | n | long | 结束id |
Response
{
"code": 200,
"data": {
"data": [
{
"amount": "13.0000000000000000",
"contractCode": "btcusdt",
"createDate": "2025-05-09 13:39:37",
"currencyCode": "USDT",
"dealType": 2,
"detailSide": "close_long",
"fee": "-0.8000545800000000",
"id": "13419843",
"makerTaker": "taker",
"orderId": 3801631571034848,
"price": "102571.1000000000000000",
"profit": "4.4805181818181818",
"refOrderId": 3801631557239023,
"size": "1333.4243000000000000",
"uId": "5e492ba2-3a55-4fe1-a945-849cc3c9d250",
"userId": "109200034"
}
],
"pageNum": 1,
"pageSize": 20,
"totalCount": 112677
},
"msg": "success"
}
返回:
| 参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
|---|---|---|---|---|---|
| amount | y | string | 成交数量 | ||
| contractCode | y | string | 合约code | ||
| createDate | y | string | 创建时间 | ||
| currencyCode | y | string | 币种 | ||
| dealType | y | string | 成交类型,1:自成交,2:与其他用户成交 | ||
| detailSide | y | string | 开平方向 | ||
| fee | y | string | 手续费 | ||
| id | y | long | 成交记录id | ||
| makerTaker | y | string | maker or taker | ||
| orderId | y | long | 订单id | ||
| price | y | string | 成交价格 | ||
| profit | y | string | 收益 | ||
| refOrderId | y | long | 关联订单id | ||
| size | y | string | 成交价值 | ||
| uId | y | string | 唯一ID | ||
| userId | y | long | uid |