Skip to main content

Get Order Estimate

Estimate the outcome of a prediction market buy or sell order before execution. This is a mandatory step — always show the estimate to the user and obtain explicit confirmation before calling Buy or Sell.

info
  • BUY: set side=1, amount = USDC to invest, include payTokenCode="USDC"
  • SELL: set side=2, amount = number of shares to sell
  • Phase 1 supports orderType=1 (FOK) only
  • Always display estimatedCost, estimatedReceive, feeAmount, and toWin (BUY only) to the user before proceeding
  • Do NOT call Buy or Sell without explicit user confirmation after viewing the estimate

HTTP Request

POST/v5/alpha/prediction/order-estimate

Request Parameters

ParameterRequiredTypeComments
tokenIdtruestringOutcome token ID (from Get Event Detail)
sidetrueintegerTrade direction. Refer to predictionSide
eventIdtruestringEvent ID associated with the token
amounttruestringBUY: USDC to invest. SELL: number of shares to sell (positive decimal as string)
orderTypetrueintegerOrder type. Refer to predictionOrderType. Phase 1: 1 (FOK) only
payTokenCodefalsestringPayment token code. Required for BUY. Phase 1 fixed to USDC

Response Parameters

ParameterTypeComments
avgPricestringEstimated average execution price per share (0–1)
estimatedCoststringBUY: USDC to pay. SELL: shares to sell
estimatedReceivestringBUY: estimated shares received. SELL: estimated USDC received
toWinstringBUY only: amount to win if outcome is correct (shares × 1 USDC)
feeAmountstringTotal platform fee (USDC) = serverFee + polymarketFee
feeDetailobjectFee breakdown
> serverFeestringPlatform service fee (USDC)
> polymarketFeestringPolymarket protocol fee (USDC)
slippagestringSlippage applied to this estimate

Request Example

POST /v5/alpha/prediction/order-estimate 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",
"side": 1,
"eventId": "event_123",
"amount": "100",
"orderType": 1,
"payTokenCode": "USDC"
}

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": {
"avgPrice": "0.65",
"estimatedCost": "100",
"estimatedReceive": "153.84",
"toWin": "153.84",
"feeAmount": "1.00",
"feeDetail": {
"serverFee": "0.70",
"polymarketFee": "0.30"
},
"slippage": "0.05"
},
"retExtInfo": {},
"time": 1704067200000
}