Working tree is now the canonical repo. Off-chain play-money + trustless on-chain (FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution, mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
319 lines
9.2 KiB
TypeScript
319 lines
9.2 KiB
TypeScript
import { Contract } from 'common/contract'
|
|
import { LinkPreviews } from 'common/link-preview'
|
|
import { Headline } from 'common/news'
|
|
import { Dashboard } from 'common/dashboard'
|
|
|
|
export interface StateElectionMarket {
|
|
slug: string
|
|
state: string
|
|
additionalSlugs?: string[]
|
|
otherParty?: 'Democratic Party' | 'Republican Party'
|
|
}
|
|
|
|
export const NH_LINK =
|
|
'https://www.cnn.com/2024/01/09/politics/cnn-new-hampshire-poll/index.html'
|
|
|
|
// Headline aggregate markets for the 2026 midterm page. All community-created;
|
|
// chosen as the best-trafficked market for each top-line question.
|
|
export const MIDTERMS_2026 = {
|
|
// Multi-choice "who controls Congress" — the page's hero card. Congress-only
|
|
// (Senate + House, no presidential dimension), which fits a midterms page
|
|
// where the presidency isn't on the ballot.
|
|
balanceOfPower: 'who-controls-congress-after-the-202',
|
|
// Binary, YES = Republicans hold the House.
|
|
houseControl: 'republicans-have-house-majority-aft',
|
|
// Binary, YES = Republicans win the Senate.
|
|
senateControl: 'will-republicans-win-the-senate-in-738388924521',
|
|
// Independent multi-choice; each answer is a district, YES = Democrat wins.
|
|
houseDistricts: 'will-a-democrat-win-these-us-house',
|
|
} as const
|
|
|
|
// 2028 presidential election — the most-traded "who will be elected president"
|
|
// market, shown as candidate faces at the top of the page.
|
|
export const PRESIDENT_2028_SLUG = 'who-will-be-elected-president-in-20'
|
|
|
|
// 2028 presidency by party — the most-traded "which party wins" market. Shown as
|
|
// a Democrat-vs-Republican head-to-head bar under the candidate field.
|
|
export const PRESIDENT_2028_PARTY_SLUG =
|
|
'which-political-party-wins-the-us-p-nUsCQcZ6Lc'
|
|
|
|
// Notable 2026 primary races (community markets) — a compact watch-list. Each is
|
|
// the best-trafficked multi-choice market for that primary. Resolved/closed ones
|
|
// are filtered out at fetch time, so this can degrade gracefully as races land.
|
|
export const PRIMARIES_2026 = [
|
|
'michigan-democratic-senate-primary', // MI — Democratic Senate primary
|
|
'who-will-win-the-2026-massachusetts', // MA — Democratic Senate primary
|
|
'who-will-win-the-2026-minnesota-dem', // MN — Democratic Senate primary
|
|
'who-will-the-democratic-primary-for', // MN — Democratic Governor primary
|
|
'who-will-win-the-2026-republican-pr', // FL — Republican Governor primary
|
|
'who-wins-missouris-1st-congressiona', // MO-01 — Democratic House primary
|
|
'survivor-2026-whose-gop-primary-tor', // National — GOP incumbents vs. Trump
|
|
]
|
|
|
|
// Mid-decade redistricting markets (community) — their own watch-list so they
|
|
// don't crowd the Trending block. Best-trafficked, 2026-relevant questions;
|
|
// resolved/closed ones are filtered out at fetch time.
|
|
export const REDISTRICTING_2026 = [
|
|
'large-states-redistrict-before-2026', // Multi — which large states redistrict
|
|
'virginia-redistricting-will-the-cha', // VA — Charlottesville district blue?
|
|
'if-the-texas-gop-succeeds-in-redist', // TX — GOP gains seats if it redistricts
|
|
'will-texass-2025-redistricting-map', // TX — 2025 map used in the 2026 midterms
|
|
'virginia-redistricting-before-midte', // VA — redistricting before midterms
|
|
'florida-redistricting-before-2026-m', // FL — redistricting before midterms
|
|
]
|
|
|
|
export const presidency2024: StateElectionMarket[] = [
|
|
{
|
|
state: 'AL',
|
|
slug: 'which-party-will-win-the-us-preside-98654274ab42',
|
|
},
|
|
{
|
|
state: 'AK',
|
|
slug: 'which-party-will-win-the-us-preside-3834d8e5168f',
|
|
},
|
|
{
|
|
state: 'AZ',
|
|
slug: 'will-trump-win-arizona-in-the-2024',
|
|
},
|
|
{
|
|
state: 'AR',
|
|
slug: 'which-party-will-win-the-us-preside-e845a612e2a4',
|
|
},
|
|
{
|
|
state: 'CA',
|
|
slug: 'which-party-will-win-the-us-preside-26a1eb1b8ce6',
|
|
},
|
|
{
|
|
state: 'CO',
|
|
slug: 'which-party-will-win-the-us-preside-995251995021',
|
|
},
|
|
{
|
|
state: 'CT',
|
|
slug: 'which-party-will-win-the-us-preside-12e8e8ae4aee',
|
|
},
|
|
{
|
|
state: 'DC',
|
|
slug: 'which-party-will-win-the-us-preside-11704714dec4',
|
|
},
|
|
{
|
|
state: 'DE',
|
|
slug: 'which-party-will-win-the-us-preside-86216dcc6ec8',
|
|
},
|
|
{
|
|
state: 'FL',
|
|
slug: 'which-party-will-win-the-us-preside-a0c0e217efb2',
|
|
},
|
|
{
|
|
state: 'GA',
|
|
slug: 'will-trump-win-georgia-in-the-2024',
|
|
},
|
|
{
|
|
state: 'HI',
|
|
slug: 'which-party-will-win-the-us-preside-878851234156',
|
|
},
|
|
{
|
|
state: 'IA',
|
|
slug: 'which-party-will-win-the-us-preside-31c9af68dec9',
|
|
},
|
|
{
|
|
state: 'ID',
|
|
slug: 'which-party-will-win-the-us-preside-e762820f4b34',
|
|
},
|
|
{
|
|
state: 'IL',
|
|
slug: 'which-party-will-win-the-us-preside-c506aa98d74d',
|
|
},
|
|
{
|
|
state: 'IN',
|
|
slug: 'which-party-will-win-the-us-preside-5414030a4a48',
|
|
},
|
|
{
|
|
state: 'KS',
|
|
slug: 'which-party-will-win-the-us-preside-4df471a7f5e3',
|
|
},
|
|
{
|
|
state: 'KY',
|
|
slug: 'which-party-will-win-the-us-preside-52290675de33',
|
|
},
|
|
{
|
|
state: 'LA',
|
|
slug: 'which-party-will-win-the-us-preside-7047ba212e02',
|
|
},
|
|
{
|
|
state: 'MA',
|
|
slug: 'which-party-will-win-the-us-preside-dcff5d64dbc8',
|
|
},
|
|
{
|
|
state: 'MD',
|
|
slug: 'which-party-will-win-the-us-preside-e43222661719',
|
|
},
|
|
// MAINE HAS MULTIPLES
|
|
{
|
|
state: 'ME',
|
|
slug: 'which-party-will-win-the-us-preside-af574b601b0f',
|
|
},
|
|
{
|
|
state: 'MI',
|
|
slug: 'will-trump-win-michigan-in-the-2024',
|
|
},
|
|
{
|
|
state: 'MN',
|
|
slug: 'which-party-will-win-the-us-preside-052a52f54c0e',
|
|
},
|
|
{
|
|
state: 'MO',
|
|
slug: 'which-party-will-win-the-us-preside-1ccd026993f1',
|
|
},
|
|
{
|
|
state: 'MS',
|
|
slug: 'which-party-will-win-the-us-preside-859f4dab533d',
|
|
},
|
|
{
|
|
state: 'MT',
|
|
slug: 'which-party-will-win-the-us-preside-5406455b109d',
|
|
},
|
|
{
|
|
state: 'NC',
|
|
slug: 'will-trump-win-north-carolina-in-th',
|
|
},
|
|
{
|
|
state: 'ND',
|
|
slug: 'which-party-will-win-the-us-preside-fab2b645d9d3',
|
|
},
|
|
// NEBRASKA HAS MULTIPLES
|
|
{
|
|
state: 'NE',
|
|
slug: 'which-party-will-win-the-us-preside-3c332029e300',
|
|
},
|
|
{
|
|
state: 'NH',
|
|
slug: 'which-party-will-win-the-us-preside-458f2140827c',
|
|
},
|
|
{
|
|
state: 'NJ',
|
|
slug: 'which-party-will-win-the-us-preside-96f0176fbd5a',
|
|
},
|
|
{
|
|
state: 'NM',
|
|
slug: 'which-party-will-win-the-us-preside-c98c13402468',
|
|
},
|
|
{
|
|
state: 'NV',
|
|
slug: 'will-trump-win-nevada-in-the-2024-p',
|
|
},
|
|
{
|
|
state: 'NY',
|
|
slug: 'which-party-will-win-the-us-preside-7c957d5b5e4c',
|
|
},
|
|
{
|
|
state: 'OH',
|
|
slug: 'which-party-will-win-the-us-preside-f2f89eddc252',
|
|
},
|
|
{
|
|
state: 'OK',
|
|
slug: 'which-party-will-win-the-us-preside-8144295e678c',
|
|
},
|
|
{
|
|
state: 'OR',
|
|
slug: 'which-party-will-win-the-us-preside-c24796f7ea73',
|
|
},
|
|
{
|
|
state: 'PA',
|
|
slug: 'will-trump-win-pennsylvania-in-the',
|
|
},
|
|
{
|
|
state: 'RI',
|
|
slug: 'which-party-will-win-the-us-preside-f7998626f959',
|
|
},
|
|
{
|
|
state: 'SC',
|
|
slug: 'which-party-will-win-the-us-preside-f0e933a475d1',
|
|
},
|
|
{
|
|
state: 'SD',
|
|
slug: 'which-party-will-win-the-us-preside-bc361a1e7ca0',
|
|
},
|
|
{
|
|
state: 'TN',
|
|
slug: 'which-party-will-win-the-us-preside-a870c481a5ce',
|
|
},
|
|
{
|
|
state: 'TX',
|
|
slug: 'which-party-will-win-the-us-preside-2ad2e0596c59',
|
|
},
|
|
{
|
|
state: 'UT',
|
|
slug: 'which-party-will-win-the-us-preside-9cd88c5b9389',
|
|
},
|
|
{
|
|
state: 'VA',
|
|
slug: 'which-party-will-win-the-us-preside-6db80c968e21',
|
|
},
|
|
{
|
|
state: 'VT',
|
|
slug: 'which-party-will-win-the-us-preside-7b9db14c6562',
|
|
},
|
|
|
|
{
|
|
state: 'WA',
|
|
slug: 'which-party-will-win-the-us-preside-8b4af904766d',
|
|
},
|
|
{
|
|
state: 'WI',
|
|
slug: 'will-trump-win-wisconsin-in-the-202',
|
|
},
|
|
{
|
|
state: 'WV',
|
|
slug: 'which-party-will-win-the-us-preside-3ffb4d1203a0',
|
|
},
|
|
{
|
|
state: 'WY',
|
|
slug: 'which-party-will-win-the-us-preside-686f75d3998e',
|
|
},
|
|
]
|
|
|
|
export const swingStates = ['WI', 'MI', 'PA', 'NV', 'AZ', 'GA', 'NC']
|
|
|
|
export type MapContractsDictionary = {
|
|
[key: string]: Contract | null
|
|
}
|
|
|
|
export type ElectionsPageProps = {
|
|
// 2028 presidential candidate market (faces + win %).
|
|
presidency2028Contract: Contract | null
|
|
// 2028 presidency-by-party market (Dem-vs-Rep head-to-head bar).
|
|
presidency2028PartyContract: Contract | null
|
|
// Per-state maps (community markets, keyed by state code).
|
|
rawSenateStateContracts: MapContractsDictionary
|
|
rawGovernorStateContracts: MapContractsDictionary
|
|
// Candidate ("who will win") markets for races that have one, keyed by state.
|
|
rawSenateCandidateContracts: MapContractsDictionary
|
|
rawGovernorCandidateContracts: MapContractsDictionary
|
|
// Headline aggregate markets.
|
|
balanceOfPowerContract: Contract | null
|
|
houseControlContract: Contract | null
|
|
senateControlContract: Contract | null
|
|
// Per-district House market (independent multi-choice).
|
|
houseDistrictsContract: Contract | null
|
|
// Notable 2026 primary markets (open only), for the watch-list section.
|
|
primaryContracts: Contract[]
|
|
// Mid-decade redistricting markets (open only), for the watch-list section.
|
|
redistrictingContracts: Contract[]
|
|
// Trending politics dashboards.
|
|
newsDashboards: NewsDashboardPageProps[]
|
|
headlines: Headline[]
|
|
trendingDashboard: NewsDashboardPageProps
|
|
}
|
|
|
|
export type SuccesNewsDashboardPageProps = {
|
|
state: 'success'
|
|
initialDashboard: Dashboard
|
|
previews: LinkPreviews
|
|
initialContracts: Contract[]
|
|
headlines: Headline[]
|
|
slug: string
|
|
}
|
|
export type NewsDashboardPageProps =
|
|
| SuccesNewsDashboardPageProps
|
|
| { state: 'not found' }
|