Skip to main content
POST
/
orders
/
simulate
Simulate order execution
curl --request POST \
  --url https://api-testnet.context.markets/v2/orders/simulate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "marketId": "<string>",
  "trader": "<string>",
  "maxSize": "<string>",
  "maxPrice": "<string>",
  "outcomeIndex": 4503599627370495,
  "side": "bid"
}
'
{
  "levels": [
    {
      "price": "<string>",
      "sizeAvailable": "<string>",
      "cumulativeSize": "<string>",
      "takerFee": "<string>",
      "cumulativeTakerFee": "<string>",
      "collateralRequired": "<string>",
      "cumulativeCollateral": "<string>",
      "makerCount": 123
    }
  ],
  "summary": {
    "fillSize": "<string>",
    "fillCost": "<string>",
    "takerFee": "<string>",
    "weightedAvgPrice": "<string>",
    "totalLiquidityAvailable": "<string>",
    "percentFillable": 123,
    "slippageBps": 123
  },
  "collateral": {
    "balance": "<string>",
    "outcomeTokenBalance": "<string>",
    "requiredForFill": "<string>",
    "isSufficient": true
  },
  "warnings": [
    "LOW_LIQUIDITY"
  ]
}

Authorizations

Authorization
string
header
required

API key passed as Bearer token

Body

application/json

Simulation parameters

marketId
string
required
trader
string
required
maxSize
string
required
maxPrice
string
required
outcomeIndex
integer
required
Required range: 0 <= x <= 9007199254740991
side
enum<string>
required
Available options:
bid,
ask

Response

Simulation results

levels
object[]
required
summary
object
required
collateral
object
required
warnings
enum<string>[]
required
Available options:
LOW_LIQUIDITY,
HIGH_SLIPPAGE,
INSUFFICIENT_LIQUIDITY,
INSUFFICIENT_COLLATERAL