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.
Architecture
A prediction market is a stack of responsibilities, each delegated to the layer least likely to abuse it. Vision distributes trust across five layers. No single component controls the outcome. The architecture is redundant not because redundancy is fashionable, but because trust concentrated is trust misplaced.Data Node Independence
Each oracle operates its own data-node instance. They poll the same 98 APIs, store their own copies, compute their own snapshots. If one data-node fails, two others still reach consensus. If all three disagree about a price, no tick resolves. This is the cost of not trusting anyone — you must verify everything three times. A fourth data-node, read-only, serves the frontend and bot APIs. It holds no signing authority. It cannot influence resolution. It merely reports what the protocol has decided.Data-node independence means a single compromised data source cannot alter outcomes. Each oracle computes prices from its own database, and BLS consensus rejects disagreement. The protocol is as paranoid as its architecture suggests.
Contract Architecture
Three contracts. Clear separation. The money never touches the logic.BLS Consensus Model
Nothing happens without agreement. Tick resolution, config updates, balance proofs, batch creation — every protocol action requires an aggregated BLS signature from a quorum of oracles. The threshold isceil(2n/3). With three oracles, that means two must agree. A single dissenter blocks nothing. Two dissenters block everything.
Security Boundaries
Trust is not a feeling. It is a line drawn between what you control and what you don’t. Every boundary in this system is enforced by either cryptography or smart contract logic — never by good intentions.Source Modules
| Module | Responsibility |
|---|---|
| Vision.sol | Batch registry, bitmap commits, config hashes, claim verification |
| VisionReserve.sol | USDC custody — deposits, withdrawals, reward transfers |
| OracleRegistry.sol | BLS public key management, aggregated pubkey, threshold |
| Tick Engine | Per-batch tick scheduling, resolution, bitmap flip |
| Resolver | Price comparison, parimutuel matching, PnL computation |
| Config Orchestrator | Data-node polling, config proposals, BLS consensus on updates |
| Chain Listener | L3 event monitoring — new batches, bitmap updates, deposits |
| Bitmap Store | Two-slot (pending/active) bitmap management per player per batch |
| BLS Signer | Private key operations, signature aggregation |
| Data Node | 98-source collection, PostgreSQL storage, REST + WS + SSE serving |
Each oracle runs co-located with its own data-node process. They share a VPS but not a database. The frontend data-node is a separate, read-only instance that serves public API traffic without interfering with oracle data pipelines.