> For the complete documentation index, see [llms.txt](https://docs.hydromancer.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hydromancer.xyz/readme/rest-api/user-order-data/frontendopenorders.md).

# frontendOpenOrders

Returns open orders for a user with additional frontend display information such as order type and trigger details.

<table><thead><tr><th width="115">Field</th><th width="177">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td>string</td><td>Must be <code>"frontendOpenOrders"</code></td></tr><tr><td><code>user</code></td><td>string</td><td>Ethereum address (0x-prefixed, 42 characters)</td></tr><tr><td><code>dex</code></td><td>string</td><td>Perp DEX name (optional). Defaults to empty string for first perp DEX. Spot open orders are only included with the first perp DEX.</td></tr></tbody></table>

## Request

{% 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": "frontendOpenOrders",
    "user": "0x0000000000000000000000000000000000000000"
  }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import os
import json

response = requests.post(
    'https://api.hydromancer.xyz/info',
    json={
        'type': 'frontendOpenOrders',
        'user': '0x0000000000000000000000000000000000000000'
    },
    headers={
        'Authorization': f'Bearer {os.environ["HYDROMANCER_API_KEY"]}',
        'Content-Type': 'application/json'
    }
)
print(json.dumps(response.json(), indent=2))
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
import axios from 'axios';

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

console.log(JSON.stringify(response.data, null, 2));
```

{% endtab %}
{% endtabs %}

***

## Response Fields

| Field              | Type    | Description                                                                                                 |
| ------------------ | ------- | ----------------------------------------------------------------------------------------------------------- |
| `coin`             | string  | Asset symbol                                                                                                |
| `isPositionTpsl`   | boolean | Whether this is a position TP/SL order                                                                      |
| `isTrigger`        | boolean | Whether this is a trigger order                                                                             |
| `limitPx`          | string  | Limit price                                                                                                 |
| `oid`              | int     | Order ID                                                                                                    |
| `orderType`        | string  | Order type (e.g. `"Limit"`, `"Stop Market"`, `"Stop Limit"`, `"Take Profit Market"`, `"Take Profit Limit"`) |
| `origSz`           | string  | Original order size                                                                                         |
| `reduceOnly`       | boolean | Whether this is a reduce-only order                                                                         |
| `side`             | string  | `"A"` (sell) or `"B"` (buy)                                                                                 |
| `sz`               | string  | Remaining order size                                                                                        |
| `timestamp`        | int     | Order creation timestamp (ms)                                                                               |
| `triggerCondition` | string  | Trigger condition (e.g. `"N/A"`, `"tp"`, `"sl"`)                                                            |
| `triggerPx`        | string  | Trigger price for stop/take-profit orders                                                                   |

<details>

<summary>Response</summary>

```json
[
  {
    "coin": "BTC",
    "isPositionTpsl": false,
    "isTrigger": false,
    "limitPx": "29792.0",
    "oid": 91490942,
    "orderType": "Limit",
    "origSz": "5.0",
    "reduceOnly": false,
    "side": "A",
    "sz": "5.0",
    "timestamp": 1681247412573,
    "triggerCondition": "N/A",
    "triggerPx": "0.0"
  }
]
```

</details>
