Skip to content

feat: Implement advanced AI prediction market system - #115

Merged
LaGodxy merged 2 commits into
MettaChain:mainfrom
WillNovus:feat/prediction-market
Mar 25, 2026
Merged

feat: Implement advanced AI prediction market system#115
LaGodxy merged 2 commits into
MettaChain:mainfrom
WillNovus:feat/prediction-market

Conversation

@WillNovus

@WillNovus WillNovus commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Closes #66


This PR introduces an advanced on-chain prediction market mechanism using crowd-sourced wisdom and integrates it directly with the existing analytics contract structure.

Key Features

  • Prediction Market Module (contracts/prediction-market):
    • Implemented create_market for defining prediction targets based on AI metrics or Oracle data.
    • Added crowd-sourced stake_prediction(market_id, direction) allowing users to forecast using long/short positions.
    • Built a zero-floating-point arithmetic payout algorithm in claim_reward that safely apportions the losing pool to accurate predictors under no_std constraints.
    • Implemented UserReputation tracking that inherently adjusts user accuracy metrics based on success rates, generating scalable confidence weights.
    • Added submit_backtest_data to allow off-chain ML validations to publish proofs directly onto the blockchain's event log.
  • Analytics Integration (contracts/analytics):
    • Introduced the MarketSentiment structure defining the crowd's bull vs. bear token volume distributions.
    • Added update_market_sentiment() endpoint to aggregate market predictions seamlessly.
    • Refactored the MarketReport generator to dynamically combine sentiment metrics alongside standard data.

Validation

  • Validated logic using native cargo test suites in both prediction-market and analytics modules, ensuring all math remains integer-based and strictly compatible with ink! smart contracts.
  • Configured and linked the new contract to the main workspace Cargo.toml.

@drips-wave

drips-wave Bot commented Mar 24, 2026

Copy link
Copy Markdown

@WillNovus Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@LaGodxy

LaGodxy commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

@WillNovus resolve conflicts.

@WillNovus

Copy link
Copy Markdown
Contributor Author

@LaGodxy The conflict have been resolved. Please review.

@LaGodxy
LaGodxy merged commit 2125f5a into MettaChain:main Mar 25, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Develop Real-Time Property Market Prediction Engine

2 participants