Skip to main content
11 operations. See the trading guide for worked examples.

cancelAllOrders

Mutation — returns list[BatchCancelOrdersResult]. Cancel of all open orders of an account. Parameters
NameGraphQL typeRequiredDescription
geoLocationGeoLocationCodeNo
deviceInfoDeviceInfoNo
Example
result = client.cancelAllOrders(params={"geoLocation": ..., "deviceInfo": ...}, selections=Selection(...))

cancelOrder

Mutation — returns CancelOrderResult. Cancels an order. Parameters
NameGraphQL typeRequiredDescription
orderIdrID!YesThe id of the order that the user wishes to cancel.
geoLocationGeoLocationCodeNo
deviceInfoDeviceInfoNo
Example
result = client.cancelOrder(params={"orderId": ..., "geoLocation": ..., "deviceInfo": ...}, selections=Selection(...))

cancelOrders

Mutation — returns list[BatchCancelOrdersResult]. Batch cancel of orders. Parameters
NameGraphQL typeRequiredDescription
orderIds[rID]NoThe list of the ids of the orders that the user wishes to cancel.
geoLocationGeoLocationCodeNo
deviceInfoDeviceInfoNo
Example
result = client.cancelOrders(params={"orderIds": ..., "geoLocation": ..., "deviceInfo": ...}, selections=Selection(...))

confirmOrder

Mutation — returns OrderResult. Creates a new order. Parameters
NameGraphQL typeRequiredDescription
userOrderUserOrder!YesThe data structure holding the details for the order to be placed.
geoLocationGeoLocationCodeNo
deviceInfoDeviceInfoNo
Example
result = client.confirmOrder(params={"userOrder": ..., "geoLocation": ..., "deviceInfo": ...}, selections=Selection(...))

confirmOrders

Mutation — returns OrderResults. Creates a set of new orders. Parameters
NameGraphQL typeRequiredDescription
userOrders[UserOrder!]!YesThe data structure holding the details for the orders to be placed.
geoLocationGeoLocationCodeNo
deviceInfoDeviceInfoNo
Example
result = client.confirmOrders(params={"userOrders": ..., "geoLocation": ..., "deviceInfo": ...}, selections=Selection(...))

myOrderHistory

Query — returns OrdersWithCount. List of all orders for a user, all criteria is combined in an AND. Parameters
NameGraphQL typeRequiredDescription
orderIds[rID]NoThe ids of the orders to return
clientOrderIds[String]NoThe client order ids of the orders to return.
marketIds[rID]NoThe id of the market to restrict the orders returned to.
statusOrderStatusNoOrder status filter
paginationPaginationNoThe pagination to use for the results.
sortByOrdersSortByNoThe sorting to use for the results.
Example
result = client.myOrderHistory(params={"orderIds": ..., "clientOrderIds": ..., "marketIds": ..., "status": ..., "pagination": ..., "sortBy": ...}, selections=Selection(...))

mySettlementsHistory

Query — returns NetSettlementHistory. History of all settlements Parameters
NameGraphQL typeRequiredDescription
paginationPaginationNoThe pagination to use for the results.
filterSettlementsFilterNoOptional filter for returned settlements.
Example
result = client.mySettlementsHistory(params={"pagination": ..., "filter": ...}, selections=Selection(...))

myTradesForOrder

Query — returns list[Trade]. List of trades associated with provided order id Parameters
NameGraphQL typeRequiredDescription
orderIdrID!YesThe id of the order to find the trades for.
Example
result = client.myTradesForOrder(params={"orderId": ...}, selections=Selection(...))

myTradesHistory

Query — returns TradesWithCount. List of the user’s trades Parameters
NameGraphQL typeRequiredDescription
sortByTradesSortByNoHow to sort the results of the query.
filterMarketIdsFilterNoA filter for market ids to include.
settlementTypeTradeSettlementTypeNoA filter for trades.
settledOnDateRangeFilterNoDate Range filter to find settled trades.
paginationPaginationNoThe pagination to use for the results.
Example
result = client.myTradesHistory(params={"sortBy": ..., "filter": ..., "settlementType": ..., "settledOn": ..., "pagination": ...}, selections=Selection(...))

placeOddsOrder

Mutation — returns OrderResult.

Place Limit Order with Odds and Amount

This mutation creates a limit order with specified odds and amount. The odds are converted into a price, and the order quantity is calculated by dividing the specified amount by the calculated price.

Calculation Formulas

For buy orders:

  • Decimal odds: round(max_price_in_cents / odds)
  • American positive odds: round(max_price_in_cents / (odds + 100) * 100)
  • American negative odds: round((max_price_in_cents / 100) * odds / (odds - 100) * 100)

For sell orders:

The price is calculated as max_price_in_cents - price_for_a_buy_order.

Parameters

  • odds: The odds value, such as 1.7 or +120 or -200.
  • max_price_in_cents: The closing market price in case of a win result.

Rounding

Rounding is performed using the half_up algorithm. If the price is rounded to 0 or max_price_in_cents, the request is rejected.

Note

The calculated quantity may be fractional and below 1. Parameters
NameGraphQL typeRequiredDescription
oddsOrderOddsOrder!Yes
geoLocationGeoLocationCodeNo
deviceInfoDeviceInfoNo
Example
result = client.placeOddsOrder(params={"oddsOrder": ..., "geoLocation": ..., "deviceInfo": ...}, selections=Selection(...))

placeRiskOrder

Mutation — returns OrderResult.

Place Market Order with Amount

This mutation creates a market order with specified amount. The quantity of the order is set to null, which makes the order to be matched up until the given amount is filled. In case the account has less available balance than the specified amount, the market order is filled up to the available balance. Parameters
NameGraphQL typeRequiredDescription
riskOrderRiskOrder!Yes
geoLocationGeoLocationCodeNo
deviceInfoDeviceInfoNo
Example
result = client.placeRiskOrder(params={"riskOrder": ..., "geoLocation": ..., "deviceInfo": ...}, selections=Selection(...))