All packages
world_predict

world_predict

billettc
v0.1.0/868 downloads/Repository

Package ref

world-predict@v0.1.0

Run package

CLI

Run map_events from the command line.

substreams run world-predict@v0.1.0 map_events -e solana --start-block -1
Authenticate by running substreams auth or directly on thegraph.market (see docs).

README

world_predict

Substreams package that indexes World (world.xyz) prediCt prediction-market instructions on Solana mainnet, shaped for a ClickHouse from-proto SQL sink (StreamingFast hosted on thegraph.market).

Overview

World’s market program prediCtPZCttYMvm2W3PtxmMxLmT1dtN7riU6Cxh6tM holds collateral (CASH), mints YES/NO outcome tokens as complete sets (split / merge), and is driven through lifecycle instructions (initialize_market, determine_outcome, redeem_outcome_for_user, close_market). This package walks top-level and CPI instructions (walk_instructions), matches Anchor discriminators, and emits one typed protobuf message per instruction (and one ClickHouse table per type).

Decoding layouts follow independent mainnet reverse-engineering (prediCt publishes no IDL). Account maps for split / merge / determine_outcome are well verified; initialize_market data layout is decoded; redeem/close account labels are best-effort.

Modules

ModuleKindOutputDescription
map_eventsmapproto:world.v1.EventsDecodes high-value prediCt instructions into typed events for SQL

Tables (from-proto → ClickHouse)

TableInstructionNotes
splitssplitAmount + market / mints / vault / ATAs
mergesmergeMirror of split
initialize_marketsinitialize_marketMarket id, window, YES/NO metadata
determine_outcomesdetermine_outcomeOutcome u16 (0 = NO, 10000 = YES)
redeem_outcome_for_usersredeem_outcome_for_userOperator payout push
close_marketsclose_marketPost-settlement teardown

initialBlock: 431000000 (launch-day window; program deploy is ~429950041).

Prerequisites

  • Substreams CLI + data-plane auth (substreams auth / The Graph Market API key)
  • Rust wasm32-unknown-unknown, buf
  • Optional: ClickHouse you control (hosted sink does not provision a database)

Quick Start

substreams build

# Data-plane auth once
# substreams auth

substreams run ./substreams.yaml map_events \
  --network solana \
  -s 431000000 -t +100 \
  -o jsonl

Inspect JSONL for splits/merges/lifecycle rows before deploying a sink.

Hosted SQL sink (thegraph.market)

  1. Confirm substreams run output quality (stdout only — not a local DB sync).
  2. substreams publish and use
    https://api.substreams.dev/v1/packages/world-predict/<version>
    (or your package slug) as the public spkg.url.
  3. Deploy via StreamingFast Portal HostedService with:
    • network: solana
    • output_module: map_events
    • module_output_type: proto:world.v1.Events
    • ClickHouse connection (your host; port 9440 + secure: true for ClickHouse Cloud)
  4. Stage the DB password on thegraph.market secret page (never paste passwords into chat).

StreamingFast hosts the sink runner only; you supply a reachable ClickHouse.

Program reference

ItemValue
ProgramprediCtPZCttYMvm2W3PtxmMxLmT1dtN7riU6Cxh6tM
CollateralCASHx9KJUStyftLFWGvEVf59SGeG9sh5FfcnZMVPCASH (Token-2022, 6 decimals)
Networksolana

Modules

Execution graph

1 modules