A stablecoin-native prediction market and financial dashboard for Arc Testnet. The monorepo contains:
contracts: factory-deployed, escrowed pari-mutuel marketssupabase: primary backend schema and Edge Functions for market indexing and metadatafrontend: Vite/React app with Wagmi, Viem and Circle App Kitbackend: legacy Express API kept as a fallback, not required for Supabase deployments
Requires Node.js 22+.
npm install
cp contracts/.env.example contracts/.env # if deploying
cp frontend/.env.example frontend/.env
npm run buildDeploy the factory:
npm run deploy:arc --workspace contractsCopy the deployed address to PREDICTION_MARKET_ADDRESS and
VITE_PREDICTION_MARKET_ADDRESS, then run:
npm run devFrontend: http://localhost:5173
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: indexesMarketCreated,Staked,MarketResolved, andWinningsClaimedlogs 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.
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 contractsWithout a deployer key and factory address, the seed command prints a dry-run payload and does not submit transactions.
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.