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

Path Parameters

id
string
required

Market id hash or slug

Body

application/json
side
enum<string>
required
Available options:
yes,
no
amount
number
required
Required range: x > 0
amountType
enum<string>
required
Available options:
usd,
contracts
trader
string

EVM address

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x1111111111111111111111111111111111111111"

Response

Simulate market trade

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
warnings
object[]
required