Getting Started with Prophyt

This guide will help you understand Prophyt and get started building prediction markets on the Sui blockchain.

What is Prophyt?

Prophyt is a decentralized prediction market protocol that combines:

  • Prediction Markets: Binary markets where users bet on outcomes
  • Automated Yield Farming: Funds automatically earn yield through DeFi protocol integration
  • Trust Oracle: Provable market resolution using Nautilus enclaves
  • Commemorative NFTs: Proof of participation and winnings

Core Concepts

Prediction Markets

Users create markets with questions like "Will Bitcoin reach $100k by 2025?" and place bets on Yes or No outcomes. Markets have:

  • A question and description
  • An end time after which resolution is allowed
  • Separate pools for Yes and No positions
  • Automatic yield generation on deposited funds

Yield Integration

When users place bets, their funds are automatically deposited to the optimal DeFi protocol (Suilend, Haedal, or Volo) based on:

  • Current APY (60% weight)
  • Total Value Locked (20% weight)
  • Risk level (20% weight)

Market Resolution

Markets can be resolved in two ways:

  1. Standard Resolution: Authorized users resolve markets after the end time
  2. Nautilus Resolution: Trust oracle provides cryptographically verified resolutions

Claiming Winnings

Winners receive:

  • Their share of the losing pool
  • A proportional share of generated yield
  • A commemorative NFT as proof

Quick Start

Prerequisites

  • Sui wallet (e.g., Sui Wallet, Ethos Wallet)
  • SUI tokens for gas and betting
  • Access to Sui network (mainnet, testnet, or devnet)

Creating Your First Market

  1. Connect Wallet: Connect your Sui wallet to the Prophyt frontend
  2. Create Market: Navigate to market creation and provide:
    • Market question
    • Description
    • Duration (end time)
  3. Place Bets: Users can now place bets on Yes or No
  4. Wait for Resolution: After the end time, resolve the market
  5. Claim Winnings: Winners claim their rewards

Example: Creating a Market via Contract

MOVE
use prophyt::prediction_market; // Create a market prediction_market::create_market<SUI>( &mut state, b"Will SUI price reach $5 by end of 2024?", b"Prediction market for SUI price target", 86400, // 24 hours duration clock, ctx );

Example: Placing a Bet

MOVE
// Place a bet on Yes prediction_market::place_bet<SUI>( &mut state, &mut registry, &mut suilend_state, &mut haedal_state, &mut volo_state, market_id, true, // Yes position bet_coin, bet_proof_blob_address, image_url, image_blob_id, clock, ctx );

Architecture Overview

Prophyt consists of several key components:

Smart Contracts (Move)

  • Prediction Market: Core market logic
  • Protocol Selector: DeFi protocol integration
  • Prophyt Agent: Automated rebalancing
  • Nautilus Oracle: Trust oracle integration
  • Protocol Adapters: Suilend, Haedal, Volo integrations

Indexer

  • Event Processing: Real-time blockchain event indexing
  • REST API: Complete API for frontend applications
  • Image Generation: Dynamic NFT portfolio images
  • Market Resolution: Automated resolution scheduling

Nautilus Server

  • Trust Oracle: Enclave-based market resolution
  • Signature Verification: Ed25519 cryptographic proof
  • External Data Verification: API-based outcome verification

Next Steps

Resources