Documentation Index
Fetch the complete documentation index at: https://docs.signalium.site/llms.txt
Use this file to discover all available pages before exploring further.
Process map
| Tier | Process | Tech | Notes |
|---|---|---|---|
| Frontend | signalium-web | Next.js 15, Reown AppKit, wagmi, viem, HeroUI v3, TanStack Query | Reads markets via API, places bets directly via wallet |
| Backend | signalium-api | Bun + Hono, SQLite (WAL) | Caches X post metadata, AI proposals, 0G/USD price |
| Worker | signalium-judge-worker | Bun cron | Sweeps factory for matured markets, runs judge in TEE, posts on-chain |
| Indexer | Goldsky subgraph | AssemblyScript handlers | Indexes factory + per-market events including yield snapshots |
| Chain | 0G mainnet (16661) | EVM | Markets, treasuries, adapters; Gimo StakePool is a third-party dependency |
Data flow at create-time
- User pastes an X URL →
POST /posts/evaluate. - API pulls the tweet (RapidAPI), runs the gatekeeper model (TEE) for an
eligible: bool+ score. - If eligible, the writer model drafts the proposal:
{ question, description, resolutionCriteria, resolutionDate, judgePrompt, aiProbability }. - The judge prompt is uploaded to 0G Storage; the API persists the proposal in SQLite keyed by the resulting merkle root.
- The user reviews and signs
MarketFactory.createMarket(...). In one transaction the factory:- Clones a
PredictionMarket(EIP-1167 minimal proxy). - Deploys a fresh
Treasurywhoseprincipalis the new market. - Deploys a
GimoAdapterwired to that Treasury. - Enables the adapter on the Treasury and hands ownership to the factory owner.
- Initializes the market with the merkle root and the Treasury address.
- Clones a
Data flow at resolve-time
- Judge worker calls
startResolving()on every market pastresolutionDate. - For each market in
Resolvingstatus, it pulls the sealed prompt back from 0G Storage and runs the judge model in TEE. - The TEE provider signs
keccak256(abi.encode(DOMAIN_TAG, chainId, resolver, market, outcome, attestationHash, nonce)). - Worker submits
AIResolver.submitResolution(market, outcome, attestationHash, proof). AIResolververifies the signature on-chain and forwardsresolve(outcome, attestationHash)to the market.- The market recalls liquid funds from its Treasury and snapshots the 80/20 yield split.

