Risk
Halt trading
The kill switch. Refuses new orders from this moment and deals with the resting ones by policy.
POST/haltself-hosted · access token · trade
Self-hosted. Served by synpath serve on your own machine or host, which must be running; the engine and its order types live there. Nothing on this page runs on Synpath's servers.
cancel calls each venue's cancel-all, reads the book back and cancels anything still resting one by one. hold leaves resting orders and refuses new ones. rearm refuses, then lifts itself after rearm_after_s.
Request body
| Name | Type | Description |
|---|---|---|
reason | string | Recorded in the journal and the halt event. |
policy | stringdefault cancel | cancel, hold or rearm. |
scope | stringdefault * | A venue id, or * for everything. |
rearm_after_s | number | With rearm. |
Response
What was cancelled, per venue, and what still rests.
import os
import httpx
TOKEN = os.environ["SYNPATH_ACCESS_TOKEN"]
r = httpx.post("http://127.0.0.1:8000/trading/halt", headers={"Authorization": f"Bearer {TOKEN}"}, json={"reason":"manual","policy":"cancel","scope":"*"})
r.raise_for_status()
print(r.json())200
{
"reason": "manual",
"policy": "cancel",
"scope": "*",
"canceled": {
"kalshi": 3
},
"remaining": {},
"managed": 1
}
