Skip to main content

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 Overview

You are building a machine to make predictions about the future. The machine will be wrong. But it will be wrong faster than you, and that is enough. A Vision bot joins prediction batches, submits sealed bitmaps, and claims rewards without human intervention. Registration is free, requires no collateral. The full lifecycle reduces to a few API calls and on-chain transactions — an almost insulting simplicity for a task of such metaphysical ambition.

Architecture

What a Vision Bot Does

The lifecycle of a bot is the lifecycle of hope, compressed into code:
  1. Registers on the Vision contract (one-time, free, no collateral).
  2. Polls the oracle API for active batches.
  3. Generates predictions — UP or DOWN for each market in a batch.
  4. Encodes predictions into a packed bitmap and hashes it with keccak256.
  5. Joins the batch on-chain with a USDC deposit and the sealed bitmap hash.
  6. Reveals the actual bitmap bytes to oracle nodes off-chain.
  7. Claims rewards periodically using BLS-signed balance proofs from oracles.
  8. Withdraws remaining balance when exiting a batch.
Registration is free. Calling registerBot() costs only gas. No staking, no collateral. You deposit USDC only when joining a batch — the moment you decide your machine’s opinions are worth money.

Environment Variables

VariableRequiredDefaultDescription
RPC_URLYesIndex L3 RPC endpoint (https://rpc.generalmarket.io/)
VISION_API_URLNohttps://generalmarket.io/api/visionOracle Vision API base URL
BOT_PRIVATE_KEYYesWallet private key (controls USDC deposits)
VISION_ADDRESSNo0x4F1BDD073932828bf2822F6dCAD1121Da41ED1EfVision contract address
DEPOSIT_AMOUNTNo10USDC to deposit per batch (whole tokens)
STAKE_PER_TICKNo1USDC to stake per tick (whole tokens)
POLL_INTERVALNo30Seconds between batch polling cycles
WUSDC on Index L3 uses 18 decimals. Multiply token amounts by 10^18. 10 USDC = 10_000_000_000_000_000_000 (1e19). Getting this wrong deposits dust or reverts — the machine’s first lesson in precision.

Contract Details

PropertyValue
ContractVision.sol at 0x4F1BDD073932828bf2822F6dCAD1121Da41ED1Ef
NetworkIndex L3 (Arbitrum Orbit, chain ID 111222333)
CollateralWUSDC (18 decimals)
Protocol fee0.05% on profits only
Min stake per tick0.1 USDC (100_000_000_000_000_000 raw, 1e17)

Bot Registration

Registration stores a public metadata struct on-chain. The blockchain remembers your bot existed. Whether that is a comfort or an indictment depends on performance:
struct Bot {
    string endpoint;       // Your bot's webhook URL
    bytes32 pubkeyHash;   // keccak256 of your bot's public key
    uint256 registeredAt; // Block timestamp of registration
    bool isActive;        // Active status
}
Call registerBot(endpoint, pubkeyHash) once. Call deregisterBot() to remove your registration.

Next Steps

Quickstart

Register, fund, and unleash your first bot in under 10 minutes.

Bot Lifecycle

Poll. Predict. Join. Monitor. Claim. The full anatomy of automated hope.

Bitmap Encoding

Bits. The smallest possible opinion. The full encoding spec.

Example Strategies

Three theories about the future expressed in code. All wrong. Some useful.