paradex_orderbook
Analyze market depth and liquidity to optimize order execution. Assess true liquidity, identify support/resistance levels, determine optimal limit prices, and detect order imbalances for informed trading decisions.
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 |
|---|---|---|---|
| depth | No | The depth of the orderbook to retrieve. | |
| market_id | Yes | Market symbol to get orderbook for. |
Implementation Reference
- src/mcp_paradex/tools/market.py:313-347 (handler)Handler function decorated with @server.tool(name="paradex_orderbook"). Fetches the orderbook data from Paradex client for specified market and depth, returns the raw response dictionary.@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
- Enum defining valid orderbook depth levels used in the paradex_orderbook tool parameters.class OrderbookDepth(int, Enum): """Valid orderbook depth values.""" SHALLOW = 5 MEDIUM = 10 DEEP = 20 VERY_DEEP = 50 FULL = 100
- src/mcp_paradex/tools/market.py:313-313 (registration)Tool registration decorator specifying the tool name 'paradex_orderbook'.@server.tool(name="paradex_orderbook")