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

# Loss floors and risk limits

> Read where an account fails, where its trading day ends and where it reaches its profit target, as balances, from the same check that enforces them.

Each trading account's rules (max loss, drawdown, daily loss, profit target)
come down to a few balances. Hyperprop reports them as `riskLimits`, so you can
show a trader exactly where the account stands without re-implementing the
rules:

* **`maxLossFloor`**: the balance at which the account fails.
* **`dailyLossFloor`**: the balance at which the trading day ends.
* **`profitTarget`**: the balance at which the profit target is reached.

The values come from the same rule check that fails the account or ends its
trading day, so they always match what Hyperprop enforces, including trailing
drawdowns, trail ceilings, floors locked at a payout and a switched-off daily
loss limit.

## Where to read them

| Where | How |
| - | - |
| `GET /platform/v1/organization/trading-accounts/{accountId}/equity` | Always included as `riskLimits` |
| `GET /platform/v1/organization/trading-accounts/positions` | Always included as `riskLimits` on each account |
| `GET /platform/v1/organization/trading-accounts/{accountId}` | Add `?include=floors`. Without it the response is unchanged |
| Real-time trading stream | Connect with `?floors=1` for `RiskLimitsUpdate` messages. See [Real-time trading stream](https://docs.hyperprop.com/guides/realtime-trading-stream.md#risklimitsupdate) |

All of them need **view** permission on traders.

```bash theme={null}
curl "https://api.hyperprop.com/platform/v1/organization/trading-accounts/7c9e6679-7425-40de-944b-e07fc1f90ae7/equity" \
  -H "X-API-Key: hp_live_your_key_here"
```

```json theme={null}
{
  "success": true,
  "data": {
    "accountId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "currentBalance": 50300,
    "unrealizedPnl": 40,
    "equity": 50340,
    "initialBalance": 50000,
    "highWaterMark": 50500,
    "dailyStartingBalance": 50100,
    "riskLimits": {
      "maxLossFloor": 48500,
      "maxLossFloorType": "trailing",
      "trailingLocked": false,
      "dailyLossFloor": 49100,
      "dailyLossLimitActive": true,
      "dailyLossLimitOff": false,
      "profitTarget": 53000,
      "estimatedClosingFees": 1.24,
      "distanceToMaxLoss": 1838.76,
      "distanceToDailyLoss": 1238.76
    }
  }
}
```

## Fields

| Field | Meaning |
| - | - |
| `maxLossFloor` | Balance at which the account fails. The highest of: a floor locked at a payout, `initialBalance − maxLoss`, and the drawdown floor. Null when the rule has no max loss or drawdown limit |
| `maxLossFloorType` | Which limit sets `maxLossFloor`: `static`, `trailing`, `eod` or `locked` (see below). Null with `maxLossFloor` |
| `trailingLocked` | `true` when the floor no longer moves up: a trailing or end-of-day floor that reached its trail ceiling, or a floor locked at a payout |
| `dailyLossFloor` | Balance at which the trading day ends. The higher of `dailyStartingBalance − dailyLoss` and a daily percentage drawdown floor. Null when the rule has no daily loss limit or it is switched off |
| `dailyLossLimitActive` | `true` when a daily loss limit applies today (`dailyLossFloor` is set) |
| `dailyLossLimitOff` | `true` when the account's daily loss limit has been [switched off](https://docs.hyperprop.com/guides/daily-loss-limit-switch-off.md) |
| `profitTarget` | Balance at which the profit target is reached: `initialBalance + profitTarget`. Null when the rule has none, and for funded accounts |
| `estimatedClosingFees` | Commissions and fees that closing every open position now would cost |
| `distanceToMaxLoss` | `equity − estimatedClosingFees − maxLossFloor`: how far equity can fall before the account fails |
| `distanceToDailyLoss` | `equity − estimatedClosingFees − dailyLossFloor`: how far equity can fall before the trading day ends |

`riskLimits` is null when Hyperprop has no live limits for the account, for
example one that is no longer active. On the account read with
`include=floors` it is also null if the live values cannot be read at that
moment; the rest of the account is returned as usual.

## Floor types

| `maxLossFloorType` | The floor is | Moves |
| - | - | - |
| `static` | `initialBalance` minus the max loss or a static drawdown | Never |
| `trailing` | The highest equity reached (open profit included) minus the drawdown | Up, with every new equity peak, until the trail ceiling |
| `eod` | The highest end-of-day balance minus the drawdown | Up, at the daily reset, until the trail ceiling |
| `locked` | The floor locked when a payout was processed | Never |

A drawdown set in percent is applied to the same reference (initial balance,
peak equity or highest end-of-day balance). When the rule has a trail ceiling,
a trailing or end-of-day floor stops at `initialBalance + ceiling` and
`trailingLocked` becomes `true`.

### Examples

For a 50,000 account:

| Rule | Situation | `maxLossFloor` | Type | `trailingLocked` |
| - | - | - | - | - |
| Max loss 2,000 | Any | 48,000 | `static` | `false` |
| Trailing drawdown 2,000 | Peak equity 51,600 | 49,600 | `trailing` | `false` |
| Trailing drawdown 2,000, trail ceiling 100 | Peak equity 52,500 | 50,100 | `trailing` | `true` |
| End-of-day drawdown 2,000 | Best end-of-day balance 50,800 | 48,800 | `eod` | `false` |
| Any, after a payout locked the floor at 50,100 | Floor above the others | 50,100 | `locked` | `true` |

With a day starting at 50,100 and a daily loss limit of 1,000,
`dailyLossFloor` is 49,100. Once the daily loss limit is switched off,
`dailyLossFloor` is null, `dailyLossLimitActive` is `false` and
`dailyLossLimitOff` is `true`.

## When a floor is reached

Limits are judged on equity after the estimated closing fees, so
`distanceToMaxLoss` and `distanceToDailyLoss` already include them:

* **`maxLossFloor`**: the account fails when `distanceToMaxLoss` reaches 0
  (for a drawdown limit, once it is below 0). Open positions are closed.
* **`dailyLossFloor`**: when `distanceToDailyLoss` reaches 0, open positions are
  closed and trading stops until the next daily reset. The account does not
  fail.
* **`profitTarget`**: reached when equity after the estimated closing fees is
  at or above it. Passing can also depend on other rules of the account, such
  as consistency.

Equity moves with every price change, so a distance read over REST is a
snapshot. For a live view, combine `RiskLimitsUpdate` (the floors) with
`AccountUpdate` (equity) on the stream.


## Related topics

- [Real-time trading stream](https://docs.hyperprop.com/guides/realtime-trading-stream.md)
- [Get an account's equity and unrealized P&L](https://docs.hyperprop.com/platform-api/trading-accounts/get-an-accounts-equity-and-unrealized-p&l.md)
- [Get a specific trading account](https://docs.hyperprop.com/platform-api/trading-accounts/get-a-specific-trading-account.md)
- [Get open positions and equity for many accounts](https://docs.hyperprop.com/platform-api/trading-accounts/get-open-positions-and-equity-for-many-accounts.md)
- [Update personal risk settings.](https://docs.hyperprop.com/trade-api/risk/update-personal-risk-settings.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.