This repository contains a full-stack prediction market project built for HackSMU26. It combines an on-chain program written with Anchor/Rust, indexer and backend scripts, and a Next.js frontend to create markets, place bets, and view leaderboards.
Key highlights
- On-chain program: contracts/programs/hack_odds — Anchor + Rust smart contract for market logic and settlement.
- Frontend: frontend — Next.js + TypeScript UI that interacts with the Anchor program and wallet providers.
- Tooling & scripts: scripts and services/indexer for local setup, seeding, minting, and data sync.
- Tests: tests includes program/integration tests exercising core market flows.
Why this is recruiter-friendly
- Demonstrates full-stack blockchain engineering across Rust/Anchor and TypeScript/React.
- Shows real-world concerns: program design, IDLs, client wrappers, and indexing/syncing.
- Contains scripts and documentation to run and test locally.
Tech stack
- Solana, Anchor (Rust)
- TypeScript, Next.js, React
- Node.js scripts for deployment and data tooling
- SQLite/Postgres-compatible SQL migrations in database/
Repository layout (high level)
- contracts/ — Anchor project, program source, migrations, and IDL artifacts.
- frontend/ — Next.js app and React components.
- scripts/ — CLI-style scripts for minting, seeding, and local setup.
- services/indexer/ — data sync logic to populate the application DB.
- tests/ — integration tests for the on-chain program.
- database/ — SQL schema and seed files.
Quick start (local development)
- Prerequisites: Node.js (>=16), Rust & Cargo, Solana CLI, Anchor.
- Start local Solana validator (or use devnet):
# start a local validator (example)
solana-test-validator --reset- Build and deploy the Anchor program locally:
cd contracts
anchor build
anchor deploy --provider.cluster localnet- Install and run the frontend:
cd frontend
npm install
npm run dev- Use the provided scripts in scripts/ to mint tokens, create markets, and seed sample data.
Tests
- Run on-chain tests from the workspace root (example):
npm run testNotes for maintainers
- IDL files and compiled program artifacts live under target/idl and target/deploy.
- Update frontend/lib/anchor/client.ts if program IDs or IDLs change.
Contributing
- Contributions welcome — open issues or PRs for features, docs, or fixes. If you modify on-chain logic, include/update integration tests and IDLs.
Contact
- Project created for HackSMU26. For questions or help running locally, open an issue or contact the repo author.