get_funding_rate_history
Retrieve historical funding rate data for Binance perpetual contracts to analyze market trends and manage trading positions effectively.
Instructions
Get funding rate history.
Args: symbol: Perpetual contract symbol. limit: Number of records to return (default 100).
Returns: Funding rate data list.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | ||
| limit | No |
Implementation Reference
- binance.py:205-223 (handler)The main handler function for the 'get_funding_rate_history' tool. It is registered via the @mcp.tool() decorator. This function queries the Binance Futures API for historical funding rates of a given symbol and limit, returning the JSON data or an error.@mcp.tool() def get_funding_rate_history(symbol: str, limit: int = 100) -> Any: """ Get funding rate history. Args: symbol: Perpetual contract symbol. limit: Number of records to return (default 100). Returns: Funding rate data list. """ url = "https://fapi.binance.com/fapi/v1/fundingRate" params = {"symbol": symbol, "limit": limit} response = requests.get(url, params=params) if response.status_code == 200: return response.json() return {"error": response.text}