From 90a75985dd112747906cfc33ee7916cef824f394 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Mon, 11 Jul 2022 11:46:07 -0500 Subject: [PATCH] In market bets tab, show limit orders' total order amount --- web/components/feed/feed-bets.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/web/components/feed/feed-bets.tsx b/web/components/feed/feed-bets.tsx index 2ffdae8e..83656f8e 100644 --- a/web/components/feed/feed-bets.tsx +++ b/web/components/feed/feed-bets.tsx @@ -78,11 +78,19 @@ export function BetStatusText(props: { const { bet, contract, bettor, isSelf, hideOutcome } = props const { outcomeType } = contract const isPseudoNumeric = outcomeType === 'PSEUDO_NUMERIC' + const isFreeResponse = outcomeType === 'FREE_RESPONSE' const { amount, outcome, createdTime } = bet const bought = amount >= 0 ? 'bought' : 'sold' + const outOfTotalAmount = + bet.limitProb !== undefined && bet.orderAmount !== undefined + ? ` / ${formatMoney(bet.orderAmount)}` + : '' const money = formatMoney(Math.abs(amount)) + const hadPoolMatch = + bet.fills?.some((fill) => fill.matchedBetId === null) ?? false + return (
{bettor ? ( @@ -91,6 +99,7 @@ export function BetStatusText(props: { {isSelf ? 'You' : 'A trader'} )}{' '} {bought} {money} + {outOfTotalAmount} {!hideOutcome && ( <> {' '} @@ -103,7 +112,12 @@ export function BetStatusText(props: { />{' '} {isPseudoNumeric ? ' than ' + formatNumericProbability(bet.probAfter, contract) - : ' at ' + formatPercent(bet.probAfter)} + : ' at ' + + formatPercent( + hadPoolMatch || isFreeResponse + ? bet.probAfter + : bet.limitProb ?? bet.probAfter + )} )}