Add Qassandra prediction market scaffold#905
Conversation
|
Additional context: This scaffold is intentionally minimal. The goal is not to introduce a full prediction market contract in one PR, but to establish typed, deterministic primitives that future Qassandra layers can build on safely. The broader design direction is oracle-first and agent-readable:
The agent-facing angle matters because future forecast demand may come from autonomous systems as much as human users. Qassandra should eventually expose markets in a structure that agents can discover, parse, evaluate, and execute against. This PR keeps that future path open without increasing current review risk. |
|
This update only touches src/contracts/Qassandra.h and keeps the PR intentionally narrow: The added metadata preserves the oracle-first and agent-readable direction while keeping review risk low. It gives future Qassandra layers clearer typed primitives for market type, settlement status, settlement timing, oracle query linkage, and agent-readable market discovery. |
|
Pushed a minimal cleanup commit addressing scaffold safety and review concerns:
No storage, procedures, hooks, registration, settlement flow, or runtime behavior were added. The PR remains an inert typed scaffold for future oracle-settled Qassandra markets. |
|
Final external review completed after ce9032e. Verdict: safe. The only remaining note was conditional: if the old thresholdValue < 0 guard still existed after converting thresholdValue to uint64, it should be removed. The current diff confirms that guard has already been removed. Current scaffold status:
This PR is ready for review as a minimal inert Qassandra scaffold. |
|
One design note for future layers: Qassandra should remain Qubic-native at the settlement layer. Future payouts, incentives, and market reward flows should be denominated in $QUBIC by default, with any later stablecoin or bridge integrations treated as external abstraction layers rather than replacing native settlement. No payout, reward, custody, liquidity, or accounting logic is introduced in this PR. |
|
Summary
This PR adds the first minimal Qassandra scaffold to
coreas Qubic-native prediction market infrastructure.Qassandra is being designed as an oracle-first forecasting layer for both human users and autonomous agents. The initial focus is QUBIC/USD forecasting, but the structure is intentionally typed, deterministic, and modular so it can later support stablecoin rails, bridges, external oracle providers, UI/API layers, broader market categories, and direct agent integrations.
This PR adds only inert primitives and helper logic. It does not register a contract, add procedures, introduce storage, touch runtime behavior, or wire in settlement flows.
Why this matters
Most prediction markets are built around human-facing UI flows first, then later expose APIs for automation.
Qassandra takes the opposite path.
It starts from deterministic, contract-safe primitives that can become readable and usable by both humans and agents from the beginning. Markets should not only be displayed to users; they should be structured so software agents can discover them, reason about them, price them, execute against them, and eventually settle through Qubic-native oracle logic.
This matters because future demand will not only come from people clicking buttons. It will come from AI agents needing reliable forecast markets for price signals, risk checks, hedging, routing decisions, automated treasury actions, and machine-to-machine coordination.
Qassandra should be built for that future at the base layer.
Design intent
This scaffold is designed to be:
Added
This PR introduces:
QASSANDRA_QUBIC_USD_PRICE_SCALEQassandraMarketStatusQassandraOutcomeQassandraComparisonDirectionQassandraMarketIdQassandraOracleSettlementQassandraMarketDescriptorqassandraIsValidPriceReplyqassandraCompareScaledPriceOracle price comparison behavior
The helper logic supports deterministic comparison of scaled oracle price replies against market thresholds.
This is intended for future QUBIC/USD forecast markets where an oracle reply can provide a rational price through numerator/denominator fields while the market stores a scaled threshold.
This keeps future settlement logic compatible with deterministic execution and avoids floating-point ambiguity.
Agentic roadmap alignment
This PR does not add agent functionality yet, but it creates the structure needed for it.
Future Qassandra layers can expose markets in formats that are easy for agents to parse, query, and act on. That includes:
Longer term, Qassandra can support agent interaction through APIs, indexers, wallet-controlled agents, strategy bots, bridge-aware execution, and eventual direct integration paths with Qubic AI infrastructure such as Aigarth and Neuraxon once those rails mature.
The goal is not just a prediction market frontend.
The goal is forecasting infrastructure that autonomous agents can use as a native market signal layer.
Scope intentionally excluded
This PR does not add:
Those should come in separate PRs with clean review boundaries.
Validation
Completed:
Qassandrasymbols before adding.git diff --check.contract_def.h.The narrow syntax probe confirmed the Qassandra-specific issue was fixed. Remaining local probe failures are from existing macOS/clang platform issues, including MSVC-style integer suffixes and intrinsic helpers, not from the Qassandra scaffold itself.
Full build was not run because the local workspace does not have an existing build directory, the documented test CMake path fetches GoogleTest, and EFI/full build setup is platform-sensitive in this environment.
Risk profile
Low.
This PR adds inert types, constants, and helper functions only. It does not alter existing contract behavior, does not execute at runtime, does not change consensus behavior, and does not introduce storage layout changes.
Future PRs can build from this scaffold incrementally across storage, procedures, oracle queries, settlement, market lifecycle, stablecoin rails, and agent-facing interfaces.