Python SDK methods for Portfolio operations
Method | HTTP request | Description |
---|---|---|
amend_order | POST /portfolio/orders//amend | Amend Order |
batch_cancel_orders | DELETE /portfolio/orders/batched | Batch Cancel Orders |
batch_create_orders | POST /portfolio/orders/batched | Batch Create Orders |
cancel_order | DELETE /portfolio/orders/ | Cancel Order |
create_order | POST /portfolio/orders | Create Order |
create_order_group | POST /portfolio/order_groups/create | Create Order Group |
decrease_order | POST /portfolio/orders//decrease | Decrease Order |
delete_order_group | DELETE /portfolio/order_groups/ | Delete Order Group |
get_balance | GET /portfolio/balance | Get Balance |
get_fills | GET /portfolio/fills | Get Fills |
get_order | GET /portfolio/orders/ | Get Order |
get_order_groups | GET /portfolio/order_groups | Get Order Groups |
get_order_queue_position | GET /portfolio/orders//queue_position | Get Order Queue Position |
get_orders | GET /portfolio/orders | Get Orders |
get_positions | GET /portfolio/positions | Get Positions |
get_queue_positions | POST /portfolio/orders/queue_positions | Get Queue Positions |
get_settlements | GET /portfolio/settlements | Get Settlements |
get_total_resting_order_value | GET /portfolio/summary/total_resting_order_value | Get Total Resting Order Value |
reset_order_group | POST /portfolio/order_groups//reset | Reset Order Group |
AmendOrderResponse amend_order(order_id, amend_order_request)Amend Order Amend an existing order
Name | Type | Description | Notes |
---|---|---|---|
order_id | str | Order ID | |
amend_order_request | AmendOrderRequest |
Status code | Description |
---|---|
200 | Order amended successfully |
400 | Bad request - invalid input |
401 | Unauthorized - authentication required |
404 | Resource not found |
500 | Internal server error |
BatchCancelOrdersResponse batch_cancel_orders(batch_cancel_orders_request)Batch Cancel Orders Cancel multiple orders in a single request
Name | Type | Description | Notes |
---|---|---|---|
batch_cancel_orders_request | BatchCancelOrdersRequest |
Status code | Description |
---|---|
200 | Batch order cancellation completed |
400 | Bad request - invalid input |
401 | Unauthorized - authentication required |
500 | Internal server error |
BatchCreateOrdersResponse batch_create_orders(batch_create_orders_request)Batch Create Orders Create multiple orders in a single request
Name | Type | Description | Notes |
---|---|---|---|
batch_create_orders_request | BatchCreateOrdersRequest |
Status code | Description |
---|---|
200 | Batch order creation completed |
400 | Bad request - invalid input |
401 | Unauthorized - authentication required |
500 | Internal server error |
CancelOrderResponse cancel_order(order_id)Cancel Order Cancel an order
Name | Type | Description | Notes |
---|---|---|---|
order_id | str | Order ID |
Status code | Description |
---|---|
200 | Order cancelled successfully |
401 | Unauthorized - authentication required |
404 | Resource not found |
500 | Internal server error |
CreateOrderResponse create_order(create_order_request)Create Order Create a new order
Name | Type | Description | Notes |
---|---|---|---|
create_order_request | CreateOrderRequest |
Status code | Description |
---|---|
201 | Order created successfully |
400 | Bad request - invalid input |
401 | Unauthorized - authentication required |
429 | Too Many Requests - rate limit exceeded |
500 | Internal server error |
CreateOrderGroupResponse create_order_group(create_order_group_request)Create Order Group Create a new order group
Name | Type | Description | Notes |
---|---|---|---|
create_order_group_request | CreateOrderGroupRequest |
Status code | Description |
---|---|
201 | Order group created successfully |
400 | Bad request - invalid input |
401 | Unauthorized - authentication required |
500 | Internal server error |
DecreaseOrderResponse decrease_order(order_id, decrease_order_request)Decrease Order Decrease the size of an existing order
Name | Type | Description | Notes |
---|---|---|---|
order_id | str | Order ID | |
decrease_order_request | DecreaseOrderRequest |
Status code | Description |
---|---|
200 | Order decreased successfully |
400 | Bad request - invalid input |
401 | Unauthorized - authentication required |
404 | Resource not found |
500 | Internal server error |
delete_order_group(order_group_id)Delete Order Group Delete an order group
Name | Type | Description | Notes |
---|---|---|---|
order_group_id | str | Order group ID |
Status code | Description |
---|---|
204 | Order group deleted successfully |
401 | Unauthorized - authentication required |
404 | Resource not found |
500 | Internal server error |
GetBalanceResponse get_balance()Get Balance Get the user’s current balance
Status code | Description |
---|---|
200 | Balance retrieved successfully |
401 | Unauthorized - authentication required |
500 | Internal server error |
GetFillsResponse get_fills(ticker=ticker, order_id=order_id, min_ts=min_ts, max_ts=max_ts, limit=limit, cursor=cursor)Get Fills Get fills for the logged-in user. A fill represents a partial or complete execution of an order. When an order matches with another order in the orderbook, a fill is created for each side of the trade.
Name | Type | Description | Notes |
---|---|---|---|
ticker | str | Filter by market ticker | [optional] |
order_id | str | Filter by order ID | [optional] |
min_ts | int | Filter items after this Unix timestamp | [optional] |
max_ts | int | Filter items before this Unix timestamp | [optional] |
limit | int | Number of results per page. Defaults to 100. Maximum value is 200. | [optional] [default to 100] |
cursor | str | Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. | [optional] |
Status code | Description |
---|---|
200 | Fills retrieved successfully |
400 | Bad request - invalid input |
401 | Unauthorized - authentication required |
500 | Internal server error |
GetOrderResponse get_order(order_id)Get Order Get a single order by ID
Name | Type | Description | Notes |
---|---|---|---|
order_id | str | Order ID |
Status code | Description |
---|---|
200 | Order retrieved successfully |
401 | Unauthorized - authentication required |
404 | Resource not found |
500 | Internal server error |
GetOrderGroupsResponse get_order_groups(status=status, limit=limit, cursor=cursor)Get Order Groups Get order groups for the logged-in user
Name | Type | Description | Notes |
---|---|---|---|
status | str | Filter by status. Possible values depend on the endpoint. | [optional] |
limit | int | Number of results per page. Defaults to 100. Maximum value is 200. | [optional] [default to 100] |
cursor | str | Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. | [optional] |
Status code | Description |
---|---|
200 | Order groups retrieved successfully |
400 | Bad request - invalid input |
401 | Unauthorized - authentication required |
500 | Internal server error |
GetOrderQueuePositionResponse get_order_queue_position(order_id)Get Order Queue Position Get the queue position for an order
Name | Type | Description | Notes |
---|---|---|---|
order_id | str | Order ID |
Status code | Description |
---|---|
200 | Queue position retrieved successfully |
401 | Unauthorized - authentication required |
404 | Resource not found |
500 | Internal server error |
GetOrdersResponse get_orders(ticker=ticker, event_ticker=event_ticker, min_ts=min_ts, max_ts=max_ts, status=status, limit=limit, cursor=cursor)Get Orders Get orders for the logged-in user
Name | Type | Description | Notes |
---|---|---|---|
ticker | str | Filter by market ticker | [optional] |
event_ticker | str | Filter by event ticker | [optional] |
min_ts | int | Filter items after this Unix timestamp | [optional] |
max_ts | int | Filter items before this Unix timestamp | [optional] |
status | str | Filter by status. Possible values depend on the endpoint. | [optional] |
limit | int | Number of results per page. Defaults to 100. Maximum value is 200. | [optional] [default to 100] |
cursor | str | Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. | [optional] |
Status code | Description |
---|---|
200 | Orders retrieved successfully |
400 | Bad request - invalid input |
401 | Unauthorized - authentication required |
500 | Internal server error |
GetPositionsResponse get_positions(ticker=ticker, event_ticker=event_ticker, count_down=count_down, count_up=count_up, limit=limit, cursor=cursor)Get Positions Get positions for the logged-in user
Name | Type | Description | Notes |
---|---|---|---|
ticker | str | Filter by market ticker | [optional] |
event_ticker | str | Filter by event ticker | [optional] |
count_down | int | Filter positions by minimum count down value | [optional] |
count_up | int | Filter positions by minimum count up value | [optional] |
limit | int | Number of results per page. Defaults to 100. Maximum value is 200. | [optional] [default to 100] |
cursor | str | Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. | [optional] |
Status code | Description |
---|---|
200 | Positions retrieved successfully |
400 | Bad request - invalid input |
401 | Unauthorized - authentication required |
500 | Internal server error |
GetQueuePositionsResponse get_queue_positions(get_queue_positions_request)Get Queue Positions Get queue positions for multiple orders
Name | Type | Description | Notes |
---|---|---|---|
get_queue_positions_request | GetQueuePositionsRequest |
Status code | Description |
---|---|
200 | Queue positions retrieved successfully |
400 | Bad request - invalid input |
401 | Unauthorized - authentication required |
500 | Internal server error |
GetSettlementsResponse get_settlements(limit=limit, cursor=cursor)Get Settlements Get settlements for the logged-in user
Name | Type | Description | Notes |
---|---|---|---|
limit | int | Number of results per page. Defaults to 100. Maximum value is 200. | [optional] [default to 100] |
cursor | str | Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. | [optional] |
Status code | Description |
---|---|
200 | Settlements retrieved successfully |
400 | Bad request - invalid input |
401 | Unauthorized - authentication required |
500 | Internal server error |
GetTotalRestingOrderValueResponse get_total_resting_order_value()Get Total Resting Order Value Get the total value of all resting orders
Status code | Description |
---|---|
200 | Total resting order value retrieved successfully |
401 | Unauthorized - authentication required |
500 | Internal server error |
reset_order_group(order_group_id)Reset Order Group Reset an order group
Name | Type | Description | Notes |
---|---|---|---|
order_group_id | str | Order group ID |
Status code | Description |
---|---|
204 | Order group reset successfully |
401 | Unauthorized - authentication required |
404 | Resource not found |
500 | Internal server error |