Skip to main content
Glama
sv

MCP Paradex Server

by sv

paradex_orderbook

Analyze market depth and liquidity to optimize order entry and execution by assessing true liquidity, identifying support/resistance levels, and determining optimal limit prices.

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
NameRequiredDescriptionDefault
market_idYesMarket symbol to get orderbook for.
depthNoThe depth of the orderbook to retrieve.

Implementation Reference

  • The handler function decorated with @server.tool(name="paradex_orderbook"), which fetches and returns the orderbook for a given market and depth using the Paradex client. Includes input schema via Annotated Fields and docstring describing usage.
    @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 class defining valid values for the 'depth' parameter in the paradex_orderbook tool schema.
    class OrderbookDepth(int, Enum):
        """Valid orderbook depth values."""
    
        SHALLOW = 5
        MEDIUM = 10
        DEEP = 20
        VERY_DEEP = 50
        FULL = 100
  • The @server.tool decorator registers the get_orderbook function as the MCP tool named 'paradex_orderbook'.
    @server.tool(name="paradex_orderbook")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sv/mcp-paradex-py'

If you have feedback or need assistance with the MCP directory API, please join our Discord server