manifold/common/contract.ts

35 lines
1.0 KiB
TypeScript
Raw Normal View History

export type Contract = {
2022-01-10 23:52:03 +00:00
id: string
slug: string // auto-generated; must be unique
2022-01-10 23:52:03 +00:00
creatorId: string
creatorName: string
creatorUsername: string
2022-01-19 07:33:46 +00:00
creatorAvatarUrl?: string // Start requiring after 2022-03-01
2022-01-10 23:52:03 +00:00
question: string
description: string // More info about what the contract is about
tags: string[]
2022-01-10 23:52:03 +00:00
outcomeType: 'BINARY' // | 'MULTI' | 'interval' | 'date'
visibility: 'public' | 'unlisted'
mechanism: 'dpm-2'
phantomShares: { YES: number; NO: number }
2022-01-10 23:52:03 +00:00
pool: { YES: number; NO: number }
totalShares: { YES: number; NO: number }
totalBets: { YES: number; NO: number }
2022-01-10 23:52:03 +00:00
createdTime: number // Milliseconds since epoch
lastUpdatedTime: number // If the question or description was changed
closeTime?: number // When no more trading is allowed
2022-01-10 23:52:03 +00:00
isResolved: boolean
resolutionTime?: number // When the contract creator resolved the market
2022-01-22 23:59:50 +00:00
resolution?: outcome // Chosen by creator; must be one of outcomes
2022-01-10 23:52:03 +00:00
volume24Hours: number
volume7Days: number
}
2022-01-22 23:59:50 +00:00
export type outcome = 'YES' | 'NO' | 'CANCEL' | 'MKT'