paradex_open_orders
Monitor active orders to track execution status, verify prices and quantities, and manage trading strategies on the Paradex perpetual futures platform.
Instructions
Monitor your active orders to track execution status and manage your trading strategy.
Use this tool when you need to:
- Check which of your orders are still pending execution
- Verify limit order prices and remaining quantities
- Determine which orders might need cancellation or modification
- Get a complete picture of your current market exposure
Keeping track of your open orders is essential for effective order management
and avoiding duplicate or conflicting trades.
Example use cases:
- Checking if your limit orders have been partially filled
- Verifying that a recently placed order was accepted by the exchange
- Identifying stale orders that should be canceled or modified
- Getting a consolidated view of all pending orders across markets
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| market_id | No | Filter by market. | ALL |
| limit | No | Limit the number of results to the specified number. | |
| offset | No | Offset the results to the specified number. |
Implementation Reference
- src/mcp_paradex/tools/orders.py:20-77 (handler)The handler function for the paradex_open_orders tool. It authenticates with Paradex client, fetches open orders optionally filtered by market, validates and sorts them by creation time, applies pagination with limit and offset, and returns a structured response including schema and metadata.@server.tool(name="paradex_open_orders", annotations=ToolAnnotations(readOnlyHint=True)) async def get_open_orders( market_id: Annotated[str, Field(default="ALL", description="Filter by market.")], limit: Annotated[ int, Field( default=10, gt=0, le=100, description="Limit the number of results to the specified number.", ), ], offset: Annotated[ int, Field( default=0, ge=0, description="Offset the results to the specified number.", ), ], ctx: Context = None, ) -> dict: """ Monitor your active orders to track execution status and manage your trading strategy. Use this tool when you need to: - Check which of your orders are still pending execution - Verify limit order prices and remaining quantities - Determine which orders might need cancellation or modification - Get a complete picture of your current market exposure Keeping track of your open orders is essential for effective order management and avoiding duplicate or conflicting trades. Example use cases: - Checking if your limit orders have been partially filled - Verifying that a recently placed order was accepted by the exchange - Identifying stale orders that should be canceled or modified - Getting a consolidated view of all pending orders across markets """ client = await get_authenticated_paradex_client() params = {"market": market_id} if market_id != "" and market_id != "ALL" else None response = client.fetch_orders(params=params) if "error" in response: ctx.error(f"Error fetching open orders: {response['error']}") raise Exception(response["error"]) orders = order_state_adapter.validate_python(response["results"]) sorted_orders = sorted(orders, key=lambda x: x.created_at) result_orders = sorted_orders[offset : offset + limit] result = { "description": OrderState.__doc__.strip() if OrderState.__doc__ else None, "fields": OrderState.model_json_schema(), "results": result_orders, "total": len(sorted_orders), "limit": limit, "offset": offset, } return result
- src/mcp_paradex/tools/orders.py:20-20 (registration)The @server.tool decorator registers the paradex_open_orders tool with readOnlyHint=True.@server.tool(name="paradex_open_orders", annotations=ToolAnnotations(readOnlyHint=True))
- Schema reference for paradex_open_orders output provided via get_filters_model tool, using OrderState.model_json_schema() for type validation and documentation.tool_descriptions = { "paradex_markets": models.MarketDetails.model_json_schema(), "paradex_market_summaries": models.MarketSummary.model_json_schema(), "paradex_open_orders": models.OrderState.model_json_schema(), "paradex_orders_history": models.OrderState.model_json_schema(), "paradex_vaults": models.Vault.model_json_schema(), "paradex_vault_summary": models.VaultSummary.model_json_schema(), }
- TypeAdapter for list[OrderState] used to validate the API response in the handler.order_state_adapter = TypeAdapter(list[OrderState])