An on-chain ADA price prediction game on Cardano.
Predict the future price of ADA against the Charli3 oracle. Predictions are scored 24 hours later and points convert to ADA payouts at tier thresholds.
๐ฎ Live game: https://server-tools.grahamsnumberplus1.com/Oracle_Project/oracle-game.html ๐ฆ Twitter: @GrahamsNoPlus1 ๐ Stake pool: GNP1
- โ Free to play โ no payment required
- โ No wallet connection needed โ addresses entered as plain text (read-only)
- โ Fully on-chain โ predictions, scoring, and payouts all live on Cardano mainnet
- โ Aiken-compiled Plutus V3 validator (Conway era)
- โ Charli3 oracle integration โ public on-chain ADA/USD price feed
- โ Skill-based โ predictions scored against a future oracle price
- โ Open source โ verify the code yourself
- A player submits a USD price prediction for ADA
- The prediction is stored in the smart contract's datum
- 24 hours later, a scheduled transaction (TX2) reads the latest Charli3 price and awards points based on accuracy (5-tier graded scoring)
- When a player accumulates enough points (4 payout tiers), a scheduled transaction (TX3) pays them ADA from the admin wallet (5, 10, 20, or 100 ADA)
- Inactive players are removed (TX4) to free slots โ the contract supports 16 concurrent active users
| Tier | Accuracy (vs oracle) | Points awarded |
|---|---|---|
| Exact | 0 micro-cents | 50,000 |
| Excellent | โค ยฑ0.0002 USD | 10,000 |
| Great | โค ยฑ0.001 USD | 1,000 |
| Good | โค ยฑ0.01 USD | 100 |
| Okay | โค ยฑ0.1 USD | 50 |
| Miss | > ยฑ0.1 USD | 0 |
| Tier | Banked points | ADA paid |
|---|---|---|
| Tier 1 | 50,000+ | 100 ADA |
| Tier 2 | 10,000+ | 20 ADA |
| Tier 3 | 1,000+ | 10 ADA |
| Tier 4 | 200+ | 5 ADA |
| Item | Value |
|---|---|
| Script address | addr1w9rm69uacrw8rrlkes0rtz7c6wlshh34hpfn2652tqy6gmchp6reu |
| Script hash | 47bd179dc0dc718ff6cc1e358bd8d3bf0bde35b853356a8a5809a46f |
| Admin wallet | addr1v9l0d2448cq5dmk3qudn35fd9d48dngvrlacs38wsxgqetgzhuxal |
| Charli3 OracleFeed UTxO | addr1wyvxns52tsgz8ggvrh4np5gjyfk0g5fshqq2ytvu9t7pe8qp3adw6 |
| Charli3 policy ID | 08c56c0fa73748a23c3bc1d9e6a60a4187416fc4ff8fe3475506990e |
| Plutus version | V3 |
The trust-critical part of Soracles is the Aiken validator. You can independently rebuild from source and confirm that the compiled script hash matches the live on-chain contract.
# Install Aiken (one-time)
curl -sSfL https://install.aiken-lang.org | bash
# Clone and build
git clone https://github.com/GNP1-dev/soracles.git
cd soracles/aiken
aiken build
# Inspect the compiled script hash
cat plutus.json | python3 -c "import json,sys; d=json.load(sys.stdin); print('script_hash:', d['validators'][0]['hash'])"Expected output:
script_hash: 47bd179dc0dc718ff6cc1e358bd8d3bf0bde35b853356a8a5809a46f
If the hash matches, the source you just compiled is byte-identical to the live contract on Cardano mainnet.
soracles/
โโโ aiken/ # Aiken smart contract source
โ โโโ aiken.toml # Aiken project config
โ โโโ plutus.json # Compiled output (regenerated by `aiken build`)
โ โโโ lib/oracle_datum.ak # Charli3 datum parser (Apache 2.0, see NOTICE)
โ โโโ validators/oracle_prediction.ak # Main validator (MIT)
โโโ frontend/ # Static HTML/CSS/JS served by Apache
โโโ backend/ # PHP API endpoints
โโโ cron/ # Wrapper scripts called by cron (tx2/3/4)
โโโ datums/ # Datum JSON templates for cardano-cli
โโโ plutus-binaries/ # Compiled .plutus file (matches aiken/plutus.json output)
โโโ docs/ # Architecture notes and handover manual
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ Player โ HTTP POST โ PHP Backend โ
โ browser โโโโโโโโโโโโโโโโโโโบโ on Apache โ
โโโโโโโโโโโโโโโโ (prediction + โโโโโโโโโโฌโโโโโโโโโโ
ADA address) โ
โ cardano-cli
โผ
โโโโโโโโโโโโโโโโโโโโ
โ Cardano node โ
โ (gnp1 server) โ
โโโโโโโโโโฌโโโโโโโโโโ
โ TX submission
โผ
โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ Cardano mainnet โโโโโโโโโโโ Charli3 oracle โ
โ Soracles datum โ reads โ ADA/USD feed โ
โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
| TX | Triggered by | Schedule | What it does |
|---|---|---|---|
| Register | Player | On demand | Adds player to active list with their ADA address |
| Submit | Player | On demand | Adds a prediction to the on-chain datum |
| TX2 (Award) | Cron | 00:15 / 06:15 / 12:15 / 18:15 UTC | Scores mature predictions vs Charli3 price, awards points |
| TX3 (Payout) | Cron | 06:25 UTC on days 1, 4, 7, 10, 13, 16, 19, 22, 25, 28 | Pays out ADA to players who hit payout tier thresholds |
| TX4 (Remove) | Cron | 06:35 UTC on days 2, 5, 8, 11, 14, 17, 20, 23, 26, 29 | Removes inactive players to free slots |
All times UTC. System timezone must be UTC (timedatectl set-timezone UTC) โ cron evaluates schedules against system TZ.
- A Cardano node with cardano-cli
- An Apache/PHP server
- A dedicated admin wallet funded with ADA for fees + payouts
- Familiarity with Cardano CLI workflows and Plutus contract deployment
- Compile and deploy your own validator (script hash will differ from ours; that's expected โ you should deploy your own contract, not consume our datum)
- Set up Apache to serve
frontend/andbackend/under a single URL prefix (e.g./Oracle_Project/) - Set up directory layout: by default the PHP files reference
/home/russell/Oracle_Project_v86/for state files, plutus binaries, and wallet keys. You'll either need to:- Use the same paths on your server, or
- Find and replace
/home/russell/Oracle_Project_v86in the PHP files with your own paths
- Create the admin config file at
/home/russell/giveaway-config.json(or your equivalent path), schema:This is read by{ "admin_password": "your-chosen-password-here" }oracle-admin-auth.phpto gate the admin dashboard. Never commit this file. - Initialize state JSONs (empty) at the configured paths:
echo "{}" > codes/oracle_valid_codes.json echo "{}" > codes/oracle_registrations.json echo "{}" > codes/oracle_leaderboard.json echo "{}" > codes/oracle_predictions.json echo "{}" > codes/oracle_code_usage.json echo "[]" > codes/oracle_leaderboard_history.json - Submit the initial lock transaction to put the empty datum + 20 ADA into your script address. Use the cardano-cli pattern documented in
docs/HANDOVER-MANUAL.md. - Install cron entries referencing
cron/oracle-cron-tx{2,3,4}.shon the schedule described above - Generate access codes in
oracle_valid_codes.jsonand distribute as you wish
| File / dir | Why excluded |
|---|---|
*.skey / wallet keys |
Operator-specific, NEVER published |
giveaway-config.json |
Contains the admin password |
oracle_*.json state files |
Contains live user wallet addresses, predictions, leaderboard history |
cache-*.json |
Runtime caches, regenerated automatically |
logs/ |
Operator-specific runtime logs |
Aiken build/ directory |
Build artifacts, regenerated by aiken build |
Soracles reads ADA/USD price data from Charli3's public on-chain oracle. This is public data on the Cardano blockchain โ no agreement with Charli3 is required to consume it. We gratefully acknowledge Charli3 for providing this public infrastructure.
The aiken/lib/oracle_datum.ak module is derived from Charli3's public oracle-datum-lib and used under the Apache License 2.0. See NOTICE for full attribution.
If Charli3 were to discontinue their public feed, Soracles would migrate to:
- First fallback: An alternative public Cardano oracle (e.g., Orcfax). This requires a new contract version (V87) with the alternative oracle's script address baked in.
- Second fallback: Self-sourced price feeder. The admin would fetch ADA/USD from multiple public APIs (CoinGecko / Binance / Kraken), average them, and write to a dedicated oracle datum on a fixed schedule. Cost: ~0.8 ADA/day. The cron code would be open-sourced alongside this change for full audit.
Neither fallback is currently active โ Charli3 is the live oracle source.
- Original Soracles code: MIT License (see
LICENSE) aiken/lib/oracle_datum.ak: Apache License 2.0 (derived from Charli3's reference library โ seeNOTICE)
You're free to fork, modify, and run your own instance under these terms.
Soracles is not affiliated with, endorsed by, or sponsored by:
- Charli3 (we are a consumer of their public oracle)
- Input Output Global (IOG)
- The Cardano Foundation
- Emurgo
Soracles is an independent project operated by GNP1 Stake Pool (Russell Wallace) as a free educational demonstration.
GNP1 (GrahamsNumberPlus1) is a Cardano stake pool operated since October 2020, based in Harrogate, UK. The pool donates a share of rewards to mental health charities โ over ยฃ4,100 contributed since 2021.
If Soracles entertains or educates you, consider delegating to GNP1. It's not required to play โ but it does help fund the charity contributions.
This is experimental software. The smart contract has been tested but may still contain bugs. By using Soracles or this code, you accept that we cannot be held liable for contract failures or payout issues, to the extent permitted by law. See the in-game disclaimer (frontend/oracle-game.html, accessible via the "
Nothing in this game or repository constitutes financial advice. ADA price predictions in Soracles are scored against a stale oracle snapshot and are not market forecasts.