Skip to main content

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
  • size is in shares, not USDC
  • A 200 response is an acknowledgment only — use Get Order List to check the final fill status

HTTP Request

POST/v5/alpha/prediction/sell

Request Parameters

ParameterRequiredTypeComments
tokenIdtruestringOutcome token ID to sell (from Get Position List)
sizetruestringNumber of shares to sell (positive decimal as string)
orderTypetrueintegerOrder type. Refer to predictionOrderType. Phase 1: 1 (FOK) only
slippagetruestringMaximum acceptable price slippage as decimal. 0.05 = 5% tolerance
eventIdtruestringEvent ID associated with the token
toTokenCodefalsestringDestination token code. Phase 1 fixed to USDC

Response Parameters

ParameterTypeComments
orderNostringOrder number. Use with Get Order List to check fill status

Request Example

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
}