All engineering notes
Blockchain, Smart contracts, architecture record

On-Chain Prediction & Reward Contracts

This is the settlement layer beneath a forecasting product: the contracts that actually hold funds, price entries, and pay winners. Two things make it more than a set of contracts. First, pricing runs on bonding curves, so entry cost responds to demand rather than being fixed — which required modelling the curves before writing them. Second, deployment is declarative and the resulting addresses are tracked in-repo, so any environment's live contract set is knowable rather than folkloric.

94Solidity contracts, in the suite
DeclarativeDeployment, module-based, reproducible
MultipleNetworks tracked, with an address registry
Bonding curvesPricing model, modelled before implementation

Repository shape

Hardhat project with contracts, declarative deployment modules, scripts, tests, per-network deployments and an address registry

How this is presented

Documented as an architecture record. Deployed addresses and audit status are the operator's to publish, not a portfolio's.

From deployment to payout

Two flows: getting a known-good contract set on-chain, and moving a participant's funds through it.

Deploy pipelineClient surface

Declarative modules describing what should exist on a network.

Client surfaceData storeOn-chainExternal
Deploying a contract set

Why a deployment is a description, not a session.

Highlights

  • Ninety-four contracts covering the full lifecycle: pool creation, entry pricing, staking and payout.
  • Bonding-curve pricing so entry cost responds to demand, modelled visually before being implemented.
  • Declarative deployment modules, so a deployment is reproducible rather than a sequence of manual transactions.
  • In-repo address registry per network, so the live contract set for any environment is knowable.
  • Test suite kept alongside the contracts, since on-chain code cannot be patched after the fact.
  • Deployment artifacts retained, making it possible to verify what was actually shipped.

Contracts, curves and a reproducible deployment

The suite splits into the contracts themselves, the mathematics that prices entries, and the tooling that gets a known-good set on-chain and records where it landed. The last part matters more than it sounds: an unrecorded deployment is an unmaintainable one.

Prediction contracts

Pool creation, entry accounting, resolution and payout.

  • Hold participant funds and the conditions under which they are released.
  • Resolution is the point where off-chain outcome and on-chain settlement meet.

Pricing curves

Bonding-curve mathematics determining entry cost as participation grows.

  • Curves were modelled and visualised before implementation.
  • Pricing responds to demand instead of being a fixed parameter.

Staking and rewards

Lock-up mechanics and reward distribution.

  • Distribution logic kept separate from pool accounting.
  • Payout paths are testable independently of prediction resolution.

Deployment tooling

Reproducible deployments and a record of what is live where.

  • Declarative modules rather than imperative deploy scripts.
  • Address registry and retained artifacts per network.

Contract suite and tooling

Ninety-four contracts organised into a core implementation set and the interfaces other contracts integrate against, plus the tooling that makes a deployment reproducible. 11 units across 4 groups.

Contracts

3
coreinterfacesartifacts

Deployment

4
ignition modulesscriptsdeploymentsaddresses

Verification

3
test suitehardhat configutils

Modelling

1
bonding-curve model

Stack by layer

Contracts

Prediction pools, Bonding curves, Staking, Reward distribution

Tooling

Hardhat, Declarative deployment modules, Deployment scripts, Test suite

Operations

Address registry, Per-network deployments, Curve modelling

Delivered work

Contracts

  • Ninety-four Solidity contracts across pools, curves, staking and rewards.
  • Bonding-curve pricing modelled before implementation.
  • Reward distribution separated from pool accounting.
  • Test suite maintained alongside the contracts.

Deployment and operations

  • Declarative deployment modules for reproducible releases.
  • Per-network deployment artifacts retained in-repo.
  • Address registry so the live contract set is always knowable.
  • Operational scripts for post-deployment tasks.

Key modules

Bonding-curve pricing

Makes entry cost demand-responsive.

  • Modelled and visualised before being written.
  • The main piece of real mathematics in the suite.

Declarative deployment

Turns releases into something reviewable.

  • Re-running converges instead of duplicating.
  • Removes the hand-run-transaction failure mode.

Address registry

Keeps deployments maintainable.

  • Committed per network alongside artifacts.

Presentation approach

How this project is presented

  • Contract relationships and deployment discipline explained.
  • No live addresses published — that is the operator's call.
  • Contract count read from the repository.

Documentation and notes

Contract map

How pools, curves, staking and distribution relate.

Deployment guide

Declarative modules, network targets and the address registry.

Curve model

Bonding-curve behaviour and the parameters that shape it.
  • Project and organisation names are intentionally omitted.
  • Deployed addresses and any audit status are deliberately not published here.
  • Contract count is read from the repository.
All 21 engineering notes