v22

latestOpenAPI 3.0.0raw.githubusercontent.com2026-03-03327794.1 KB
Margin Simulations

Create Reg-T simulation

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.

post/entities/{entity_id}/regt-margin-simulations

Path parameters

entity_idstring required

Entity ID for the legal entity.

Example:100000

Entity ID

Request body

namestring required

Name of a simulation.

ignore_existingboolean

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.

Example request

{
  "prices": [
    {
      "symbol": "AAPL",
      "price": "123.99"
    }
  ],
  "trades": [
    {
      "symbol": "AAPL",
      "quantity": "100",
      "price": "123.99"
    }
  ]
}

Response

Reg-T margin simulation

simulation_idstring uuid required

Unique ID for a simulation.

Example response

{
  "simulation_id": "6460030d-8ed4-19d3-818e-e87b36e90005"
}