Skip to main content

Overview

Generative Prediction Markets (GPM) represent a cutting-edge application within the OnchainPoints ecosystem, pushing the boundaries of decentralized finance and blockchain technology. GPM offers a dynamic platform for creating and participating in prediction markets, where users can leverage their knowledge and intuition to forecast outcomes across a wide range of topics.

GPM Architecture

Core Components

GPM is a collection of smart contracts and backend services that work together to create, manage, and resolve prediction markets automatically without any human intervention. Some of the core components are:

Market Generator

Market Generator is responsible for creating new prediction markets on GPM automatically every few minutes. It talks to Powerloom nodes to get latest token prices and then works with the GPM backend to create new markets. Market details are cached in Redis for later use by the Market Resolver.

Market Resolver

Market Resolver is responsible for resolving markets at the end of their trading period. It queries Powerloom nodes to get the required token prices at the time of market resolution and then passes a resolve message to the GPM backend to resolve the finished markets.

GPM Backend

GPM Backend is a REST API that handles all the interactions between GPM smart contracts and the outside world. The backend hosts the core business logic endpoints for creating and resolving markets, as well as providing various helper endpoints for frontend applications such as a market details page, leaderboard, price graphs, etc.

Powerloom Nodes

Powerloom Snapshotter nodes form the critical price oracle infrastructure for GPM. These nodes continuously capture token prices from the source blockchain and distribute this data through their API. Unlike traditional third-party price feeds, Powerloom ensures reliability through its decentralized network of snapshotters that reach consensus on each price data point, making it the ideal choice for GPM's price discovery needs. This reliable price data is essential for establishing accurate market conditions, ensuring fair resolutions, and maintaining market integrity through verifiable, tamper-proof data feeds.

Smart Contracts

GPM uses a set of smart contracts to create, manage and resolve prediction markets. The core contracts are:

Factory Contract

  • Dynamically generates new prediction markets
  • Ensures each market is unique and tailored to specific events or outcomes
  • Facilitates rapid deployment of markets in response to emerging trends or events

FixedProductMarketMaker (FPMM) Contract

  • Manages individual prediction markets
  • Handles the buying and selling of outcome tokens
  • Implements a market-tested constant product algorithm for price discovery and market efficiency

ConditionalTokens Contract

  • Manages the underlying tokens representing different outcomes in markets
  • Ensures the integrity and uniqueness of each market position
  • Facilitates the creation of complex, multi-conditional markets

PredictionsOracle Contract

  • Serves as the central hub for GPM markets
  • Interacts with the FPMM Factory Contract to handle the creation of new markets
  • Facilitates the buying and selling of outcome tokens for a given market
  • Acts as the bridge between the OnchainPoints ecosystem and GPM
  • Verifies and reports outcomes to conduct market resolutions

SocialBets Contract

  • Enhances user engagement through social betting features
  • Allows users to share predictions and strategies across social networks
  • Implements group betting and other collaborative forecasting mechanisms

How GPM Works

Here is a brief overview of how GPM works:

  1. Market Creation: The Factory contract deploys a new FixedProductMarketMaker (FPMM) instance for each prediction market, defining the possible outcomes.

  2. Token Issuance: The ConditionalTokens contract creates unique tokens for each outcome in the market.

  3. User Participation: Users spend points through the PredictionsOracle contract to buy outcome tokens, effectively placing bets on their predicted outcomes.

  4. Price Discovery: As users buy and sell outcome tokens, the FPMM adjusts prices based on market activity, reflecting the collective forecast of participants.

  5. Outcome Resolution: Once the event concludes, the PredictionsOracle reports the outcome, triggering the market's resolution.

  6. Reward Distribution: Winning participants can claim their rewards, which are automatically converted to POP tokens or points within the OnchainPoints ecosystem.

Key Features

  1. Generative Nature: GPM can create markets for virtually any predictable event, from sports outcomes to financial indicators to global events.

  2. Real-time Market Dynamics: Prices update in real-time, reflecting the latest information and participant sentiment.

  3. Automated Market Making: The FPMM ensures liquidity and enables trading without traditional order books.

  4. Multi-Condition Markets: Users can create and participate in complex markets with multiple interdependent conditions.

  5. Social Trading: The SocialBets feature encourages community engagement and knowledge sharing.

  6. Seamless Integration: GPM is fully integrated with the OnchainPoints ecosystem, allowing for fluid movement between prediction markets and other platform activities.

  7. Scalability: Built on a Layer 3 blockchain, GPM can handle high-frequency trading and rapid market creation.

Future Potential

GPM was created with a focus on continuous evolution and expansion:

  • AI Integration: Incorporate machine learning models into the market creation process to dynamically create markets based on emerging trends or events.
  • Cross-chain Markets: Enable prediction markets that span multiple blockchain networks.
  • Regulatory Compliance Tools: Develop features to ensure markets adhere to relevant regulations.
  • Customizable Market Mechanisms: Allow users to create markets with unique structures and payout mechanisms.