paradex_orderbook
Analyze market depth and liquidity to optimize order entry and execution by retrieving orderbook data for Paradex perpetual futures markets.
Instructions
Analyze market depth and liquidity to optimize order entry and execution.
Use this tool when you need to:
- Assess true liquidity before placing large orders
- Identify potential support/resistance levels from order clusters
- Determine optimal limit order prices for higher fill probability
- Detect order imbalances that might signal price direction
Understanding the orderbook is essential for effective trade execution,
especially for larger orders or in less liquid markets.
Example use cases:
- Finding the optimal limit price to ensure your order gets filled
- Estimating potential slippage for market orders of different sizes
- Identifying large resting orders that might act as support/resistance
- Detecting order book imbalances that could predict short-term price moves
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| market_id | Yes | Market symbol to get orderbook for. | |
| depth | No | The depth of the orderbook to retrieve. |
Implementation Reference
- src/mcp_paradex/tools/market.py:313-347 (handler)The handler function for 'paradex_orderbook' tool. It is registered via the @server.tool decorator and fetches the orderbook data from the Paradex client using the provided market_id and depth parameters.@server.tool(name="paradex_orderbook") async def get_orderbook( market_id: Annotated[str, Field(description="Market symbol to get orderbook for.")], depth: Annotated[ int, Field(default=OrderbookDepth.MEDIUM, description="The depth of the orderbook to retrieve."), ], ctx: Context = None, ) -> dict[str, Any]: """ Analyze market depth and liquidity to optimize order entry and execution. Use this tool when you need to: - Assess true liquidity before placing large orders - Identify potential support/resistance levels from order clusters - Determine optimal limit order prices for higher fill probability - Detect order imbalances that might signal price direction Understanding the orderbook is essential for effective trade execution, especially for larger orders or in less liquid markets. Example use cases: - Finding the optimal limit price to ensure your order gets filled - Estimating potential slippage for market orders of different sizes - Identifying large resting orders that might act as support/resistance - Detecting order book imbalances that could predict short-term price moves """ try: # Get orderbook from Paradex client = await get_paradex_client() response = client.fetch_orderbook(market_id, params={"depth": depth}) return response except Exception as e: await ctx.error(f"Error fetching orderbook for {market_id}: {e!s}") raise e