> ## 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.

# Signalium

> AI-resolved prediction markets sourced from X posts. Built on 0G — bets earn yield in Gimo while the market is open.

Signalium turns any viral X (Twitter) post into a tradable YES/NO prediction market. Three AI roles run inside the **0G Compute TEE** so the verdict can be trusted but cannot be tampered with:

* **Gatekeeper** scores a tweet on falsifiability, clarity, specificity, signal, and novelty. Most tweets are rejected.
* **Writer** drafts a clean question, description, resolution criteria, and a sealed judge prompt that lives on **0G Storage**.
* **Judge** runs the frozen prompt at resolution time, signs the outcome with the allowlisted TEE key, and submits it on-chain.

While the market is open, idle stakes don't sit dormant. Each market spawns its own `Treasury` that routes funds into **Gimo Finance** liquid staking (`st0G`). At resolution **80% of the yield earned goes back to bettors pro-rata, 20% to the protocol**.

<CardGroup cols={2}>
  <Card title="Quick start" icon="rocket" href="/quickstart">
    Clone the repo, run `pnpm dev`, browse live mainnet markets in 90 seconds.
  </Card>

  <Card title="Architecture" icon="diagram-project" href="/concepts/architecture">
    The full system diagram — web, API, judge worker, contracts, subgraph.
  </Card>

  <Card title="Yield economics" icon="coins" href="/concepts/yield-economics">
    How the 80/20 split, reserve floor, and one-shot snapshot work.
  </Card>

  <Card title="Smart contracts" icon="file-contract" href="/contracts/overview">
    Mainnet addresses, ABI surface, role gates.
  </Card>
</CardGroup>

## Try it now

| Path                                                                                                | What you'll see                                                    |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| [signalium.site](https://signalium.site)                                                            | Live mainnet — browse markets, view source posts, watch live yield |
| [signalium.site/m/0x1b89…0639](https://signalium.site/m/0x1b8992645570683dCeF5d75fabA03c5392620639) | A real market with bets placed and 0.025 0G earning in Gimo        |
| [api.signalium.site/health](https://api.signalium.site/health)                                      | API liveness probe                                                 |
| [api.signalium.site/price/0g](https://api.signalium.site/price/0g)                                  | Cached 0G/USD price (CoinGecko, refreshed every 6h)                |

## How a market works

1. User pastes an X post URL in `/create`.
2. The API runs the gatekeeper. If the tweet is settle-able, the writer drafts a market and seals the judge prompt to 0G Storage.
3. The user signs `MarketFactory.createMarket(...)` from their wallet. The factory deploys, in one transaction, a `PredictionMarket` clone, a per-market `Treasury` whose principal is that market, and a `GimoAdapter` wired to the Treasury.
4. Anyone bets YES or NO with native 0G. Stakes flow into the Treasury; the operator (creator by default) calls `deployIdle` to push idle funds into Gimo's `stake()`.
5. At `resolutionDate`, the judge worker calls the judge model in TEE on the frozen prompt, signs the outcome, and submits to `AIResolver`. The resolver verifies the signature on-chain and forwards `resolve()` to the market.
6. Winners pull payouts with `claim()` — pro-rata of (notional pool + bettors' 80% of yield).

## Built on 0G

| Component                      | Role                                                                       |
| ------------------------------ | -------------------------------------------------------------------------- |
| **0G Chain** (`chainId 16661`) | Markets, treasuries, adapters; sub-second finality, cheap gas              |
| **0G Compute** (TEE)           | DeepSeek V3 inference for gatekeeper / writer / judge — drop-in OpenAI API |
| **0G Storage**                 | Sealed judge prompt (only its merkle root lives on-chain)                  |
| **Gimo Finance**               | StaFi LSaaS — yield destination via `GimoAdapter`                          |
