Skip to content

Repository files navigation

ArcCast — Arc Prediction Market

A stablecoin-native prediction market and financial dashboard for Arc Testnet. The monorepo contains:

  • contracts: factory-deployed, escrowed pari-mutuel markets
  • supabase: primary backend schema and Edge Functions for market indexing and metadata
  • frontend: Vite/React app with Wagmi, Viem and Circle App Kit
  • backend: legacy Express API kept as a fallback, not required for Supabase deployments

Setup

Requires Node.js 22+.

npm install
cp contracts/.env.example contracts/.env # if deploying
cp frontend/.env.example frontend/.env
npm run build

Deploy the factory:

npm run deploy:arc --workspace contracts

Copy the deployed address to PREDICTION_MARKET_ADDRESS and VITE_PREDICTION_MARKET_ADDRESS, then run:

npm run dev

Frontend: http://localhost:5173

Supabase backend

Supabase is the primary backend for market data and admin metadata. Apply supabase/migrations/202608290001_arc_cast_backend.sql, then deploy these Edge Functions:

  • sync-markets: indexes MarketCreated, Staked, MarketResolved, and WinningsClaimed logs from ArcScan into Supabase tables.
  • admin-market-metadata: updates protected market metadata from the admin panel.

Required Supabase project secrets:

PREDICTION_MARKET_ADDRESS=0x1834242073c7dC8ecBf10bf096876d0460DaEc1F
ARCSCAN_API_URL=https://testnet.arcscan.app/api
ADMIN_API_KEY=...

Required frontend env:

VITE_SUPABASE_URL=https://your-project-ref.supabase.co
VITE_SUPABASE_PUBLISHABLE_KEY=sb_publishable_...

If those frontend variables are missing, the app falls back to the legacy Express API through VITE_API_URL.

Manual administration

Open /admin and connect the wallet that deployed the factory. The admin panel creates markets directly through MarketFactory, saves protected off-chain metadata through Supabase Edge Functions, and resolves expired markets through their resolver wallet.

To seed the three starter markets, configure contracts/.env, then run:

npm run seed:arc --workspace contracts

Without a deployer key and factory address, the seed command prints a dry-run payload and does not submit transactions.

Security and money semantics

Stakes use the USDC ERC-20 at 0x3600…0000; the client reads decimals() before parsing amounts. Arc's native gas currency is also USDC but has 18 native decimals—these are separate representations. Market resolution is restricted to each market's creator. The backend admin resolution route intentionally does not sign until an oracle policy and production secret management are configured.

About

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages