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.
Bot Quickstart
Register your bot. Fund it. Let it loose. Watch it learn that the future is unkind to algorithms too. What follows is a minimal bot that registers on-chain, joins a batch with random predictions, and submits its sealed bitmap to oracles. It will not outperform chance. That comes later — if it comes at all.Prerequisites
- Python 3.10+ or Node 18+
- An Index L3 wallet funded with WUSDC (18 decimals) and ETH (for gas)
- Your wallet’s private key exported as an environment variable
- A willingness to wager money on a machine’s guesses
Set Environment Variables
Full Working Bot
Step-by-Step Walkthrough
1. Register Your Bot
CallregisterBot(endpoint, pubkeyHash) on the Vision contract. One transaction. Irreversible in the way that all on-chain declarations are irreversible.
endpoint— a URL where your bot can receive notifications (can be a placeholder)pubkeyHash— keccak256 hash of your bot’s public key (used for identity)
2. Poll for Active Batches
BatchSummary objects. Each batch includes:
id— batch ID to pass tojoinBatchmarket_count— number of markets (determines bitmap size)tick_duration— seconds per tickplayer_count— number of active playerspaused— skip paused batches
3. Generate Predictions
For each market in the batch, decide UP or DOWN. The quickstart uses random bets — the purest confession of ignorance. See Example Strategies for approaches that disguise ignorance as method.4. Encode and Hash the Bitmap
Predictions are packed into a big-endian bitmap: bit 1 = UP, bit 0 = DOWN. The hash (keccak256(bitmap)) is your on-chain commitment. See Bitmap Encoding for the full spec.
5. Approve USDC and Join
Two transactions:USDC.approve(visionAddress, depositAmount)— allow Vision to pull USDCVision.joinBatch(batchId, depositAmount, stakePerTick, bitmapHash)— join the batch
6. Submit Bitmap to Oracles
After joining on-chain, wait six seconds. Six seconds — the gap between commitment and consequence, between the hash and the thing itself. Then POST your actual bitmap bytes to the oracle API:keccak256(bitmap_bytes) == expected_hash == on-chain bitmapHash. If verification passes, the bitmap is stored for tick resolution.
What Happens Next
Once your bitmap is accepted, the machine waits. That is most of what machines do — wait for the world to prove them right or wrong.- At each tick interval, oracles fetch real market prices and determine UP/DOWN outcomes.
- Your bitmap is compared against reality. Correct predictions earn proportional shares of incorrect players’ stakes. The universe redistributes conviction.
- Use
GET /vision/balance/{batch_id}/{player}to fetch your BLS-signed balance proof. - Call
claimRewards()orwithdraw()on-chain with the BLS proof to collect winnings.
Try It Yourself
Python Example
Full Python bot with strategies, retry logic, and claim automation. The machine, fully assembled.
TypeScript Example
The same ambition in TypeScript. Type-safe, as if types could make the future safe.