移倉
您可以在同一個母子帳戶體系下移動期貨、期權的倉位, 以及現貨的幣幣交易
信息
暫不支持統一帳戶2.0 反向合約移倉
信息
HTTP 請求
POST /v5/position/move-positions
請求參數
參數 | 是否必需 | 類型 | 說明 |
---|---|---|---|
fromUid | true | string | 原UID
|
toUid | true | string | 目標UID
|
list | true | array | Object. 單次請求最多支持25腿 |
> category | true | string | 產品類型linear , spot , option |
> symbol | true | string | 合約名稱/幣對名 |
> price | true | string | 訂單價格
|
> side | true | string | 是fromUid 的交易方向
|
> qty | true | string | 交易數量
|
響應參數
參數 | 類型 | 說明 |
---|---|---|
retCode | integer | 響應碼. 0 表示請求被成功接受 |
retMsg | string | 響應信息 |
result | map | Object |
> blockTradeId | string | 大宗交易訂單ID |
> status | string | 訂單狀態. Processing , Rejected |
> rejectParty | string |
|
請求示例
- HTTP
- Python
- Java
- Node.js
POST /v5/position/move-positions HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXXX
X-BAPI-API-KEY: XXXXXX
X-BAPI-TIMESTAMP: 1697447928051
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json
{
"fromUid": "100307601",
"toUid": "592324",
"list": [
{
"category": "spot",
"symbol": "BTCUSDT",
"price": "100",
"side": "Sell",
"qty": "0.01"
}
]
}
import com.bybit.api.client.domain.*;
import com.bybit.api.client.domain.position.*;
import com.bybit.api.client.domain.position.request.*;
import com.bybit.api.client.service.BybitApiClientFactory;
var client = BybitApiClientFactory.newInstance().newAsyncPositionRestClient();
var movePositionsRequest = Arrays.asList(MovePositionDetailsRequest.builder().category(CategoryType.SPOT.getCategoryTypeId()).symbol("BTCUSDT").side(Side.SELL.getTransactionSide()).price("100").qty("0.01").build(),
MovePositionDetailsRequest.builder().category(CategoryType.SPOT.getCategoryTypeId()).symbol("ETHUSDT").side(Side.SELL.getTransactionSide()).price("100").qty("0.01").build());
var batchMovePositionsRequest = BatchMovePositionRequest.builder().fromUid("123456").toUid("456789").list(movePositionsRequest).build();
System.out.println(client.batchMovePositions(batchMovePositionsRequest));
響應示例
{
"retCode": 0,
"retMsg": "OK",
"result": {
"blockTradeId": "e9bb926c95f54cf1ba3e315a58b8597b",
"status": "Processing",
"rejectParty": ""
}
}