paradex_funding_data
Analyze perpetual futures funding rates to calculate holding costs, identify arbitrage opportunities, and understand historical funding patterns for informed 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
| Name | Required | Description | Default |
|---|---|---|---|
| market_id | Yes | Market symbol to get funding data for. | |
| start_unix_ms | Yes | Start time in unix milliseconds. | |
| end_unix_ms | Yes | End time in unix milliseconds. |
Implementation Reference
- src/mcp_paradex/tools/market.py:257-300 (handler)The main handler function for the 'paradex_funding_data' tool, decorated with @server.tool for registration. It fetches funding data from Paradex client using the provided market_id and time range, validates with FundingData model, and returns structured results including 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