Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sportsxapp.com/llms.txt

Use this file to discover all available pages before exploring further.

9 operations. See the trading guide for worked examples.

cancel_all_orders

Mutation — returns list[BatchCancelOrdersResult]. GraphQL field: cancelAllOrders Cancel of all open orders of an account. Parameters
NameTypeRequiredDescription
geo_locationstrNo
device_infoDeviceInfo (dict — see below)No
device_info accepts a dict with these keys (pass as params={"device_info": {...}}):
FieldTypeRequiredDescription
device_idstrNoThe unique id of the device from the device itself.
Example
result = client.cancel_all_orders(params={"geo_location": ..., "device_info": ...}, selections=Selection(...))

cancel_order

Mutation — returns CancelOrderResult. GraphQL field: cancelOrder Cancels an order. Parameters
NameTypeRequiredDescription
order_idstrYesThe id of the order that the user wishes to cancel.
geo_locationstrNo
device_infoDeviceInfo (dict — see below)No
device_info accepts a dict with these keys (pass as params={"device_info": {...}}):
FieldTypeRequiredDescription
device_idstrNoThe unique id of the device from the device itself.
Example
result = client.cancel_order(params={"order_id": ..., "geo_location": ..., "device_info": ...}, selections=Selection(...))

cancel_orders

Mutation — returns list[BatchCancelOrdersResult]. GraphQL field: cancelOrders Batch cancel of orders. Parameters
NameTypeRequiredDescription
order_idslist[str]NoThe list of the ids of the orders that the user wishes to cancel.
geo_locationstrNo
device_infoDeviceInfo (dict — see below)No
device_info accepts a dict with these keys (pass as params={"device_info": {...}}):
FieldTypeRequiredDescription
device_idstrNoThe unique id of the device from the device itself.
Example
result = client.cancel_orders(params={"order_ids": ..., "geo_location": ..., "device_info": ...}, selections=Selection(...))

place_order

Mutation — returns OrderResult. Also available as confirm_order. GraphQL field: confirmOrder Creates a new order. Parameters
NameTypeRequiredDescription
user_orderUserOrder (dict — see below)YesThe data structure holding the details for the order to be placed.
geo_locationstrNo
device_infoDeviceInfo (dict — see below)No
user_order accepts a dict with these keys (pass as params={"user_order": {...}}):
FieldTypeRequiredDescription
market_idstrYesThe ID of the market to place the order on.
order_type"MARKET" | "LIMIT"YesThe type of order to place.
action"BUY" | "SELL"YesThe action of the order.
pricefloatNoThe limit price for an order, which will be ignored for order_type market.
quantityfloatYesThe quantity of the order in number of contracts.
client_order_idstrNoThe optional order_id sent by the client’s for their reference.
cancel_on_disconnectboolNoThe optional flag to cancel orders on disconnection.
expiration"GOOD_TILL_START" | "GOOD_TILL_TIME"NoThe optional expiration condition for the order.
expiration_timeintNoThe optional expiration time for time-based expiration (UNIX microseconds).
ux_action"BUY_YES" | "BUY_NO" | "SELL_NO" | "SELL_YES"NoThe optional UX action representing the user’s intended action.
device_info accepts a dict with these keys (pass as params={"device_info": {...}}):
FieldTypeRequiredDescription
device_idstrNoThe unique id of the device from the device itself.
Example
result = client.place_order(params={"user_order": ..., "geo_location": ..., "device_info": ...}, selections=Selection(...))

place_orders

Mutation — returns OrderResults. Also available as confirm_orders. GraphQL field: confirmOrders Creates a set of new orders. Parameters
NameTypeRequiredDescription
user_ordersUserOrder (dict — see below)YesThe data structure holding the details for the orders to be placed.
geo_locationstrNo
device_infoDeviceInfo (dict — see below)No
user_orders accepts a dict with these keys (pass as params={"user_orders": {...}}):
FieldTypeRequiredDescription
market_idstrYesThe ID of the market to place the order on.
order_type"MARKET" | "LIMIT"YesThe type of order to place.
action"BUY" | "SELL"YesThe action of the order.
pricefloatNoThe limit price for an order, which will be ignored for order_type market.
quantityfloatYesThe quantity of the order in number of contracts.
client_order_idstrNoThe optional order_id sent by the client’s for their reference.
cancel_on_disconnectboolNoThe optional flag to cancel orders on disconnection.
expiration"GOOD_TILL_START" | "GOOD_TILL_TIME"NoThe optional expiration condition for the order.
expiration_timeintNoThe optional expiration time for time-based expiration (UNIX microseconds).
ux_action"BUY_YES" | "BUY_NO" | "SELL_NO" | "SELL_YES"NoThe optional UX action representing the user’s intended action.
device_info accepts a dict with these keys (pass as params={"device_info": {...}}):
FieldTypeRequiredDescription
device_idstrNoThe unique id of the device from the device itself.
Example
result = client.place_orders(params={"user_orders": ..., "geo_location": ..., "device_info": ...}, selections=Selection(...))

orders

Query — returns Page[Order]. Also available as my_order_history. GraphQL field: myOrderHistory List of all orders for a user, all criteria is combined in an AND. Parameters
NameTypeRequiredDescription
order_idslist[str]NoThe ids of the orders to return
client_order_idslist[str]NoThe client order ids of the orders to return.
market_idslist[str]NoThe id of the market to restrict the orders returned to.
status"CREATED" | "REQUESTED" | "ACCEPTED" | "OPEN" | "FILLED" | … (9 values)NoOrder status filter
paginationPagination (dict — see below)NoThe pagination to use for the results.
sort_byOrdersSortBy (dict — see below)NoThe sorting to use for the results.
pagination accepts a dict with these keys (pass as params={"pagination": {...}}):
FieldTypeRequiredDescription
pageintYesThe page of result where each page has limit values. Integer >= 0
limitintYesThe limit of values per page. Integer value greater than 0.
sort_by accepts a dict with these keys (pass as params={"sort_by": {...}}):
FieldTypeRequiredDescription
name"QUANTITY" | "TIME"NoThe name of the field to sort by.
direction"ASC" | "DESC"NoThe direction, asc or desc for the sort.
Example
result = client.orders(params={"order_ids": ..., "client_order_ids": ..., "market_ids": ..., "status": ..., "pagination": ..., "sort_by": ...}, selections=Selection(...))

settlements

Query — returns Page[Settlement]. Also available as my_settlements_history. GraphQL field: mySettlementsHistory History of all settlements Parameters
NameTypeRequiredDescription
paginationPagination (dict — see below)NoThe pagination to use for the results.
filterSettlementsFilter (dict — see below)NoOptional filter for returned settlements.
pagination accepts a dict with these keys (pass as params={"pagination": {...}}):
FieldTypeRequiredDescription
pageintYesThe page of result where each page has limit values. Integer >= 0
limitintYesThe limit of values per page. Integer value greater than 0.
filter accepts a dict with these keys (pass as params={"filter": {...}}):
FieldTypeRequiredDescription
market_idslist[str]NoA list of market ids to return settlements for.
settlement_type"CLOSED_LONG" | "CLOSED_SHORT" | "EXPIRED_LONG" | "EXPIRED_SHORT"NoRestrict settlements to given type(s)
settled_onDateRangeFilterNo
Example
result = client.settlements(params={"pagination": ..., "filter": ...}, selections=Selection(...))

my_trades_for_order

Query — returns list[Trade]. GraphQL field: myTradesForOrder List of trades associated with provided order id Parameters
NameTypeRequiredDescription
order_idstrYesThe id of the order to find the trades for.
Example
result = client.my_trades_for_order(params={"order_id": ...}, selections=Selection(...))

trades

Query — returns Page[Trade]. Also available as my_trades_history. GraphQL field: myTradesHistory List of the user’s trades Parameters
NameTypeRequiredDescription
sort_byTradesSortBy (dict — see below)NoHow to sort the results of the query.
filterMarketIdsFilter (dict — see below)NoA filter for market ids to include.
settlement_type"SETTLED" | "UNSETTLED"NoA filter for trades.
settled_onDateRangeFilter (dict — see below)NoDate Range filter to find settled trades.
paginationPagination (dict — see below)NoThe pagination to use for the results.
sort_by accepts a dict with these keys (pass as params={"sort_by": {...}}):
FieldTypeRequiredDescription
name"FILLED" | "TIME"NoThe name of the attribute to sort on, default is time.
direction"ASC" | "DESC"NoThe direction to sort, either asc or desc
filter accepts a dict with these keys (pass as params={"filter": {...}}):
FieldTypeRequiredDescription
market_idslist[str]NoA list of market ids to return trades for.
settled_on accepts a dict with these keys (pass as params={"settled_on": {...}}):
FieldTypeRequiredDescription
type"ROLLING_WINDOW"Yes
rolling_windowRollingWindowNo
pagination accepts a dict with these keys (pass as params={"pagination": {...}}):
FieldTypeRequiredDescription
pageintYesThe page of result where each page has limit values. Integer >= 0
limitintYesThe limit of values per page. Integer value greater than 0.
Example
result = client.trades(params={"sort_by": ..., "filter": ..., "settlement_type": ..., "settled_on": ..., "pagination": ...}, selections=Selection(...))

Types

Reusable dict shapes referenced by the operations above. Pass as plain Python dicts; the SDK translates snake_case keys to the wire format.

DateRangeFilter

Specifies a date range to constrain the result set to. At least one must be provided
FieldTypeRequiredDescription
type"ROLLING_WINDOW"Yes
rolling_windowRollingWindowNo

RollingWindow

A rolling window date range filter. A rolling window from now into the past. For instance the last 24 hours
FieldTypeRequiredDescription
increment"SECONDS" | "MINUTES" | "HOURS" | "DAYS" | "MONTHS"Yes
valueintYes