> ## Documentation Index
> Fetch the complete documentation index at: https://docs.b3os.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Hyperliquid Stop Loss

Place a stop-loss trigger order on Hyperliquid perpetual DEX. Automatically detects position direction and places a reduce-only market trigger order at the specified price. When the mark price reaches the trigger price, a market order executes to close the position. Ideal for: risk management, capital preservation, and automated loss limits.

![Hyperliquid Stop Loss logo](https://cdn.b3.fun/hyperliquid-logo.png)
Catalog action Hyperliquid wallet

Place a stop-loss trigger order on Hyperliquid perpetual DEX. Automatically detects position direction and places a reduce-only market trigger order at the specified price. When the mark price reaches the trigger price, a market order executes to close the position. Ideal for: risk management, capital preservation, and automated loss limits.

**Review wallet and value movement**

This action can require a wallet connector, gas, token movement, or an external side effect. Test with simulation or a controlled amount before using it in a live workflow.

## At a Glance

| Field | Value |
| --- | --- |
| Action ID | `hyperliquid-stop-loss` |
| Category | Hyperliquid |
| Connector | `wallet` |
| Requires gas | No |
| Funds movement | None declared |
| Tags | `hyperliquid`, `perps`, `order`, `trade`, `trading` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `dex` | `string` | No | HIP-3 DEX name for TradFi markets. Omit for standard crypto perps. xyz = trade.xyz \(stocks, indices, commodities\), flx = flx.finance, vntl = vntl.exchange |
| `coin` | `string` | Yes | Asset symbol \(e.g., BTC, ETH for crypto; TSLA, SP500 for HIP-3 DEX markets\) |
| `triggerPrice` | `string` | Yes | Price at which to trigger the stop-loss order. For long positions this should be below the entry price; for short positions above. |
| `size` | `string \| number` | No | Position size to close in asset units \(e.g., '0.1' for 0.1 BTC\). Defaults to full position size if omitted. |
| `reduceOnly` | `boolean` | No | If true, order can only reduce an existing position \(default: true\) |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | `string` | Yes | Order outcome: resting \(trigger order placed on book, waiting for trigger price\) |
| `oid` | `number` | No | Hyperliquid order ID |
| `coin` | `string` | No | Asset symbol |
| `side` | `string` | No | Order side \(buy to close short, sell to close long\) |
| `triggerPrice` | `string` | No | Trigger price set for the order |
| `requestedSize` | `string` | No | Size of the stop-loss order |
| `positionSide` | `string` | No | Detected position side \(long or short\) |
| `cloid` | `string` | No | Client order id attached to this order \(0x + 32 hex\). Use to cancel or reconcile. |

## Examples

**Workflow node**

```json
{
  "type": "hyperliquid-stop-loss",
  "payload": {
    "coin": "example-coin",
    "triggerPrice": "example-triggerPrice"
  },
  "children": [],
  "connector": {
    "type": "wallet",
    "id": "conn_wallet"
  }
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/hyperliquid-stop-loss/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "coin": "example-coin",
    "triggerPrice": "example-triggerPrice"
  }
}'
```

**Use expressions for dynamic values**

Payload fields can use workflow expressions such as `{{$trigger.body.amount}}`, `{{$nodes.fetch.result.price}}`, and `{{$props.asset}}` when the value should come from a trigger, prior node, or reusable workflow prop.