Execute Sell
Execute a sell order for prediction outcome token shares, exchanging shares for USDC.
info
- Must call Get Engine Status first to verify the engine is available
- Must call Get Position List to confirm the position exists and check available
shares - Must call Get Order Estimate to preview the sell order
- Must display the estimate to the user and obtain explicit confirmation before calling this endpoint
- Phase 1 supports
orderType=1(FOK) only — orders that cannot be fully filled are cancelled sizeis in shares, not USDC- A
200response is an acknowledgment only — use Get Order List to check the final fill status
HTTP Request
POST/v5/alpha/prediction/sellRequest Parameters
| Parameter | Required | Type | Comments |
|---|---|---|---|
| tokenId | true | string | Outcome token ID to sell (from Get Position List) |
| size | true | string | Number of shares to sell (positive decimal as string) |
| orderType | true | integer | Order type. Refer to predictionOrderType. Phase 1: 1 (FOK) only |
| slippage | true | string | Maximum acceptable price slippage as decimal. 0.05 = 5% tolerance |
| eventId | true | string | Event ID associated with the token |
| toTokenCode | false | string | Destination token code. Phase 1 fixed to USDC |
Response Parameters
| Parameter | Type | Comments |
|---|---|---|
| orderNo | string | Order number. Use with Get Order List to check fill status |
Request Example
- HTTP
- Python
- Node.js
POST /v5/alpha/prediction/sell HTTP/1.1
Host: api.bybit.com
X-BAPI-SIGN: XXXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1704067200000
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json
{
"tokenId": "token_yes_123",
"size": "50",
"orderType": 1,
"slippage": "0.05",
"eventId": "event_123",
"toTokenCode": "USDC"
}
Response Example
{
"retCode": 0,
"retMsg": "OK",
"result": {
"orderNo": "ord_sell_20240101_001"
},
"retExtInfo": {},
"time": 1704067200000
}