Skip to content

Subho4531/eventhorizon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

91 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒŒ Horizon: Privacy-First Prediction Markets on Stellar

Horizon is a next-generation prediction market platform built on the Stellar blockchain, leveraging Soroban smart contracts and Zero-Knowledge (ZK) proofs to ensure trader privacy while providing high-fidelity market intelligence.

Live Demo GitHub Repo Feedback Stellar Next.js


๐Ÿ“‘ Table of Contents


๐Ÿ“– Project Description

Horizon redefines prediction markets by prioritizing user privacy and data integrity. By integrating Zero-Knowledge Proofs (ZKPs) on the Stellar Network, Horizon allows users to take positions on global events without revealing their specific bets until the market is resolved. This prevents front-running and manipulation, creating a fairer ecosystem for all participants.


๐ŸŽฅ Video Demo

Experience Horizon in action:

Horizon Video Demo

Watch the full walkthrough of the Privacy-First Prediction Market on Stellar.


โœจ Key Features

  • ๐Ÿ” Privacy via ZK Proofs: All bets are placed as ZK commitments. Positions remain private until the "Reveal" phase.
  • โšก Stellar/Soroban Integration: High-speed, low-cost settlement using Stellar's latest smart contract engine.
  • ๐Ÿ“Š Intelligence Dashboard: Real-time analysis of market quality, risk scores, and sentiment trends.
  • ๐Ÿ›ก๏ธ Secure Escrow: Non-custodial escrow contracts manage user funds with cryptographic certainty.
  • ๐Ÿ” Manipulation Detection: Automated systems flag suspicious trading patterns to ensure market health.
  • ๐Ÿค– Agentic Market Discovery: Autonomous AI agents identify trends and resolve markets using real-world data feeds.

๐Ÿฅ‹ Level 6: Black Belt - Agentic Evolution

Horizon has evolved into a production-grade Agentic Market Intelligence System. This transition introduces autonomous lifecycle management for markets, driven by specialized AI agents and distributed background workers.

๐Ÿค– Autonomous Agentic Pipeline

Horizon features a sophisticated multi-agent pipeline that transforms raw global data into executable on-chain markets with zero manual intervention.

  • ๐Ÿ” Deep Semantic Research: Agents utilize SerpAPI and Gemini 3 Flash to ingest real-time news, identifying emerging trends and assigning "Intelligence Scores" to potential market topics.
  • ๐Ÿ—๏ธ Agent Framework: A hybrid Python-Node.js architecture designed for seamless AI integration and high-performance worker coordination.
  • โœ… Self-Validating Resolutions: The system autonomously cross-references high-authority sources to verify event outcomes before triggering the Soroban smart contract for resolution.

โšก High-Performance Redis Pipeline

The backbone of Horizon's reliability is a distributed, Redis-driven orchestration layer that ensures the platform remains responsive under extreme loads.

  • ๐ŸŽฏ Distributed Job Orchestration: Leverages BullMQ on Upstash Redis to decouple heavy AI computation from the main API thread, maintaining a 99.9% uptime for the user terminal.
  • ๐Ÿ“ก Global State Relay: Real-time propagation of market status, scores, and resolution events across distributed worker nodes and the frontend terminal.
  • ๐Ÿ›ก๏ธ Rate-Limit Resiliency: Native Redis primitives ensure platform stability and protect against data inconsistency during high-throughput trading events.

๐Ÿ’Ž Premium UI/UX: The "Glow-Terminal"

The interface has been reimagined as a "Glow-Terminal"โ€”a premium, data-dense experience designed for the professional trader.

  • โœจ Aesthetic Excellence: Built with a custom Glow-Card System, featuring curated HSL-tailored colors, smooth CSS micro-animations, and glassmorphic overlays that create a sense of depth and focus.
  • ๐Ÿ” Zero-Knowledge UX: Simplifies the complexities of ZK-proof generation into a seamless, 3-step workflow that ensures privacy without sacrificing speed or intuition.
  • ๐ŸŒŠ Interactive Vibe: Hover-triggered lighting effects and fluid, interactive dashboards create an interface that feels "alive," responding dynamically to every trader interaction.

โœจ Gasless Transactions

Horizon now implements Stellar Fee Bump transactions! This allows users to place ZK bets completely gas-free. Our custom Relayer API handles the transaction submission and fee sponsorship.


๐Ÿ—๏ธ Architecture

graph TD
    subgraph Client ["Frontend (Next.js)"]
        UI["Horizon Terminal"]
        BM["BetModal (ZK Proof Gen)"]
        AP["Admin Panel (Bet Management)"]
        F["Freighter Wallet"]
    end

    subgraph Backend ["Server (Next.js API)"]
        API["REST API (/api/bets, /api/markets)"]
        Auth["Stellar Auth"]
        Relay["Relayer Service"]
    end

    subgraph Agents ["Agentic Market Engine"]
        Worker["BullMQ Worker (Node.js)"]
        AE["Agent Engine (Python/Gemini)"]
        TD["Topic Discovery"]
        MR["Market Resolver"]
    end

    subgraph Storage ["Data Layer"]
        DB[("PostgreSQL (Prisma)")]
        Redis[("Redis (BullMQ)")]
        LS["localStorage (ZK Portfolio)"]
    end

    subgraph Blockchain ["Stellar Network"]
        SC["Soroban Smart Contracts"]
        Ledger["Stellar Ledger"]
    end

    %% Interactions
    UI --> BM
    UI --> AP
    BM -- "1. Generate Proof" --> BM
    BM -- "2. Sign Transaction" --> F
    F -- "3. Submit to Chain" --> SC
    SC -- "4. Emit Event" --> Ledger
    Ledger -- "5. Index Event" --> Relay
    Relay -- "6. Update DB" --> DB
    API -- "Fetch Data" --> DB
    UI -- "Request Data" --> API
    BM -- "Store Nullifier" --> LS
    
    %% Agentic Flow
    API -- "Enqueue Job" --> Redis
    Redis -- "Pull Job" --> Worker
    Worker -- "Call" --> AE
    AE -- "Search & Analyze" --> TD
    AE -- "Resolve Markets" --> MR
    TD -- "Auto-Create" --> API
    MR -- "Submit Resolution" --> SC
Loading

๐Ÿ“œ Smartcontract Details

Horizon's core logic is governed by a Soroban smart contract deployed on the Stellar Testnet.

  • Contract ID: CAIU27X7UNPW3ZOG27CQAFNZODL3F2DFVZRBUZS6G2NFX7WWANBXN356
  • Network: Stellar Testnet
  • Explorer: Stellar.Expert View

Contract Deployment Screenshot

Stellar Expert Screenshot


๐ŸŒŸ Project Vision

Horizon's mission is to build the world's most trusted, private, and intelligence-driven prediction market ecosystem. We believe that Privacy is a Human Right, and in the realm of prediction markets, it is the key to preventing manipulation and ensuring that the "Wisdom of the Crowd" is truly unbiased.

  • Decentralized Truth: Leveraging Stellar's immutable ledger to create a transparent source of record for global events.
  • Privacy by Default: Using Zero-Knowledge Proofs to protect individual strategies and positions.
  • Intelligence-First: Moving beyond simple betting to provide high-fidelity sentiment analysis and risk metrics.
  • Global Empowerment: Providing anyone, anywhere, with the tools to hedge against future uncertainty.

๐Ÿš€ Future Scope

The journey has just begun. Our roadmap for the next 12-18 months includes:

  1. ๐Ÿค– Horizon AI Curator: Integrating Large Language Models to automatically create markets from real-time news feeds and manage liquidity.
  2. ๐ŸŒ Cross-Chain ZK-Rollups: Expanding Horizon's privacy primitives to Ethereum, Polygon, and beyond via decentralized bridges.
  3. ๐Ÿ“ฑ Mobile-Native Experience: A high-performance mobile app featuring biometric-secured ZK proof generation and instant push alerts.
  4. ๐Ÿฆ Institutional Liquidity Pools: Specialized vaults for market makers and institutional hedgers with advanced risk management tools.
  5. ๐Ÿ›ฐ๏ธ Decentralized Oracle Network: A bespoke oracle system utilizing multi-party computation (MPC) for automated and dispute-free resolutions.
  6. ๐ŸŽฎ Gamified Prediction Tiers: Introducing reputation-based tiers, social trading leaderboards, and ZK-verified performance badges.

๐Ÿ–ผ๏ธ UI Screenshots

๐Ÿ’Ž Updated UI Terminal (Glow-Terminal)

Horizon Updated UI

๐Ÿš€ Main Dashboard

Horizon Dashboard

๐ŸŒ Global Markets

Global Markets

๐Ÿ“Š Market Overview & Analysis

Market Overview

๐Ÿ“ฑ Responsive Design (Mobile Ready)

Responsive UI

๐Ÿ’ผ User Portfolio

Portfolio

๐Ÿ† Leaderboard

Leaderboard

๐Ÿ” Admin Panel: Transaction Stream

Admin Transactions

โš–๏ธ Admin Panel: Market Resolution

Admin Resolution

โ›“๏ธ On-Chain ZK Transaction

ZK Transaction


๐Ÿ“ User Onboarding & Feedback

We value community input and actively iterate on our platform based on user experiences. We have scaled to 30+ verified active users.

Review Project Feedback Sheet

๐Ÿ‘ฅ Table 1: Onboarded Users (Level 5 & Level 6)

User Name User Email User Wallet Address
Rohit Acharya rohitacharya25@gmail.com GCFJQCTGFO5QXE5F6TYFRARFDX3O2GXSJ56N37ZBEX4V5LQYQKU54IQH
Deep Saha sdeep027@gmail.com GAPZFL43CLQZUZTVH4XGC7XPY7WGWD7RI2D4E2IQGFDFVYZN4BI7GMVL
Sumit Sarkar sumit087@gmail.com GAVAIWLB3PBWMVKPDHLDVRAS7VH4DA2SXW3W2G7V5QLJ6DK3HY3AJVAN
Samrat Natta samratnatta993@gmail.com GBTLRERJBUOHFIIZCHAOTXSSQ2UF5BU6WFYMXCMHY672II75LXXB3FAI
Nilarpan Jana nnilarpan@gmail.com GCQM3XP3IWUY3LCPDIP4QRLB7VIL2DY2QLZJ2KG2NANWUAFAZ3ULECUQ
Tanaj Das tdas06@gmail.com GDZR3O22WSIJRT25KIIY4UYDJXFHME7BEEHDMCUT2TAEI6SR7L2B5MUY
Srijit Kundu sgamer34@gmail.com GDVEBVTVNOD75J5AFRYJW7I2IPT2Q7AJOUCRB6F7C753MIH4MYQANTVI
Sambhas Maiti sambhasmaiti03@gmail.com GDTDI2OH76ATUC6HUDAX3KUK74AMIL33BVNFJG2UBTBFJXOXQ2PNU53A
Samrat Trader mamotadasmamotadas@gmail.com GCRG5UZWUAFUEC67XU4Q6GUYLA4OGR3EBKEVFMXTJ34HI6QTQAP6T7L7
Cosmeon Trader nilarpanj@gmail.com GAIQM3ISTUYHANMIJ2ZYUCLGALE6UYWYIORVS7XA43YJ6WAHWZW2XR7G
Sylvia Barick taniabarick15@gmail.com GBYOEY63WVKXY5KTSQZG4FGCDYY2CV7K3SH4ZSVN6IFDWJ464HPFIEIQ
Nitesh Jana niteshjana11@gmail.com GCKL2H6GSQ5XB5OZE2IAVFKIYZ3XCEUEXPWRME2EO4UYPUFDAA2INWJW
Sumit Dey sumitdey456@gmail.com GARFTDEIFIAD34FRNTLESZEXSCROQVPT76WZVA5WKPQ5UREDF3BTCYMK
Sayan Koley sayankoley.trader@gmail.com GCVSH65WNB6IM3LPC5DMEEY5WXQ5ISX62STSGBYIRKRWSEMZ4S2LHPD7
Arnab Jana arnabjan99@gmail.com GCQVBE7IDEBEL7RCLYFYKKUK3YD4VKVYYXXZFHPSJ63KWDSPCIADJKEL
Sneha Chakraborty snehachakraborty21@gmail.com GAVTHBVKWAS7WBUN2NHROAGK376VDDRUZ5GYQVMDMUNLAYPS7EPXLWHX
Avik Banerjee avikbanerjee08@gmail.com GBVPJ2TF6KS6OESEBU3HGXNMFHNWWLI4FYAYU63EH6HKQRBMP45DWTJH
Trailokya Nath Roy trailokyanroy@gmail.com GDFM62TGZ3RDCK7M2DJDW35QDPWC65GVHVX63JYGHQQUYXWYMZYG4PR7
Debashis Bhattacharya debashis.bhat07@gmail.com GAEYXWJUKWF6KQPCN6WWJMIO5KARFGZ54UEM572JONF2W5TUAUNCEPXO
Subhrajit Mandal subhrajitmandal2k@gmail.com GAKD4A6VJLWXN2WOD4ICDECH7DUTPTKMXXR522P2S6WS4LTA5WQKPNO6
Pranab Chatterjee pranabchat01@gmail.com GBG25BTFV5NHSBCMTM7U2AMN27SBDRGR5ZXRJ5EDIL4MCG62L2ST5Z7P
Babai Chakraborty babai.chakra@gmail.com GC5VDVJDUYWPANLIOTNDSKR34JYISLULHLKIYRG7ER6TCRMNCWYQWEBA
Koushik Biswas koushikbiswas77@gmail.com GAYIDOBUXAMHDEDMQIBSGYXFUVZLIW7ZM6S3NCVYFLDU6RS56SRA42ZJ
Alok Nath Sarkar aloknathsarkar@gmail.com GBLU63FD4SKHEFU2TJVWOTB7L7ZZMCE2VERTYLRGGLIYTLBIRTX4ERFC
Alik Das alikdas2003@gmail.com GDRSCM4LBC43CNRV3MI5Q3IV5PIMI3JCUQZTSGS3HCVUCTQTYGHXNUX6
Guddu Sharma guddu.sharma007@gmail.com GCRJPX6Z6ELK5TH3RQSB6LEFSTRV25OVSIWHTXEW5IKTW5J2PXZE2JPM
Quazi Rahul quazirahul.trader@gmail.com GBV2VSXKD6CY3XNZOVKIWAEXBHYU3XDQWOGOZSFI27SDCA6SGST73ZBQ
Aniket Mukherjee aniketmukh2024@gmail.com GBAEHJGSF4DVGBMXOTWWHNAMRX2DXET66D4ZB5GGTO2MFB2NRC3BMKSS
Mrityunjay Mondal mrityunjay.mondal@gmail.com GACGOQPB3GXBQOE4FSOOKQVOK7AZXD75IQTWUSPF6C7TYXATN2ZQ6HSJ
Shinzo Das shinzodas99@gmail.com GA7PQOUEGWQTVKYNO4GXKBEE7H6LQE7GYTYSGQ4AIIRFBWPXJIBEUJJF

๐Ÿ’ฌ Table 2: User Feedback Implementation

User Name User Email User Wallet Address User Feedback Commit ID
Sumit Sarkar sumit087@gmail.com GAVAIWLB3PBWMVKPDHLDVRAS7VH4DA2SXW3W2G7V5QLJ6DK3HY3AJVAN Reduce the loading time of the app 8512a70 (Local Caching for faster loading)
Rohit Acharya rohitacharya25@gmail.com GCFJQCTGFO5QXE5F6TYFRARFDX3O2GXSJ56N37ZBEX4V5LQYQKU54IQH ADD Live Trading Events that are most recent d394fc9 (Agentic AI implementation for live events)
Deep Saha sdeep027@gmail.com GAPZFL43CLQZUZTVH4XGC7XPY7WGWD7RI2D4E2IQGFDFVYZN4BI7GMVL AI Probability score shows wrong 8e9234c (Fixed agent pipeline and probability logic)
Nilarpan Jana nnilarpan@gmail.com GCQM3XP3IWUY3LCPDIP4QRLB7VIL2DY2QLZJ2KG2NANWUAFAZ3ULECUQ UX can be improve 467815a (Improved dashboard visuals & UX)
Subhrajit Mandal subhrajitmandal2k@gmail.com GAKD4A6VJLWXN2WOD4ICDECH7DUTPTKMXXR522P2S6WS4LTA5WQKPNO6 The UI is clean, just fix minor bugs d4ddcef (Updated dashboard and fixed minor UI errors)

๐Ÿ”ฎ Next Phase Improvements (Based on Feedback)

Based on the collected user feedback in our Level 6 cohort, we plan to evolve the project with the following updates:

  1. Live Trading Events: Users requested more real-time notifications and live events for recent markets. We will introduce WebSocket-driven market subscriptions in our next iteration (Commit tracking: 931e9a3).
  2. Further Performance Tweaks: We will introduce a more optimized WASM client to address mobile loading speed concerns raised by users (Commit tracking: 7e0ec4b).
  3. Enhanced Advanced AI Modeling: Updating the Python agents to provide better AI probability accuracy out-of-the-box (Commit tracking: 56c9ffc).
  4. Community Features: Adding a portfolio tracker and chat/forum capabilities to enhance the trader experience (Commit tracking: f42bf0c, bc89083).

๐ŸŽ–๏ธ Level 6 Requirements Checklist

  • 30+ verified active users: Onboarded and tracked via Google Sheets.
  • Metrics Dashboard Live: Track DAU, transactions, and retention.
  • Security Checklist Completed: View Security Checklist
  • Monitoring Active: System health and RPC metrics are actively monitored.
  • Data Indexing Implemented: Custom Relayers + Prisma Postgres sync.
  • Full Documentation: Present in this README.
  • Community Contribution: Twitter Post (Horizon Agentic Release)
  • Advanced Feature Implemented: Fee Sponsorship (Gasless transactions via fee bump)
  • Minimum 15+ Meaningful Commits: Maintained actively.

๐ŸŒŸ Advanced Feature: Fee Sponsorship

Horizon now implements Stellar Fee Bump transactions! This allows users to place ZK bets completely gas-free. Our custom Relayer API handles the transaction submission and fee sponsorship.

Fee Sponsorship Architecture

๐Ÿ“ข Community Contribution

As part of scaling our product and engaging the broader Stellar ecosystem, we actively promoted Horizon on our social channels!

Community Contribution


๐Ÿš€ Getting Started

Prerequisites

  • Node.js 20+
  • PostgreSQL instance
  • Freighter Wallet extension

Installation

  1. Clone the repository:

    git clone https://github.com/Subho4531/eventhorizon.git
    cd eventhorizon
  2. Install dependencies:

    npm install
  3. Environment Setup: Copy .env.example to .env and fill in your credentials:

    cp .env.example .env
  4. Database Migration:

    npx prisma migrate dev
  5. Run the development server:

    npm run dev

๐Ÿ› ๏ธ Tech Stack

Horizon is built using a modern, high-performance stack optimized for security and scale.

  • Frontend: Next.js Tailwind CSS Framer Motion
  • Blockchain: Stellar Soroban Freighter
  • Backend: Node.js Prisma
  • Agentic Engine: Python Gemini AI BullMQ Redis
  • Database: PostgreSQL
  • Security: ZK-Proofs Circuit
  • Testing: Vitest

๐Ÿ“‚ Project Structure

โ”œโ”€โ”€ app/               # Next.js App Router (Pages & API)
โ”œโ”€โ”€ components/        # Reusable UI components
โ”œโ”€โ”€ contracts/         # Soroban Smart Contracts (Rust)
โ”œโ”€โ”€ lib/               # Shared utilities & blockchain logic
โ”œโ”€โ”€ prisma/            # Database schema & migrations
โ”œโ”€โ”€ public/            # Static assets
โ”œโ”€โ”€ scripts/           # Deployment & maintenance scripts
โ””โ”€โ”€ tests/             # Unit & integration tests

๐Ÿค Contributing

We welcome contributions from the community! Whether you're fixing a bug, suggesting a feature, or improving documentation, your help is appreciated.

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

๐Ÿ“œ License

This project is licensed under the MIT License.


Made with โค๏ธ for the Stellar Ecosystem

About

Horizon is a next-generation prediction market platform built on the Stellar blockchain, leveraging Soroban smart contracts and Zero-Knowledge (ZK) proofs to ensure trader privacy while providing high-fidelity market intelligence.

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors