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.
Hardhat project with contracts, declarative deployment modules, scripts, tests, per-network deployments and an address registry
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.
Declarative modules describing what should exist on a network.
Why a deployment is a description, not a session.
Highlights
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
3Deployment
4Verification
3Modelling
1Stack by layer
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.
Modules and demo strategy
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.