Update bet schema
This commit is contained in:
parent
c4cec29c62
commit
0c2ab5e9d7
|
@ -4,6 +4,7 @@ export type Bet = {
|
||||||
id: string
|
id: string
|
||||||
userId: string
|
userId: string
|
||||||
contractId: string
|
contractId: string
|
||||||
|
createdTime: number
|
||||||
|
|
||||||
amount: number // bet size; negative if SELL bet
|
amount: number // bet size; negative if SELL bet
|
||||||
loanAmount?: number
|
loanAmount?: number
|
||||||
|
@ -26,7 +27,18 @@ export type Bet = {
|
||||||
isLiquidityProvision?: boolean
|
isLiquidityProvision?: boolean
|
||||||
isRedemption?: 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 & {
|
export type NumericBet = Bet & {
|
||||||
|
|
|
@ -21,6 +21,7 @@ const bodySchema = z.object({
|
||||||
|
|
||||||
const binarySchema = z.object({
|
const binarySchema = z.object({
|
||||||
outcome: z.enum(['YES', 'NO']),
|
outcome: z.enum(['YES', 'NO']),
|
||||||
|
limitProb: z.number().gte(0).lte(1).optional(),
|
||||||
})
|
})
|
||||||
|
|
||||||
const freeResponseSchema = z.object({
|
const freeResponseSchema = z.object({
|
||||||
|
|
Loading…
Reference in New Issue
Block a user