Goals
- Define and ship a complete working prototype in 2.5 weeks
Stage 1: Build out MVP
- Timeline: 5 days
- Auth: Firebase Auth
- DB: Firestore
User Stories
- Creator Scott can:
- Sign in to the site by email/Google
- Create a new binary market by asking a question
- Resolve the market
- Trader Joanne can:
- View a specific market created by Scott (by the link)
- Chart of historical probability data
- List of all past bets
- Sign in to the site by email/Google
- Grant her $1000 of fake money
- Place a bet on a market
- View all her past and current bets
Pages
mantic.markets/contract
mantic.markets/contract/COVID-123
- View and bet on a contract
- For market creator: show market resolution options
- Page elements:
- Question + description of market
- Chart with implied probability
- Current implied prob in easily-viewable format
- List of recent bets (anonymous)
- Size of YES and NO pots
- Total contract volume
- Later: comments section
mantic.markets/contracts
- List the top unresolved contracts by volume
mantic.markets/account
- Show your user-created markets
mantic.markets/account/ScottAlexander
- View created markets, bet history, profile information
mantic.markets/portfolio
- Show your full bet history + open positions
Data structures
export type User = {
id: 'sd8v0saf90is' // Generated Firebase Auth id
email: '[email protected]' // Email address
name: 'Scott Alexander' // Full name
username: 'ScottAlexander' // Used for public identification
avatar: '<https://avatars3.githubusercontent.com/u/1234?s=460&v=4>' // Avatar URL
balance: 10000 // Current balance in M$
createdTime: 123456789 // Timestamp in millis since epoch
lastUpdatedTime: 123456789
~~// Derived info (e.g. denormalized for caching)
contracts: [] // List of contracts created by this user
bets: [] // List of bets placed by this user~~
}
export type Contract = {
id: 'COVID-123' // Chosen by creator; must be unique
creatorId: 'sd8v0saf90is'
question: 'Will at least 1% of U.S. COVID-19 cases be from the Omicron variant on January 1, 2022?'
description: '....' // More info about what the contract is about
outcomeType: 'binary' // | 'multi' | 'interval' | 'date'
// outcomes: ['YES', 'NO']
seedAmounts: { YES: number, NO: number } // seedBets: [number, number]
pot: { YES: number, NO: number }
createdTime: 123456789
lastUpdatedTime: 123456789 // If the question or description was changed
closeTime?: 2345697 // When no more trading is allowed
isResolved: boolean
resolutionTime?: 10293849 // When the contract creator resolved the market; 0 if unresolved
resolution?: 'YES' | 'NO' | 'CANCEL' // Chosen by creator; must be one of outcomes
~~// Derived info
bets: []~~
}
// Firestore subcollection of a Contract
// Stephen: maybe a top-level collection? Need to query by user across all contracts
// James: I think you can query across sub-collections now (by userId), so it might be fine.
export type Bet = {
id: string
userId: 'sd8v0saf90is'
contractId: 'COVID-123'
size: 100 // Amount of USD bid
outcome: 'YES' | 'NO' // Chosen outcome
createdTime: 123456789
// Derived info
dpmWeight: 1238
}