Skip to content

About

A Polymarket-style trading interface connected to a live Solana devnet program.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Prediction Market - Frontend

A Polymarket-style trading interface connected to a live Solana devnet program.

What I Built

  • Market discovery with grid and table views (sparkline price charts in table rows)
  • On-chain trading via LMSR -- buy/sell YES/NO shares with real wallet transactions
  • LMSR price math mirrored in TypeScript to match the Rust program exactly
  • Create market form that deploys new markets to Solana
  • Portfolio page showing real token balances from on-chain data
  • Bet slip (floating trade panel) for quick order entry
  • IPFS image uploads via Pinata for market thumbnails
  • Dark/light theme toggle
  • Wallet adapter integration (Phantom, Solflare)

What I Learned

  • Anchor client-side integration -- deserializing on-chain accounts, building transactions
  • Porting fixed-point math (exp, ln, log-sum-exp) from Rust to TypeScript
  • Solana wallet adapter patterns with React context
  • Building responsive trading UIs with Recharts and Framer Motion
  • Working with PDAs from the frontend (deriving addresses, passing to instructions)

Tech Stack

Next.js 16, React 19, TypeScript, Tailwind CSS 4, Recharts, Framer Motion, @coral-xyz/anchor, @solana/wallet-adapter

Run It

pnpm install
pnpm dev

Environment Variables

Variable Description
NEXT_PUBLIC_PINATA_JWT Pinata API key for IPFS uploads
NEXT_PUBLIC_PINATA_GATEWAY Pinata gateway URL

License

MIT

About

A Polymarket-style trading interface connected to a live Solana devnet program.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors