Canton Predict is a privacy-aware prediction market prototype built on the Canton ledger using DAML for smart contracts and Flutter for the web frontend. It shows how real-world events can be modeled as on-ledger markets while keeping resolution logic auditable and outcomes tied to verifiable information.
Most prediction markets run on fully public blockchains where every bet and position is visible to everyone. That makes them hard to use in institutional, regulated, or commercially sensitive contexts.
Canton Predict uses Canton’s permissioned, data-partitioned ledger model and DAML templates to demonstrate how prediction markets can be:
- Private – only the parties involved see their bets and contracts.
- Auditable – all actions are recorded on-ledger with clear resolution logic.
- Oracle-driven – outcomes are resolved by a designated oracle based on real-world data.
Located in the cantonPredict folder.
Key elements:
OutcomeandMarketStatusdata typesMarkettemplate- fields:
creator,oracle,question,yesLabel,noLabel,dataSource,status,resolutionEvidence Resolvechoice callable only by theoracle
- fields:
Bettemplate- linked to a
Market Claimchoice to model payout logic after resolution
- linked to a
setupandsetupFromJsonscripts to create example markets and bets
Each market includes:
oracle : Party– the only party allowed to resolve the market.dataSource : Text– description of the external system used as the source of truth (e.g. official price feed, sports API, election result feed).resolutionEvidence : Optional Text– evidence string the oracle stores when resolving (e.g. “BTC price 102,000 USD from Coinbase API at 2030-01-01T00:00Z”).
In a full deployment, an off-ledger oracle service would:
- Query the external API or data provider named in
dataSource. - Decide the final
Outcome. - Call the Canton JSON API / gRPC.
- Exercise the
Resolvechoice, passing both the outcome and the evidence string.
This design ensures that every resolved outcome is tied to verifiable information and that the resolution process is enforced and auditable on-ledger.
Located in the canton_predict_web folder.
The Flutter app shows:
- A list of prediction markets (demo data).
- A market detail page with:
- question
- YES/NO options
- stake input
- “Submit bet” button
For this prototype, the bet submission uses a mock service so the UI always responds quickly and reliably during demo. The same flow can later be wired to the Canton JSON API to send real commands to the ledger.
- Flutter Web UI
- (Future) Canton JSON API for sending commands / queries
- Canton sandbox ledger
- DAML smart contracts for markets, bets, and resolution
cd cantonPredict
daml build
daml startThis starts: -Canton sandbox -JSON API (depending on SDK version / config)
cd canton_predict_web
flutter pub get
flutter run -d chrome
• The demo runs entirely locally using DAML Sandbox and Flutter Web.
• No external APIs are required.
• The "Submit Bet" action uses a local mock service for consistency.
• Market creation and resolution logic is fully implemented in DAML.
• Judges may browse the Main.daml file to view market, bet, and oracle logic.
https://raw.githubusercontent.com/zicjoe/MyPredictionMart/main/architecture.png
-Wire the Flutter app directly to the Canton JSON API for live bets.
- Add automated settlement and real token payouts.
- Integrate a real oracle service that queries external APIs.
- Extend markets to support more complex outcomes and odds.
- Add user identity / party onboarding flows.
Canton Predict was built as an ideathon / hackathon prototype to explore how Canton and DAML can be used to support private, verifiable prediction markets.