This page maps the repository for contributors. Protocol behavior is explained in the published documentation; commands are in the README; repository rules are in AGENTS.md.
| Layer | What it is | Contracts | Off-chain code |
|---|---|---|---|
| Zoltar | The forkable oracle base layer: questions, universes, REP, and forks. It never judges which answer is true. | solidity/contracts/*.sol |
shared/zoltar, ui/zoltarShared, ui/zoltar |
| Statoblast | The prediction-market layer: question-specific SecurityPool ledgers, multi-question portfolios with one REP/ETH feed per universe, Escalation Games, fork migration, and Collateral Repair Auctions. | solidity/contracts/statoblast/ |
shared/statoblast, ui/statoblastShared, ui/statoblast |
| OpenOracle | A contestable REP/ETH price feed used for solvency checks, never for market outcomes. The imported contract is a fixed compatibility contract. | solidity/contracts/statoblast/openOracle/ |
shared/openOracle, ui/statoblastShared, ui/openoracle |
| Trading | An AMM exchange for Statoblast outcome shares; one possible venue, with no role in market creation or resolution. | solidity/contracts/trading/ |
shared/trading, ui/trading |
| augurScan | A read-only explorer and PostgreSQL indexer for every layer. | none | augurScan/ |
| Bots | Permissionless operators: liquidator, open-oracle-arbitrager, and the testnet chaos exerciser, with common code in bots/shared. |
bots/open-oracle-arbitrager/contracts/, solidity/contracts/chaos/ |
bots/* |
Start with the system overview, then Zoltar, Statoblast, OpenOracle, Trading, and the contract architecture.
Arrows point from a dependency to its consumers. tooling/repo/projects.ts is the canonical build graph; tooling/repo/sharedPackages.ts declares the shared/* order.
flowchart TD
contracts[solidity/contracts] --> artifacts[generated artifacts<br/>solidity/artifacts, contractArtifact.ts, abis.ts]
sharedCore[shared/core] --> sharedZoltar[shared/zoltar] & sharedOpenOracle[shared/openOracle] & sharedStatoblast[shared/statoblast] & sharedTrading[shared/trading]
sharedZoltar & sharedOpenOracle & sharedStatoblast & sharedTrading --> artifacts
artifacts & sharedCore & sharedZoltar --> uiCore[ui/coreShared]
uiCore --> uiZoltarShared[ui/zoltarShared] --> uiStatoblastShared[ui/statoblastShared]
sharedOpenOracle & sharedStatoblast --> uiStatoblastShared
uiZoltarShared --> appZoltar[ui/zoltar]
uiStatoblastShared & sharedStatoblast --> appStatoblast[ui/statoblast]
uiStatoblastShared --> appOpenOracle[ui/openoracle]
uiStatoblastShared & sharedTrading --> appTrading[ui/trading]
artifacts & uiCore & sharedZoltar & sharedOpenOracle & sharedStatoblast & sharedTrading --> bots[bots/*]
artifacts & sharedStatoblast --> augurScan[augurScan]
The UI apps are dependency leaves: shared libraries never import apps, and apps never import one another. bun run check:static enforces the UI layer and shared/* boundaries.
- A contract: Zoltar core in
solidity/contracts/, Statoblast and OpenOracle insolidity/contracts/statoblast/, Trading insolidity/contracts/trading/, and the chaos bot's Uniswap V3 seeding helper insolidity/contracts/chaos/. Contract tests live insolidity/ts/tests/. - Pure protocol math, encoding, or addresses used by more than one runtime: the lowest
shared/*package that owns the concept.shared/*is runtime-neutral and has no UI code. - UI code: runtime-neutral primitives, wallet, simulation, and generic workflows in
ui/coreShared; product capabilities inui/zoltarSharedorui/statoblastShared; bootstrap, routes, pages, and app tests inui/<app>. See ui/AGENTS.md. - Build, CI, test, and documentation tooling:
tooling/{repo,ci,testing,contracts,docs,ui}. The pinned Uniswap deployment input is the only file underscripts/. - Published documentation: HTML under
docs/, with its rules in docs/AGENTS.md. - Design explainers: standalone HTML pages under
design/that explain one pull request or design decision. They are outside the published documentation corpus and its manifest, so thedocs/tooling does not apply to them; the repository-wide HTML structure, HTML format, and unit-terminology checks still do. - Generated output: never hand-edit it.
tooling/repo/generated-artifacts.tslists every output, whether Git tracks it, and the command that recreates it.
bun run generatecompiles the contracts (building theshared/*packages first, then writingsolidity/artifactsand the TypeScript contract bindings insolidity/ts/typesand the UI packages), vendors browser dependencies intoui/*/vendor, and builds the augurScan metadata and browser bundle.bun run setupinstalls dependencies from the root frozen lockfile, runsgenerate, then builds the UI libraries, apps, workers, and test bundles in dependency order.- Most test, typecheck, and build commands run
ensure-contract-artifactsfirst, which rebuilds stale shared packages and contract artifacts from content hashes. Commands ending in:currentskip their preparation step and use what is already on disk; see Script families.