Skip to main content
Glama
Habinar

MCP Paradex Server

by Habinar

paradex_funding_data

Analyze perpetual futures funding rates to calculate position costs, identify arbitrage opportunities, and understand historical patterns for trading decisions.

Instructions

Analyze funding rates for potential funding arbitrage or to understand holding costs.

Use this tool when you need to:
- Calculate expected funding payments for a position
- Find markets with extreme funding rates for potential arbitrage
- Understand historical funding patterns for a market
- Evaluate the cost of holding a position over time

This data is critical for perpetual futures traders to assess the carrying cost
of positions and identify potential funding arbitrage opportunities.

Example use cases:
- Finding markets with negative funding for "paid to hold" opportunities
- Calculating the funding component of a trade's P&L
- Comparing funding rates across different assets for relative value trades
- Analyzing funding rate volatility to predict potential rate changes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_idYesMarket symbol to get funding data for.
start_unix_msYesStart time in unix milliseconds.
end_unix_msYesEnd time in unix milliseconds.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main tool handler function that fetches and returns funding data for a specified market over a time range using the Paradex API client. Includes input parameter definitions and output formatting with schema.
    @server.tool(name="paradex_funding_data")
    async def get_funding_data(
        market_id: Annotated[str, Field(description="Market symbol to get funding data for.")],
        start_unix_ms: Annotated[int, Field(description="Start time in unix milliseconds.")],
        end_unix_ms: Annotated[int, Field(description="End time in unix milliseconds.")],
        ctx: Context = None,
    ) -> dict[str, Any]:
        """
        Analyze funding rates for potential funding arbitrage or to understand holding costs.
    
        Use this tool when you need to:
        - Calculate expected funding payments for a position
        - Find markets with extreme funding rates for potential arbitrage
        - Understand historical funding patterns for a market
        - Evaluate the cost of holding a position over time
    
        This data is critical for perpetual futures traders to assess the carrying cost
        of positions and identify potential funding arbitrage opportunities.
    
        Example use cases:
        - Finding markets with negative funding for "paid to hold" opportunities
        - Calculating the funding component of a trade's P&L
        - Comparing funding rates across different assets for relative value trades
        - Analyzing funding rate volatility to predict potential rate changes
        """
        try:
            # Get funding data from Paradex
            client = await get_paradex_client()
            response = client.fetch_funding_data(
                params={"market": market_id, "start_at": start_unix_ms, "end_at": end_unix_ms}
            )
            if "error" in response:
                await ctx.error(response)
                raise Exception(response["error"])
            funding_data = funding_data_adapter.validate_python(response["results"])
            results = {
                "description": FundingData.__doc__.strip() if FundingData.__doc__ else None,
                "fields": FundingData.model_json_schema(),
                "results": funding_data,
            }
            return results
        except Exception as e:
            await ctx.error(f"Error fetching funding data for {market_id}: {e!s}")
            raise e
  • Pydantic BaseModel defining the structure and fields for FundingData used in the tool's output validation and schema description.
    class FundingData(BaseModel):
        """
        Model representing funding data for a perpetual market.
        https://docs.paradex.trade/documentation/risk-system/funding-mechanism
        """
    
        market: Annotated[str, Field(description="Market represents the market identifier")]
        created_at: Annotated[
            int, Field(description="Timestamp in milliseconds when the funding data was calculated")
        ]
        funding_index: Annotated[
            str,
            Field(
                description="Funding Index is accrued funding for 1 unit of the asset since market launchs and is calculated as a time-weighted sum of the Funding Premium. This value expressed in the settlement asset of the instrument (USDC)"
            ),
        ]
        funding_premium: Annotated[
            str,
            Field(
                description="Funding Premium represents the 8h amount paid by long positions to short positions. This value expressed in the settlement asset of the instrument (USDC)"
            ),
        ]
        funding_rate: Annotated[
            str,
            Field(
                description="Clamped [mark price]/[spot price] - 1. Full details - https://docs.paradex.trade/documentation/risk-system/funding-mechanism#funding-rate"
            ),
        ]
  • The @server.tool decorator that registers the paradex_funding_data tool with the MCP server.
    @server.tool(name="paradex_funding_data")
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses behavioral traits such as the tool's focus on analysis for traders, its critical role in assessing carrying costs and arbitrage, and example use cases like finding negative funding rates. However, it lacks details on rate limits, authentication needs, data freshness, or error handling, which are important for a data analysis tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose, followed by usage guidelines, context, and examples. It uses bullet points for clarity and avoids redundancy. However, it could be slightly more concise by integrating some explanatory sentences, but overall, each section adds value without unnecessary verbosity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (funding rate analysis for trading), no annotations, and an output schema (which handles return values), the description is fairly complete. It covers purpose, usage scenarios, and examples, but lacks behavioral details like data sources or limitations. With output schema reducing the need to explain returns, the description provides adequate context for an agent to understand when and why to use the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents all three parameters (market_id, start_unix_ms, end_unix_ms). The description does not add any parameter-specific semantics beyond what the schema provides, such as format examples or constraints. With high schema coverage, the baseline score is 3, as the description relies on the schema for parameter details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Analyze funding rates for potential funding arbitrage or to understand holding costs.' It specifies the verb ('analyze') and resource ('funding rates'), distinguishing it from siblings like paradex_account_funding_payments (which likely lists payments) or paradex_market_summaries (which may include broader market data). The focus on analysis for arbitrage and cost assessment is specific and actionable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidelines with a bulleted list of scenarios: 'Use this tool when you need to: - Calculate expected funding payments for a position - Find markets with extreme funding rates for potential arbitrage - Understand historical funding patterns for a market - Evaluate the cost of holding a position over time.' This clearly defines when to use it, and the context signals (e.g., sibling tools) suggest alternatives like paradex_account_funding_payments for payment details, though not explicitly named.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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