Skip to content

About

Guess whether BTC will be higher or lower in 60 seconds

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Polygamble

Guess whether BTC/USD will be higher or lower 60 seconds from now. Each guess resolves against the Binance price once the delay has elapsed: +1 for a correct call, -1 otherwise. The score persists per (anonymous) player.

Stack

  • Next.js (App Router) + React + Tailwind + tRPC + Tanstack Query
  • Drizzle ORM on libSQL — a local file in dev, Turso in production
  • Better Auth with anonymous sessions
  • Binance for the live price (client WebSocket) and historical resolution price (REST)

Run locally

  • Install nodejs (>=24) and pnpm
  • Rename .env.example to .env
  • pnpm install --frozen-lockfile
  • pnpm dev — runs pending migrations first, then starts the dev server

Tests

  • pnpm lint
  • pnpm test

Deploy

  • Point DATABASE_URL at a Turso database and set DATABASE_AUTH_TOKEN
  • Set BETTER_AUTH_SECRET (openssl rand -base64 32) and BETTER_AUTH_URL
  • pnpm db:migrate, then pnpm build and pnpm start

The server is stateless REST, so it deploys to any serverless target. The live price comes straight from Binance over a client WebSocket — no server stream to keep alive.

Schema changes

  • Edit the tables in src/db/schema, then pnpm db:generate (auth tables managed by better auth pnpm auth:generate)

About

Guess whether BTC will be higher or lower in 60 seconds

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages