diff --git a/web/components/bet-panel.tsx b/web/components/bet-panel.tsx index 9715a870..009bf1dc 100644 --- a/web/components/bet-panel.tsx +++ b/web/components/bet-panel.tsx @@ -340,8 +340,11 @@ function SellPanel(props: { setError(undefined) setIsSubmitting(true) + // Sell all shares if remaining shares would be < 1 + const sellAmount = amount === Math.floor(shares) ? shares : amount + const result = await sellShares({ - shares: amount, + shares: sellAmount, outcome: sharesOutcome, contractId: contract.id, }).then((r) => r.data) diff --git a/web/components/bets-list.tsx b/web/components/bets-list.tsx index 6eb74e5b..751b2691 100644 --- a/web/components/bets-list.tsx +++ b/web/components/bets-list.tsx @@ -472,6 +472,7 @@ export function ContractBetsTable(props: { + {isCPMM && Type} Outcome Amount {!isCPMM && {isResolved ? <>Payout : <>Sale price}} @@ -541,13 +542,14 @@ function BetRow(props: { bet: Bet; contract: Contract; saleBet?: Bet }) { )} + {isCPMM && {shares >= 0 ? 'BUY' : 'SELL'}} - {formatMoney(amount)} + {formatMoney(Math.abs(amount))} {!isCPMM && {saleDisplay}} {!isCPMM && !isResolved && {payoutIfChosenDisplay}} - {formatWithCommas(shares)} + {formatWithCommas(Math.abs(shares))} {formatPercent(probBefore)} → {formatPercent(probAfter)}