paradex_market_summaries
Retrieve current market summaries including price, volume, and 24h change to identify active or volatile markets for liquidity analysis and momentum strategies.
Instructions
Identify the most active or volatile markets and get current market conditions.
Use this tool when you need to:
- Find the most active markets by volume for liquidity analysis
- Discover markets with significant price movements for momentum strategies
- Compare current prices across multiple assets
- Identify markets with unusual behavior for potential opportunities
Retrieves current market summary information including price, volume,
24h change, and other key market metrics. If "ALL" is specified or no market IDs
are provided, returns summaries for all available markets.
Example use cases:
- Finding high-volatility markets for short-term trading
- Identifying top gainers and losers for the day
- Comparing volume across different markets to find liquidity
- Getting the current price and 24-hour range for price analysis
You can use JMESPath expressions (https://jmespath.org/specification.html) to filter, sort, or limit the results.
Use the `paradex_filters_model` tool to get the filters for a tool.
Examples:
- Filter by high price: "[?high_price > `10000`]"
- Sort by volume: "sort_by([*], &volume)"
- Get top 3 by price change: "[sort_by([*], &to_number(price_change_percent))[-3:]]"Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| market_ids | No | Market symbols to get summaries for. | |
| jmespath_filter | No | JMESPath expression to filter, sort, or limit the results. | |
| limit | No | Limit the number of results to the specified number. | |
| offset | No | Offset the results to the specified number. |
Implementation Reference
- src/mcp_paradex/tools/market.py:159-252 (handler)The handler function 'get_market_summaries' for the 'paradex_market_summaries' tool. It fetches market summary data from Paradex via client.fetch_markets_summary(), validates with MarketSummary model, supports filtering by market_ids, JMESPath filtering, sorting, pagination (limit/offset), and returns results with schema info.
@server.tool(name="paradex_market_summaries", annotations=ToolAnnotations(readOnlyHint=True)) async def get_market_summaries( market_ids: Annotated[ list[str], Field(description="Market symbols to get summaries for.", default=["ALL"]) ], jmespath_filter: Annotated[ str, Field( description="JMESPath expression to filter, sort, or limit the results.", default=None, ), ], limit: Annotated[ int, Field( default=10, gt=0, le=100, description="Limit the number of results to the specified number.", ), ], offset: Annotated[ int, Field( default=0, ge=0, description="Offset the results to the specified number.", ), ], ctx: Context = None, ) -> dict: """ Identify the most active or volatile markets and get current market conditions. Use this tool when you need to: - Find the most active markets by volume for liquidity analysis - Discover markets with significant price movements for momentum strategies - Compare current prices across multiple assets - Identify markets with unusual behavior for potential opportunities Retrieves current market summary information including price, volume, 24h change, and other key market metrics. If "ALL" is specified or no market IDs are provided, returns summaries for all available markets. Example use cases: - Finding high-volatility markets for short-term trading - Identifying top gainers and losers for the day - Comparing volume across different markets to find liquidity - Getting the current price and 24-hour range for price analysis You can use JMESPath expressions (https://jmespath.org/specification.html) to filter, sort, or limit the results. Use the `paradex_filters_model` tool to get the filters for a tool. Examples: - Filter by high price: "[?high_price > `10000`]" - Sort by volume: "sort_by([*], &volume)" - Get top 3 by price change: "[sort_by([*], &to_number(price_change_percent))[-3:]]" """ try: # Get market summary from Paradex client = await get_paradex_client() response = client.fetch_markets_summary(params={"market": "ALL"}) if "error" in response: await ctx.error(response) raise Exception(response["error"]) # Try to validate directly now that the model is more flexible summaries = market_summary_adapter.validate_python(response["results"]) if market_ids and "ALL" not in market_ids: summaries = [summary for summary in summaries if summary.symbol in market_ids] # Apply JMESPath filter if provided if jmespath_filter: summaries = apply_jmespath_filter( data=summaries, jmespath_filter=jmespath_filter, type_adapter=market_summary_adapter, error_logger=ctx.error if ctx else None, ) sorted_summaries = sorted(summaries, key=lambda x: x.symbol, reverse=True) result_summaries = sorted_summaries[offset : offset + limit] result = { "description": MarketSummary.__doc__.strip() if MarketSummary.__doc__ else None, "fields": MarketSummary.model_json_schema(), "results": result_summaries, "total": len(sorted_summaries), "limit": limit, "offset": offset, } return result except Exception as e: logger.error(f"Error fetching market summaries: {e!s}") await ctx.error(f"Error fetching market summaries: {e!s}") raise e - src/mcp_paradex/models.py:416-443 (schema)The MarketSummary Pydantic model defining the schema for market summary data returned by the tool. Fields: symbol, mark_price, delta, greeks, last_traded_price, bid, ask, volume_24h, total_volume, created_at, underlying_price, open_interest, funding_rate, price_change_rate_24h.
class MarketSummary(BaseModel): """Model representing a summary of a market.""" symbol: Annotated[str, Field(default="", description="Market symbol")] mark_price: Annotated[str, Field(default="", description="Mark price")] delta: Annotated[str, Field(default="", description="Deprecated: Use greeks.delta instead")] greeks: Annotated[ Greeks, Field( default=None, description="Greeks (delta, gamma, vega). Partial for perpetual futures" ), ] last_traded_price: Annotated[str, Field(default="", description="Last traded price")] bid: Annotated[str, Field(default="", description="Best bid price")] ask: Annotated[str, Field(default="", description="Best ask price")] volume_24h: Annotated[str, Field(default="", description="24 hour volume in USD")] total_volume: Annotated[ str, Field(default="", description="Lifetime total traded volume in USD") ] created_at: Annotated[int, Field(default=0, description="Market summary creation time")] underlying_price: Annotated[ str, Field(default="", description="Underlying asset price (spot price)") ] open_interest: Annotated[str, Field(default="", description="Open interest in base currency")] funding_rate: Annotated[str, Field(default="", description="8 hour funding rate")] price_change_rate_24h: Annotated[ str, Field(default="", description="Price change rate in the last 24 hours") ] - src/mcp_paradex/tools/market.py:159-159 (registration)Registration of the tool via the @server.tool decorator with name='paradex_market_summaries' and readOnlyHint annotation.
@server.tool(name="paradex_market_summaries", annotations=ToolAnnotations(readOnlyHint=True)) - Type adapter for validating a list of MarketSummary objects. Used in the handler to validate API response data.
market_summary_adapter = TypeAdapter(list[MarketSummary]) - The paradex_filters_model tool references paradex_market_summaries to provide its schema via MarketSummary.model_json_schema().
tool_descriptions = { "paradex_markets": models.MarketDetails.model_json_schema(), "paradex_market_summaries": models.MarketSummary.model_json_schema(),