Show profit/loss in sale panel

This commit is contained in:
Austin Chen 2022-03-03 02:10:20 -08:00
parent ef77779cec
commit b4f8fcf38e

View File

@ -531,6 +531,7 @@ function SellButton(props: { contract: Contract; bet: Bet }) {
) )
const saleAmount = calculateSaleAmount(contract, bet) const saleAmount = calculateSaleAmount(contract, bet)
const profit = saleAmount - bet.amount
return ( return (
<ConfirmationButton <ConfirmationButton
@ -558,6 +559,8 @@ function SellButton(props: { contract: Contract; bet: Bet }) {
)} )}
<div className="mt-2 mb-1 text-sm"> <div className="mt-2 mb-1 text-sm">
{profit > 0 ? 'Profit' : 'Loss'}: {formatMoney(profit).replace('-', '')}
<br />
Market probability: {formatPercent(initialProb)} {' '} Market probability: {formatPercent(initialProb)} {' '}
{formatPercent(outcomeProb)} {formatPercent(outcomeProb)}
</div> </div>