---
title: "Admin Simulate"
method: POST
path: "/api/tradeworkz/admin/simulate"
tags: ["TradeWorkz"]
---

# Admin Simulate

`POST /api/tradeworkz/admin/simulate`

## Request

- Base URL: `https://api.zerogex.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.zerogex.io/api/tradeworkz/admin/simulate`
- Auth: HTTP bearer

Seed the tw_ tables with deterministic synthetic trade history.

Fully wipes any existing trades / equity / metrics / ml_state per bot
before inserting, so the endpoint is idempotent — re-running with the
same body converges to the same fleet state. Uses the synchronous
psycopg2 pool via ``src.database.db_connection`` because the simulator
does many small inserts and pipelining them through asyncpg would add
complexity for no throughput gain here.

Body (all optional):
    days: how many trading days of history to synthesize (default 60,
          min 1, max 365)
    seed: master RNG seed for reproducibility (default 42)
    scale: PnL magnitude multiplier (default 1.0)
    bot_ids: subset to simulate; default = every enabled bot

## Request body

- object

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/zerogex/apis/zerogex-api.md) · [All operations](https://skmtc.dev/zerogex/apis/zerogex-api/llms.txt) · [OpenAPI document](https://skmtc.dev/zerogex/apis/zerogex-api/revisions/753b26bf0592?raw)
