Cheating by adding 0.05 to max shares but gives better quickbet UX

This commit is contained in:
Ian Philips 2022-09-10 17:05:27 -06:00
parent a47b702dbe
commit 2278c3cb2e
2 changed files with 3 additions and 2 deletions

View File

@ -33,7 +33,7 @@ export default function BetButton(props: {
<>
<Col className={clsx('items-center', className)}>
{user && (
<div className={'mt-1 w-24 text-center text-sm text-gray-500'}>
<div className={'mb-1 w-24 text-center text-sm text-gray-500'}>
{hasYesShares
? `(${Math.floor(yesShares)} ${
isPseudoNumeric ? 'HIGHER' : 'YES'

View File

@ -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(