2022-03-15 22:27:51 +00:00
|
|
|
import { Fees } from './fees'
|
|
|
|
|
2022-01-10 21:07:57 +00:00
|
|
|
export type Bet = {
|
2022-01-10 23:52:03 +00:00
|
|
|
id: string
|
|
|
|
userId: string
|
|
|
|
contractId: string
|
2022-01-10 21:07:57 +00:00
|
|
|
|
2022-01-10 23:52:03 +00:00
|
|
|
amount: number // bet size; negative if SELL bet
|
2022-03-02 03:31:48 +00:00
|
|
|
loanAmount?: number
|
2022-02-17 23:00:19 +00:00
|
|
|
outcome: string
|
2022-03-15 22:27:51 +00:00
|
|
|
shares: number // dynamic parimutuel pool weight or fixed ; negative if SELL bet
|
2022-01-10 21:07:57 +00:00
|
|
|
|
2022-01-10 23:52:03 +00:00
|
|
|
probBefore: number
|
|
|
|
probAfter: number
|
2022-01-10 21:07:57 +00:00
|
|
|
|
|
|
|
sale?: {
|
2022-01-10 23:52:03 +00:00
|
|
|
amount: number // amount user makes from sale
|
|
|
|
betId: string // id of bet being sold
|
2022-01-10 21:07:57 +00:00
|
|
|
// TODO: add sale time?
|
2022-01-10 23:52:03 +00:00
|
|
|
}
|
2022-01-10 21:07:57 +00:00
|
|
|
|
2022-03-15 22:27:51 +00:00
|
|
|
fees: Fees
|
|
|
|
|
2022-01-10 23:52:03 +00:00
|
|
|
isSold?: boolean // true if this BUY bet has been sold
|
2022-01-19 22:36:55 +00:00
|
|
|
isAnte?: boolean
|
2022-03-15 22:27:51 +00:00
|
|
|
isLiquidityProvision?: boolean
|
|
|
|
isRedemption?: boolean
|
2022-01-10 21:07:57 +00:00
|
|
|
|
2022-01-10 23:52:03 +00:00
|
|
|
createdTime: number
|
|
|
|
}
|
2022-03-02 03:31:48 +00:00
|
|
|
|
2022-05-19 17:42:03 +00:00
|
|
|
export type NumericBet = Bet & {
|
|
|
|
value: number
|
|
|
|
allOutcomeShares: { [outcome: string]: number }
|
|
|
|
allBetAmounts: { [outcome: string]: number }
|
|
|
|
}
|
|
|
|
|
2022-03-02 03:31:48 +00:00
|
|
|
export const MAX_LOAN_PER_CONTRACT = 20
|