# activeAssetData

## POST Request

<table><thead><tr><th width="115.50848388671875">Field</th><th width="177.66351318359375">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td>string</td><td>Must be <code>"activeAssetData"</code></td></tr><tr><td><code>user</code></td><td>string</td><td>Ethereum address (0x-prefixed, 42 characters)</td></tr><tr><td><code>coin</code></td><td>string</td><td>symbol e.g. "BTC"</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": "activeAssetData",
    "user": "0x0000000000000000000000000000000000000000",
    "coin": "BTC"
  }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import os

response = requests.post(
    'https://api.hydromancer.xyz/info',
    json={
        'type': 'activeAssetData',
        'user': '0x0000000000000000000000000000000000000000',
        'coin': 'BTC'
    },
    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: 'activeAssetData',
        user: '0x0000000000000000000000000000000000000000',
        coin: 'BTC'
    }, {
        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                               |
| ------------------ | -------------- | ----------------------------------------- |
| `user`             | string         | User address                              |
| `coin`             | string         | Coin symbol                               |
| `leverage.type`    | string         | Leverage type (`"cross"` or `"isolated"`) |
| `leverage.value`   | int            | Leverage value                            |
| `leverage.rawUsd`  | string \| null | Raw USD margin (only present if isolated) |
| `maxTradeSzs`      | array          | Maximum trade sizes `[long, short]`       |
| `availableToTrade` | array          | Available to trade `[long, short]`        |
| `markPx`           | string         | Current mark price                        |

<details>

<summary>Response</summary>

```json
{
  "user": "0x0000000000000000000000000000000000000000",
  "coin": "BTC",
  "leverage": {
    "type": "cross", // "cross" or "isolated"
    "value": 5,
    "rawUsd": null // Only present if isolated
  },
  "maxTradeSzs": ["100000.00", "100000.00"],
  "availableToTrade": ["50000.00", "50000.00"],
  "markPx": "45000.00"
}
```

</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/user-position-data/activeassetdata.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.
