Key Database Concepts
Markets Table
Stores market metadata and status:
- Metadata: Question, description, category
- Status: pending_match, active, closed, resolved
- Pools: Cached pool sizes (synced from contract)
- Timing: Close time, resolution time
- Community: Links to community
- Creator: Who created the market
User Profiles
User information stored off-chain:
- Identity: Username, handle, avatar
- Settings: Preferences, notifications
- Credibility: Score and voting history
- Wallet: Links to on-chain wallet address
Communities
Community organization:
- Metadata: Name, description, icon
- Settings: Public/private, permissions
- Membership: Who belongs to community
- On-chain link: Community ID for contract integration
Positions (Historical)
Note: Current system uses on-chain token balances for positions. The database may store historical position data for analytics, but active positions are read from contracts.
Voting System
Vote records and outcomes:
- Votes: User votes on market outcomes
- Credibility: How votes are weighted
- Outcomes: Determined from weighted votes
- Rewards: Tracked for correct votes