Reference
Balance Consistency Rules
Balance Consistency Rules
Pre‑check: TS calls getbalance before attempting opentrade.
Hold on open: You must reduce available funds / place a hold by amount.
Settle on close: Add amount back if win/tie (per convention) and release the hold. For loss, release hold without crediting.
Atomicity: opentrade and closetrade must be atomic on your side; protect against retries (idempotency) to avoid double processing.