# delegatorHistory

Returns a user's staking event history, mirroring Hyperliquid's `delegatorHistory` endpoint format. Includes delegation, deposit, and withdrawal events.

**Data availability:** Events from **2025-07-27** onwards.

## POST Request

<table><thead><tr><th width="161.9998779296875">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>"delegatorHistory"</code></td></tr><tr><td><code>user</code></td><td>string</td><td>Ethereum address (0x-prefixed, 42 characters)</td></tr><tr><td><code>limit</code></td><td>number</td><td>(Optional) Max results to return. Default 500, max 2000.</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": "delegatorHistory",
    "user": "0x5aeb1821f596d2d9ffe182d3f914b274a80511cc"
  }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import os

response = requests.post(
    'https://api.hydromancer.xyz/info',
    json={
        'type': 'delegatorHistory',
        'user': '0x5aeb1821f596d2d9ffe182d3f914b274a80511cc'
    },
    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: 'delegatorHistory',
        user: '0x5aeb1821f596d2d9ffe182d3f914b274a80511cc'
    }, {
        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

Returns an array of staking events, sorted by time descending (most recent first). Each event has a `delta` object whose key indicates the event type.

### Delta types

#### `delegate` — Delegation or undelegation

| Field          | Type    | Description                                   |
| -------------- | ------- | --------------------------------------------- |
| `validator`    | string  | Validator address                             |
| `amount`       | string  | Amount delegated/undelegated (decimal string) |
| `isUndelegate` | boolean | `true` if undelegating, `false` if delegating |

#### `cDeposit` — Staking deposit

| Field    | Type   | Description                       |
| -------- | ------ | --------------------------------- |
| `amount` | string | Amount deposited (decimal string) |

#### `withdrawal` — Staking withdrawal

| Field    | Type   | Description                       |
| -------- | ------ | --------------------------------- |
| `amount` | string | Amount withdrawn (decimal string) |
| `phase`  | string | `"initiated"` or `"finalized"`    |

### Common fields

| Field   | Type   | Description                                 |
| ------- | ------ | ------------------------------------------- |
| `time`  | number | Event timestamp in milliseconds             |
| `hash`  | string | Transaction hash                            |
| `delta` | object | Event-specific data (see delta types above) |

<details>

<summary>Response</summary>

```json
[
    {
        "time": 1744312029183,
        "hash": "0xbe9abb84c0864034c0140438d84d29020193006a5b895f06626366d77f8a1a1f",
        "delta": {
            "delegate": {
                "validator": "0xa82fe73bbd768bc15d1ef2f6142a21ff8bd762ad",
                "amount": "87287.26",
                "isUndelegate": true
            }
        }
    },
    {
        "time": 1744312029183,
        "hash": "0xeaa8034e7059d23aec210438d881700202f500340b5cf10c8e70aea12f5dac25",
        "delta": {
            "withdrawal": {
                "amount": "351237.19",
                "phase": "initiated"
            }
        }
    }
]
```

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hydromancer.xyz/readme/rest-api/delegations/delegatorhistory.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
