---
title: "Create Reg-T simulation"
method: POST
path: "/entities/{entity_id}/regt-margin-simulations"
tags: ["Margin Simulations"]
---

# Create Reg-T simulation

`POST /entities/{entity_id}/regt-margin-simulations`

Simulate Reg-T margin calculation for a given hypothetical set of prices and/or trades. This is useful for understanding the impact of price fluctuations or trades on margin requirements. Once a simulation is created, it remains available for 48-hours, after which it will automatically be deleted.

Simulations created through the API are visible in the Studio UI under the Risk & Margin section, after enabling the "Risk Simulations" toggle.

## Path parameters

- `entity_id` string, required — Entity ID for the legal entity.

## Request body

- object
  - `name` string, required — Name of a simulation.
  - `prices` SimulationPrice[] — List of prices to use in the simulation, i.e. fair-market-values you specify for each symbol. If this is not provided, current market prices will be used, if they are available.
    - `symbol` string, required
    - `symbol_format` 'cms' | 'osi' — Denotes the format of the provided `symbol` field.
    - `price` string, required — String representation of a price.
  - `trades` SimulationTrade[] — List of hypothetical trades to include in the simulation, if any.
    - `symbol` string, required
    - `symbol_format` 'cms' | 'osi' — Denotes the format of the provided `symbol` field.
    - `side` 'buy' | 'sell', required — Either buy or sell side.
    - `quantity` string, required — String representation of quantity.
    - `price` string, required — String representation of a price.
  - `ignore_existing` boolean — If true, the simulation will ignore any existing positions and balances in the account. Set to true if you want to simulate from a clean slate, i.e. an empty account.

## Response `200`

Reg-T margin simulation

- object
  - `simulation_id` string, uuid, required — Unique ID for a simulation.

## Other responses

- `default` — Error response

---

[API](https://skmtc.net/clear-street/apis/common-api-models.md) · [All operations](https://skmtc.net/clear-street/apis/common-api-models/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/clear-street/common-api-models/versions/05b4df42c056/schema)
