Documentation Index
Fetch the complete documentation index at: https://docs.generalmarket.io/llms.txt
Use this file to discover all available pages before exploring further.
Ticks & Backtesting
The past, dissected. Query historical tick results, view revealed bitmaps after a tick closes, and backtest strategies against simulated outcomes. History does not repeat — but it does rhyme, and the rhyme is sometimes worth money.Get Tick History
GET /vision/batch/{id}/history
Returns the most recent tick results for a batch (up to 100). Each entry: the outcomes, the participants, the volume matched. A ledger of settled arguments.
The batch ID to fetch tick history for.
- cURL
- Python
- TypeScript
Response Fields
| Field | Type | Description |
|---|---|---|
batch_id | number | The batch ID |
tick_id | number | Sequential tick number within the batch |
resolved_at | string | null | ISO 8601 timestamp when the tick was resolved |
player_count | number | null | Number of players who participated in this tick |
total_matched | string | null | Total volume matched between winners and losers, in wei |
results_json | object | null | Detailed per-market results including outcomes and percentage changes |
Errors
| Status | Condition |
|---|---|
500 | Database query failure |
Get Revealed Bitmaps
GET /vision/reveal/{batch_id}/{tick_id}
Returns all player bitmaps for a completed tick. Bitmaps are only available after the reveal window has expired — the sealed opinions of others, visible only after it is too late to act on them.
The batch ID to query reveals for.
The tick number to fetch revealed bitmaps for. Must be a completed tick past the reveal window.
- cURL
- Python
- TypeScript
Response Fields
| Field | Type | Description |
|---|---|---|
batch_id | number | The batch ID |
tick_id | number | The tick number |
bitmaps | object[] | Array of revealed player bitmaps |
bitmaps[].player | string | Player’s Ethereum address |
bitmaps[].bitmap_hex | string | The raw bitmap as a hex string |
bitmaps[].hash | string | The keccak256 hash of the bitmap (matches on-chain commitment) |
Errors
| Status | Condition |
|---|---|
403 | The reveal window has not yet expired for this tick. The error message includes the deadline timestamp. |
404 | Batch does not exist |
Backtest a Strategy
POST /vision/backtest
Simulate a bitmap strategy against deterministic pseudo-random outcomes. Test your theory before paying for it.
The backtest engine uses a deterministic PRNG seeded from market IDs and tick numbers, producing a consistent 50/50 base distribution. A controlled hallucination of the past.
The batch ID to simulate against. The batch must exist so the engine knows which markets to simulate.
The prediction bitmap to test, as a hex string with
0x prefix. Each bit represents UP (1) or DOWN (0) for the corresponding market.Optional Python strategy code. This field is accepted but currently ignored server-side — strategy code is executed client-side via Pyodide. Reserved for future server-side execution.
Number of ticks to simulate. Defaults to
50, maximum 200.- cURL
- Python
- TypeScript
Response Fields
| Field | Type | Description |
|---|---|---|
win_rate | number | Fraction of individual market bets that were correct (0.0 to 1.0), rounded to 4 decimal places |
pnl_curve | object[] | Cumulative PnL at each tick |
pnl_curve[].tick | number | Tick number in the simulation |
pnl_curve[].pnl | number | Cumulative PnL at this tick, normalized to a +/-1 range per tick |
total_pnl | number | Final cumulative PnL after all simulated ticks |
Errors
| Status | Condition |
|---|---|
400 | Missing bitmap_hex field |
400 | Invalid hex encoding in bitmap_hex |
400 | Batch has no markets configured |
404 | Batch does not exist |
The backtest is deterministic — same inputs, same outputs, always. Useful for comparing strategies against each other. Useless for predicting the future — but then, what isn’t.