Skip to main content
Glama
Habinar

MCP Paradex Server

by Habinar

paradex_bbo

Access real-time best bid and ask prices for quick trading decisions, monitoring price movements, calculating spreads, and determining fair mid-prices with minimal data.

Instructions

Get the current best available prices for immediate execution decisions. Use this tool when you need to: - Make quick trading decisions without full orderbook depth - Calculate current spread costs before placing orders - Monitor real-time price changes efficiently - Get a snapshot of current market conditions - Determine fair mid-price for calculations The BBO provides the most essential price information with minimal data, perfect for quick decisions or when full orderbook depth isn't needed. Example use cases: - Calculating current trading spreads before placing orders - Monitoring real-time price movements efficiently - Determining execution prices for immediate market orders - Calculating mid-price for order placement strategies - Setting appropriate limit order prices to improve fill chances

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_idYesMarket symbol to get BBO for.

Implementation Reference

  • The handler function for the 'paradex_bbo' tool. It fetches the Best Bid and Offer (BBO) data for a given market ID using the Paradex client, validates the response with the BBO Pydantic model, and returns a dictionary containing the schema, description, and results.
    @server.tool(name="paradex_bbo") async def get_bbo( market_id: Annotated[str, Field(description="Market symbol to get BBO for.")], ctx: Context = None, ) -> dict: """ Get the current best available prices for immediate execution decisions. Use this tool when you need to: - Make quick trading decisions without full orderbook depth - Calculate current spread costs before placing orders - Monitor real-time price changes efficiently - Get a snapshot of current market conditions - Determine fair mid-price for calculations The BBO provides the most essential price information with minimal data, perfect for quick decisions or when full orderbook depth isn't needed. Example use cases: - Calculating current trading spreads before placing orders - Monitoring real-time price movements efficiently - Determining execution prices for immediate market orders - Calculating mid-price for order placement strategies - Setting appropriate limit order prices to improve fill chances """ try: # Get BBO from Paradex client = await get_paradex_client() response = client.fetch_bbo(market_id) bbo = BBO(**response) results = { "description": BBO.__doc__.strip() if BBO.__doc__ else None, "fields": BBO.model_json_schema(), "results": bbo, } return results except Exception as e: await ctx.error(f"Error fetching BBO for {market_id}: {e!s}") raise e
  • Pydantic model defining the structure of BBO (Best Bid and Offer) data, used for input validation and output schema in the paradex_bbo tool.
    class BBO(BaseModel): """Best Bid and Offer model for a market.""" market: Annotated[str, Field(description="Symbol of the market")] seq_no: Annotated[int, Field(description="Sequence number of the orderbook")] ask: Annotated[float, Field(description="Best ask price")] ask_size: Annotated[float, Field(description="Best ask size")] bid: Annotated[float, Field(description="Best bid price")] bid_size: Annotated[float, Field(description="Best bid size")] last_updated_at: Annotated[ int, Field(description="Last update to the orderbook in milliseconds") ]

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/Habinar/mcp-paradex-py'

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