curl --request POST \
--url https://api-testnet.context.markets/v2/orders/cancel-replace \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cancel": {
"trader": "<string>",
"nonce": "<string>",
"signature": "<string>"
},
"create": {
"marketId": "<string>",
"trader": "<string>",
"price": "<string>",
"size": "<string>",
"outcomeIndex": 0,
"side": 123,
"nonce": "<string>",
"expiry": "<string>",
"maxFee": "<string>",
"makerRoleConstraint": 1,
"inventoryModeConstraint": 1,
"signature": "<string>",
"type": "<string>"
}
}
'{
"cancel": {
"trader": "<string>",
"nonce": "<string>",
"alreadyCancelled": true,
"success": true
},
"create": {
"success": true,
"order": {
"side": 123,
"price": "<string>",
"size": "<string>",
"filledSize": "<string>",
"remainingSize": "<string>",
"percentFilled": 123,
"insertedAt": "2023-11-07T05:31:56Z",
"type": "limit",
"trader": "<string>",
"marketId": "<string>",
"status": "open",
"voidedAt": "2023-11-07T05:31:56Z",
"voidReason": "UNFILLED_MARKET_ORDER",
"outcomeIndex": 123,
"nonce": "<string>"
}
}
}Atomically cancels an existing order and creates a new one. Both operations must reference the same trader.
curl --request POST \
--url https://api-testnet.context.markets/v2/orders/cancel-replace \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cancel": {
"trader": "<string>",
"nonce": "<string>",
"signature": "<string>"
},
"create": {
"marketId": "<string>",
"trader": "<string>",
"price": "<string>",
"size": "<string>",
"outcomeIndex": 0,
"side": 123,
"nonce": "<string>",
"expiry": "<string>",
"maxFee": "<string>",
"makerRoleConstraint": 1,
"inventoryModeConstraint": 1,
"signature": "<string>",
"type": "<string>"
}
}
'{
"cancel": {
"trader": "<string>",
"nonce": "<string>",
"alreadyCancelled": true,
"success": true
},
"create": {
"success": true,
"order": {
"side": 123,
"price": "<string>",
"size": "<string>",
"filledSize": "<string>",
"remainingSize": "<string>",
"percentFilled": 123,
"insertedAt": "2023-11-07T05:31:56Z",
"type": "limit",
"trader": "<string>",
"marketId": "<string>",
"status": "open",
"voidedAt": "2023-11-07T05:31:56Z",
"voidReason": "UNFILLED_MARKET_ORDER",
"outcomeIndex": 123,
"nonce": "<string>"
}
}
}API key passed as Bearer token
Cancel-replace order pair