Update bet schema

This commit is contained in:
James Grugett 2022-06-14 15:44:40 -05:00
parent c4cec29c62
commit 0c2ab5e9d7
2 changed files with 14 additions and 1 deletions

View File

@ -4,6 +4,7 @@ export type Bet = {
id: string
userId: string
contractId: string
createdTime: number
amount: number // bet size; negative if SELL bet
loanAmount?: number
@ -26,7 +27,18 @@ export type Bet = {
isLiquidityProvision?: boolean
isRedemption?: boolean
createdTime: number
// For limit orders.
limitProb?: number // [0, 1]. Bet to this probability.
isFilled?: boolean // Whether all of the bet amount has been filled.
isCancelled?: boolean // Whether to prevent any further fills.
// A record of each transaction that partially (or fully) fills the bet amount.
// I.e. A limit order could be filled by partially matching with several bets.
// Non-limit orders can also be filled by matching with multiple limit orders.
fills?: {
matchedBetId: string
amount: number
shares: number
}[]
}
export type NumericBet = Bet & {

View File

@ -21,6 +21,7 @@ const bodySchema = z.object({
const binarySchema = z.object({
outcome: z.enum(['YES', 'NO']),
limitProb: z.number().gte(0).lte(1).optional(),
})
const freeResponseSchema = z.object({