Skip to main content
POST
/
markets
/
{id}
/
simulate
Simulate a market trade
curl --request POST \
  --url https://api-testnet.context.markets/v2/markets/{id}/simulate \
  --header 'Content-Type: application/json' \
  --data '
{
  "side": "yes",
  "amount": 123,
  "amountType": "usd"
}
'
{
  "marketId": "<string>",
  "side": "yes",
  "amount": 123,
  "amountType": "usd",
  "estimatedContracts": 123,
  "estimatedAvgPrice": 123,
  "estimatedSlippage": 123
}

Path Parameters

id
string
required

Market ID (hash) or slug

Body

application/json

Trade simulation parameters

side
enum<string>
required
Available options:
yes,
no
amount
number
required
amountType
enum<string>
required
Available options:
usd,
contracts
trader
string

Response

Simulation results

marketId
string
required
side
enum<string>
required
Available options:
yes,
no
amount
number
required
amountType
enum<string>
required
Available options:
usd,
contracts
estimatedContracts
number
required
estimatedAvgPrice
number
required
estimatedSlippage
number
required