> For the complete documentation index, see [llms.txt](https://hydromancer.xyz/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hydromancer.xyz/docs/rest-api/historical-data/fundinghistory.md). Agents can also search and read this documentation through its [MCP server](https://hydromancer.xyz/docs/~gitbook/mcp).

# fundingHistory

Get the Hyperliquid funding history for a coin.

{% hint style="info" %}
**Data available from 28-07-2025**
{% endhint %}

## POST Request

<table><thead><tr><th width="107.333251953125">Field</th><th width="119">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td>string</td><td>Must be <code>"fundingHistory"</code></td></tr><tr><td><code>coin</code></td><td>string</td><td>i.e. "BTC", "ETH"</td></tr><tr><td><code>startTime</code></td><td>int</td><td>Start time in ms (inclusive)</td></tr><tr><td><code>endTime</code></td><td>int</td><td>End time in ms (optional)</td></tr><tr><td><code>limit</code></td><td>int</td><td>Max results to return, default and max 500 (optional)</td></tr></tbody></table>

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST https://api.hydromancer.xyz/info \
  -H "Authorization: Bearer $HYDROMANCER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "fundingHistory",
    "coin": "BTC",
    "startTime": 0
  }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import os

response = requests.post(
    'https://api.hydromancer.xyz/info',
    json={
        'type': 'fundingHistory',
        'coin': 'BTC',
        'startTime': 0
    },
    headers={
        'Authorization': f'Bearer {os.environ.get("HYDROMANCER_API_KEY")}',
        'Content-Type': 'application/json'
    }
)

print(response.json())
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
import axios from 'axios';

try {
    const response = await axios.post('https://api.hydromancer.xyz/info', {
        type: 'fundingHistory',
        coin: 'BTC',
        startTime: 0
    }, {
        headers: {
            'Authorization': `Bearer ${process.env.HYDROMANCER_API_KEY}`,
            'Content-Type': 'application/json'
        }
    });

    console.log(response.data);
} catch (error) {
    console.error('Error:', error.message);
}
```

{% endtab %}
{% endtabs %}

***

## Response Fields

| Field         | Type   | Description                 |
| ------------- | ------ | --------------------------- |
| `coin`        | string | Asset symbol                |
| `fundingRate` | string | Funding rate for the period |
| `time`        | int    | Timestamp (ms)              |

<details>

<summary>Response</summary>

```json
[
    {
        "coin": "BTC",
        "fundingRate": "0.0000125",
        "time": 1762398000007
    },
    {
        "coin": "BTC",
        "fundingRate": "0.0000125",
        "time": 1762401600087
    }
]
```

</details>

## Structured errors

Send `X-HM-Error-Format: structured-v1` to select errors with `error`, `code`, and `correlationId`. Applied responses echo the selector. Missing echo is unconfirmed and must not trigger replay. Only fundingHistory and POST /auth/token support this format initially. Other legacy modes return 406 after authentication and permission, before admission, with configured billing. Funding history keeps potentially incomplete 200 results after cache failure. Required ClickHouse failure is selected 503/unavailable and legacy 500. Hydromancer omits Hyperliquid's premium field. The SDK's `RestClient.call_structured` returns validated data with raw response evidence; explicit downgrade accepts only the response already received.
