From 2278c3cb2ef88e0613cc18ebb7d5637e7fcfb792 Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Sat, 10 Sep 2022 17:05:27 -0600 Subject: [PATCH] Cheating by adding 0.05 to max shares but gives better quickbet UX --- web/components/bet-button.tsx | 2 +- web/components/contract/quick-bet-button.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/web/components/bet-button.tsx b/web/components/bet-button.tsx index 576f9d8b..2aadbc78 100644 --- a/web/components/bet-button.tsx +++ b/web/components/bet-button.tsx @@ -33,7 +33,7 @@ export default function BetButton(props: { <> {user && ( -
+
{hasYesShares ? `(${Math.floor(yesShares)} ${ isPseudoNumeric ? 'HIGHER' : 'YES' diff --git a/web/components/contract/quick-bet-button.tsx b/web/components/contract/quick-bet-button.tsx index 383d43fc..d7d5a3a3 100644 --- a/web/components/contract/quick-bet-button.tsx +++ b/web/components/contract/quick-bet-button.tsx @@ -41,7 +41,8 @@ export function QuickBetButtons(props: { sellOutcome = side === 'YES' ? 'NO' : 'YES' const prob = getProb(contract) - const maxSharesSold = BET_SIZE / (sellOutcome === 'YES' ? prob : 1 - prob) + const maxSharesSold = + (BET_SIZE + 0.05) / (sellOutcome === 'YES' ? prob : 1 - prob) sharesSold = Math.min(oppositeShares, maxSharesSold) const { saleValue } = calculateCpmmSale(