diff --git a/common/antes.ts b/common/antes.ts index e2c7028c..3604d941 100644 --- a/common/antes.ts +++ b/common/antes.ts @@ -43,6 +43,7 @@ export function getAnteBets( probBefore: p, probAfter: p, createdTime, + isAnte: true, } const noBet: Bet = { @@ -55,6 +56,7 @@ export function getAnteBets( probBefore: p, probAfter: p, createdTime, + isAnte: true, } return { yesBet, noBet } diff --git a/common/bet.ts b/common/bet.ts index 9cbecc9d..a875102c 100644 --- a/common/bet.ts +++ b/common/bet.ts @@ -17,6 +17,7 @@ export type Bet = { } isSold?: boolean // true if this BUY bet has been sold + isAnte?: boolean createdTime: number } diff --git a/web/components/bets-list.tsx b/web/components/bets-list.tsx index c375e167..c237d17c 100644 --- a/web/components/bets-list.tsx +++ b/web/components/bets-list.tsx @@ -312,10 +312,26 @@ function BetRow(props: { bet: Bet; contract: Contract; saleBet?: Bet }) { probAfter, shares, isSold, + isAnte, } = bet + const { isResolved, closeTime } = contract const isClosed = closeTime && Date.now() > closeTime + const saleAmount = saleBet?.sale?.amount + + const saleDisplay = bet.isAnte ? ( + 'ANTE' + ) : saleAmount !== undefined ? ( + <>{formatMoney(saleAmount)} (sold)> + ) : ( + formatMoney( + isResolved + ? resolvedPayout(contract, bet) + : calculateSaleAmount(contract, bet) + ) + ) + return (