The margin coverage(maintenance rate) of an order affects the order status, when the coverage ratio is too low the order will be closed. When the coverage ratio is higher than the requirement, you can transfer this part of the margin to the margin account for efficient use.
1. Query transferable maxmuimu quantity
2. Transfer out margin to margin account
Query transferable maximum quantity
You can use the following api to query transferable maximum quantity of an order.
/POST/api/v1/leverage/canWithdraw/num
URL:
https://api.crossexchange.io/POST/api/v1/leverage/canWithdraw/num
Request field:
Name | Type | |
api_key |
String |
API KEY |
auth_nonce |
String |
Timestamp |
auth_sign |
String |
MD5coding.MD5( api_key+auth_nonce+ isAutoDeposit+isBid+ isUseXex+number+ pair+poolId+price+ rate+stopLossPrice+ stopProfitPrice+apiSecret ) |
orderId |
long |
The order id for you want to query. |
Response:
{
"code": 0,
"data": {
"deposit": "12.25000000"
}
}
code |
String |
0 Successful the other value is failed |
deposit |
BigDecimal |
Transferable maximum quantity, calculate the transferable quantity with a margin maintenance rate of 120%. |
Transfer out margin to margin account
/POST/api/v1/leverage/charge
URL:
https://api.crossexchange.io/POST/api/v1/leverage/charge
Request field:
Name | Type | |
api_key |
String |
API KEY |
auth_nonce |
String |
Timestamp |
auth_sign |
String |
MD5coding.MD5( api_key+auth_nonce+ isAutoDeposit+isBid+ isUseXex+number+ pair+poolId+price+ rate+stopLossPrice+ stopProfitPrice+apiSecret ) |
orderId |
long |
The order id you want to transfer. |
number |
BigDecimal |
The quantity you want to transfer out. |
Response:
{
"code": 0,
"data": {
}
}
code |
String |
0 Successful the other value is failed |