hackquest logo

Augurrix

A decentralized prediction market built on Mantle Sepolia Testnet with prediction chaining and borrowing capabilities.

视频

技术栈

Next
Web3
Ethers
Solidity

描述

Augurrix

A decentralized prediction market built on Mantle Sepolia Testnet with prediction chaining and borrowing capabilities.

Important Links

🚀 Features

  • Prediction Chaining: Create and participate in prediction markets with fixed stakes

  • Exposure Branching: Transfer up to 70% of your exposure from one prediction to another, enabling dynamic portfolio management

  • Capital Flow Architecture: Enables collateral to flow across live predictions, eliminating capital silos

  • Borrowing System: Leverage collateral to place bets up to 70% LTV with flexible borrowing

  • Real-time Updates: Live prediction data and user balances

  • MetaMask Integration: Seamless wallet connection and transaction handling

  • Modern UI: Clean, responsive interface built with Next.js and Tailwind CSS

Key Features

Creating Predictions

  • Navigate to /predictions

  • Click "Create Prediction"

  • Enter question and stake amount

  • Submit transaction

Prediction Branching

  • Transfer Exposure: If you have exposure in a prediction, click the "Branch" button to transfer up to 70% of your stake

  • Dynamic Portfolio Management: Move exposure between predictions without closing positions

  • Strategic Rebalancing: Adjust your risk allocation across different markets in real-time

Placing Bets

  • Direct Bet: Send ETH directly to match the prediction stake

  • Borrow Bet: Use collateral to borrow funds (up to 70% LTV)

Managing Collateral

  • View collateral balance and debt on /profile

  • Withdraw available collateral

  • Monitor health status (liquidation risk)

Claiming Winnings

  • Resolved predictions show "Claim" button for winners

  • Automatic proportional payout calculation

🏗️ Architecture

Prediction Branching System

Augurrix implements a sophisticated prediction branching system that allows capital to flow dynamically across interconnected prediction markets.

Architecture Diagram

┌─────────────────┐     ┌─────────────────┐
│   Prediction A  │     │   Prediction B  │
│   "Will ETH     │     │   "Will BTC     │
│   reach $5000?" │     │   reach $100k?" │
│                 │     │                 │
│   User Exposure │     │                 │
│   Yes: 10 ETH   │     │                 │
│   No:  5 ETH    │     │                 │
└─────────┬───────┘     └─────────────────┘
          │
          │ 70% Exposure Transfer
          │ (Branching)
          ▼
┌─────────────────┐
│   Prediction A  │     ┌─────────────────┐
│   "Will ETH     │     │   Prediction B  │
│   reach $5000?" │     │   "Will BTC     │
│                 │◄────┤   reach $100k?" │
│   Remaining     │     │                 │
│   Yes: 3 ETH    │     │   Transferred    │
│   No:  1.5 ETH  │     │   Yes: 7 ETH    │
│                 │     │   No:  3.5 ETH  │
└─────────────────┘     └─────────────────┘

How Exposure Branching Works

1. Exposure Accumulation

  • Users build exposure by placing bets on various predictions

  • Exposure represents the user's stake and potential outcomes across different markets

2. Branching Mechanism

  • Users can transfer up to 70% of their exposure from one prediction to another

  • This enables dynamic portfolio rebalancing without closing positions

  • Branching maintains market liquidity while allowing strategic position adjustments

3. Capital Flow Dynamics

Exposure Transfer Flow:
1. User has exposure in Prediction A (10 ETH Yes, 5 ETH No)
2. User branches 70% exposure to Prediction B
3. Prediction A retains: 3 ETH Yes, 1.5 ETH No (30%)
4. Prediction B receives: 7 ETH Yes, 3.5 ETH No (70% transferred)
5. User maintains diversified exposure across both predictions

4. Branching Benefits

  • Portfolio Flexibility: Dynamically rebalance exposure across predictions

  • Risk Management: Adjust positions without closing existing bets

  • Capital Efficiency: Maintain market participation while optimizing allocations

  • Strategic Trading: Respond to market developments with exposure transfers

Smart Contract Architecture

contract PredictionChaining {
    struct Prediction {
        string question;
        uint256 stake;
        address setter;
        Outcome result;
        bool resolved;
        uint256 totalYes;
        uint256 totalNo;
        uint256 parentId;      // Links to parent prediction
        uint256[] branches;    // Child predictions
    }

    // Key Functions:
    // - createPrediction(): Create base predictions
    // - bet(): Place bets on predictions
    // - branchPrediction(): Transfer up to 70% of exposure between predictions
    // - resolve(): Settle prediction outcomes
    // - claimWinnings(): Distribute rewards
}

Tech Stack

  • Frontend: Next.js 14 (App Router), TypeScript, Tailwind CSS

  • Blockchain: ethers v6, MetaMask wallet integration

  • Network: Mantle Sepolia Testnet

  • Database: Supabase (prediction metadata and analytics)

🎯 Usage

Getting Started

  1. Connect Wallet: Click "Connect Wallet" and approve MetaMask connection

  2. Switch Network: Switch to Mantle Sepolia Testnet in MetaMask (use the network details above)

  3. Add Collateral: Deposit ETH as collateral on the Profile page

  4. Start Trading: Create predictions or place bets on existing ones

🔒 Smart Contract

The core contract implements:

contract PredictionChaining {
    // Fixed 70% LTV for borrowing & branching
    uint256 public constant LTV = 70;

    // Prediction structure with stake and outcome tracking
    struct Prediction {
        string question;
        uint256 stake;
        address setter;
        Outcome result;
        bool resolved;
        uint256 totalYes;
        uint256 totalNo;
    }

    // Key functions:
    // - createPrediction(): Create new prediction markets
    // - bet(): Place direct ETH bets
    // - betWithBorrow(): Borrow against collateral
    // - branchPrediction(): Transfer up to 70% of exposure between predictions
    // - resolve(): Set prediction outcomes
    // - claim(): Claim proportional winnings
    // - withdraw(): Withdraw collateral
}

Prediction Branching Logic

The branching feature allows users with exposure in predictions to transfer up to 70% of their stake to other predictions. This enables dynamic portfolio management and strategic rebalancing across different markets without closing existing positions.

Images

Screenshot 2026-01-15 at 6 11 09 PMScreenshot 2026-01-15 at 5 57 28 PMScreenshot 2026-01-15 at 5 59 02 PMScreenshot 2026-01-15 at 5 58 45 PM

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

队长
Jjatinsinha03
项目链接
赛道
DeFiGaming