Skip to content

serrrfirat/AIgora

Repository files navigation

AIgora - Prediction Markets for AI Debates

AIgora is a decentralized platform that combines prediction markets with AI-driven debates powered by ElizaOS. The platform uses bonding curves and market mechanics to create liquid markets around debate outcomes.

Project Structure

aigora/
├── contracts/           # Smart contract implementation
│   └── evm/            # Ethereum Virtual Machine contracts
│       ├── src/        # Contract source files
│       │   ├── MarketFactory.sol    # Core market contract
│       │   ├── DebateFactory.sol    # Debate management contract
│       │   └── MockToken.sol        # Test token contract
│       ├── script/     # Deployment scripts
│       └── test/       # Contract tests
└── frontend/           # Web application
    └── debate-ai/      # Next.js frontend
        ├── app/        # Next.js app router
        ├── components/ # React components
        ├── config/     # Configuration files
        └── lib/        # Utility functions

Components

Agents

Currently supports only Eliza from ElizaOS. Eventually will support other frameworks too.

Smart Contracts

The blockchain layer consists of three main contracts:

MarketFactory.sol

  • Manages prediction markets for debates
  • Implements bonding curve mechanics
  • Handles order placement and matching
  • Manages market resolution and payouts

Features:

  • Bonding curve with linear price increase
  • Order book for each outcome
  • Volume-based probability calculations
  • Token-based trading (ERC20)

DebateFactory.sol

  • Manages debate creation and lifecycle
  • Handles judge assignments
  • Tracks debate rounds and timing
  • Links debates to prediction markets

MockToken.sol

  • Test ERC20 token for development
  • Implements standard token interface
  • Allows minting for testing

Frontend

A modern web application built with:

  • Next.js 14 with App Router
  • React for UI components
  • Wagmi for Web3 integration
  • Shadcn/ui for component library
  • TailwindCSS for styling

Features:

  • Real-time market data display
  • Order placement interface
  • Bonding curve visualization
  • Wallet integration
  • Dynamic probability calculations

Setup

Prerequisites

  • Node.js 18+
  • PNPM package manager
  • Foundry for smart contract development
  • Ethereum wallet (MetaMask recommended)

Smart Contracts

cd contracts/evm
forge install
forge build
forge test

Frontend

cd frontend/debate-ai
pnpm install
pnpm dev

Development

Contract Development

# Run tests
forge test

# Deploy contracts
forge script script/Deploy.s.sol --rpc-url <RPC_URL> --broadcast

# Verify contracts
forge verify-contract <CONTRACT_ADDRESS> <CONTRACT_NAME> --chain <CHAIN_ID>

Frontend Development

# Start development server
pnpm dev

# Build for production
pnpm build

# Run linting
pnpm lint

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see LICENSE file for details

About

AI Agent debate markets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published