Skip to content

preyam2002/Aletheia

Repository files navigation

Aletheia

A decentralized prediction markets platform powered by AI oracles on the Sui blockchain.

Live Demo: aletheia-app.vercel.app

What is Aletheia?

Aletheia (Greek for "truth") is a next-generation prediction market platform that leverages AI-powered oracles and blockchain technology to create trustless markets for forecasting real-world events. Built on the Sui blockchain, it enables users to trade on the outcome of events with automated market making and AI-driven resolution.

Tech Stack

Frontend

  • Framework: Next.js 14 with TypeScript
  • Styling: Tailwind CSS
  • Charts: Chart.js, Recharts
  • Web3: Sui dApp Kit

Backend

  • Runtime: Node.js with Express
  • Database: MongoDB with Mongoose
  • Real-time: Socket.io

Blockchain

  • Platform: Sui
  • Language: Move
  • Features: Automated Market Making (LMSR), SEAL encryption

Oracle System

  • AI Models: Multiple LLM providers for consensus
  • Resolution: Automated market resolution with multi-model validation

Key Features

Prediction Markets

  • Multi-outcome markets: Support for 2-10 possible outcomes
  • Automated Market Making: LMSR (Logarithmic Market Scoring Rule) algorithm
  • Real-time odds: Live probability updates based on trading activity
  • Liquidity provision: Users can add liquidity to markets

Sealed Markets

  • Privacy: SEAL encryption for private markets
  • Time-locked: Markets can be sealed until a specific date
  • Premium features: Encrypted comments and exclusive access

AI Oracles

  • Multi-model consensus: Uses multiple AI models for resolution
  • Automated resolution: Markets resolve automatically based on real-world outcomes
  • Nautilus integration: External data verification

Analytics

  • Live probability charts: Visualize market sentiment over time
  • Portfolio tracking: Track your positions and P&L
  • Market history: Historical data and trends

Project Structure

Aletheia/
├── backend/           # Express.js API server
│   ├── src/
│   ├── package.json
│   └── ...
├── frontend/          # Next.js frontend
│   ├── src/
│   ├── package.json
│   └── ...
├── oracle/            # AI oracle service
│   ├── src/
│   ├── package.json
│   └── ...
├── contracts/         # Sui Move smart contracts
│   └── sources/
├── e2e/               # End-to-end tests
│   ├── package.json
│   └── ...
└── package.json       # Root workspace config

NPM Scripts (Root)

npm run devs              # Build all and run all dev servers
npm run build:all         # Build backend, oracle, and frontend
npm run dev:all           # Run all services in parallel
npm run dev:backend       # Run backend on port 3001
npm run dev:oracle        # Run oracle service
npm run dev:frontend      # Run frontend on port 3000
npm run test              # Run E2E tests

Getting Started

Prerequisites

  • Node.js 18+
  • MongoDB instance
  • Sui wallet with testnet/mainnet SUI
  • API keys for AI providers

Installation

# Install all dependencies
npm install

# Or install individually
cd backend && npm install
cd frontend && npm install
cd oracle && npm install

Environment Setup

Create .env files in each directory (see .env.example files for reference).

Development

# Run all services in development mode
npm run devs

# Or run individually
npm run dev:backend   # Backend on port 3001
npm run dev:oracle    # Oracle service
npm run dev:frontend  # Frontend on port 3000

# Build all services
npm run build:all

# Run E2E tests
npm test

How It Works

  1. Market Creation: Anyone can create a prediction market with multiple outcomes
  2. Trading: Users buy shares in outcomes they believe will occur
  3. Price Discovery: LMSR algorithm adjusts prices based on demand
  4. Resolution: AI oracles determine the outcome after market close
  5. Settlement: Winners receive payouts proportional to their shares

Smart Contracts

The platform uses several Move modules:

  • prediction_market: Core market functionality
  • amm: Automated market making
  • oracle: Oracle integration
  • seal: Encryption for sealed markets

Documentation

Roadmap

  • Mainnet deployment
  • Mobile app
  • Advanced charting
  • Social features (following, profiles)
  • Token incentives
  • Cross-chain markets

Author

Preyam - GitHub

License

MIT

About

Aletheia is a decentralized prediction market platform on Sui that verifies truth through AI-powered oracles.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors