Skip to main content
Glama
sv

MCP Paradex Server

by sv

paradex_bbo

Retrieve current best bid and ask prices for immediate trading decisions, spread calculations, and real-time market condition monitoring.

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 decorated with @server.tool(name="paradex_bbo"), implementing the core logic: fetches BBO data via Paradex client, validates with BBO model, and formats response with schema.
    @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 BaseModel defining the input/output schema for BBO data used in the paradex_bbo tool response.
    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") ]
  • The @server.tool decorator registers the get_bbo function as the MCP tool named 'paradex_bbo'.
    @server.tool(name="paradex_bbo")

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