"bet" => "trade"
This commit is contained in:
parent
cce14cbe1f
commit
28af2063c3
|
@ -135,7 +135,7 @@ export const placebet = newEndpoint({}, async (req, auth) => {
|
||||||
!isFinite(newP) ||
|
!isFinite(newP) ||
|
||||||
Math.min(...Object.values(newPool ?? {})) < CPMM_MIN_POOL_QTY)
|
Math.min(...Object.values(newPool ?? {})) < CPMM_MIN_POOL_QTY)
|
||||||
) {
|
) {
|
||||||
throw new APIError(400, 'Bet too large for current liquidity pool.')
|
throw new APIError(400, 'Trade too large for current liquidity pool.')
|
||||||
}
|
}
|
||||||
|
|
||||||
const betDoc = contractDoc.collection('bets').doc()
|
const betDoc = contractDoc.collection('bets').doc()
|
||||||
|
|
|
@ -120,7 +120,7 @@ export function AnswerBetPanel(props: {
|
||||||
<Col className={clsx('px-2 pb-2 pt-4 sm:pt-0', className)}>
|
<Col className={clsx('px-2 pb-2 pt-4 sm:pt-0', className)}>
|
||||||
<Row className="items-center justify-between self-stretch">
|
<Row className="items-center justify-between self-stretch">
|
||||||
<div className="text-xl">
|
<div className="text-xl">
|
||||||
Bet on {isModal ? `"${answer.text}"` : 'this answer'}
|
Buy answer: {isModal ? `"${answer.text}"` : 'this answer'}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!isModal && (
|
{!isModal && (
|
||||||
|
|
|
@ -112,7 +112,7 @@ export const getHomeItems = (
|
||||||
{ label: 'Trending', id: 'score' },
|
{ label: 'Trending', id: 'score' },
|
||||||
{ label: 'Newest', id: 'newest' },
|
{ label: 'Newest', id: 'newest' },
|
||||||
{ label: 'Close date', id: 'close-date' },
|
{ label: 'Close date', id: 'close-date' },
|
||||||
{ label: 'Your bets', id: 'your-bets' },
|
{ label: 'Your trades', id: 'your-bets' },
|
||||||
...groups.map((g) => ({
|
...groups.map((g) => ({
|
||||||
label: g.name,
|
label: g.name,
|
||||||
id: g.id,
|
id: g.id,
|
||||||
|
|
|
@ -38,7 +38,7 @@ export default function BetButton(props: {
|
||||||
className={clsx('my-auto inline-flex min-w-[75px] ', btnClassName)}
|
className={clsx('my-auto inline-flex min-w-[75px] ', btnClassName)}
|
||||||
onClick={() => setOpen(true)}
|
onClick={() => setOpen(true)}
|
||||||
>
|
>
|
||||||
Bet
|
Trade
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<BetSignUpPrompt />
|
<BetSignUpPrompt />
|
||||||
|
|
|
@ -281,7 +281,7 @@ function BuyPanel(props: {
|
||||||
title="Whoa, there!"
|
title="Whoa, there!"
|
||||||
text={`You might not want to spend ${formatPercent(
|
text={`You might not want to spend ${formatPercent(
|
||||||
bankrollFraction
|
bankrollFraction
|
||||||
)} of your balance on a single bet. \n\nCurrent balance: ${formatMoney(
|
)} of your balance on a single trade. \n\nCurrent balance: ${formatMoney(
|
||||||
user?.balance ?? 0
|
user?.balance ?? 0
|
||||||
)}`}
|
)}`}
|
||||||
/>
|
/>
|
||||||
|
@ -379,11 +379,11 @@ function BuyPanel(props: {
|
||||||
)}
|
)}
|
||||||
onClick={betDisabled ? undefined : submitBet}
|
onClick={betDisabled ? undefined : submitBet}
|
||||||
>
|
>
|
||||||
{isSubmitting ? 'Submitting...' : 'Submit bet'}
|
{isSubmitting ? 'Submitting...' : 'Submit trade'}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{wasSubmitted && <div className="mt-4">Bet submitted!</div>}
|
{wasSubmitted && <div className="mt-4">Trade submitted!</div>}
|
||||||
</Col>
|
</Col>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -569,7 +569,7 @@ function LimitOrderPanel(props: {
|
||||||
<Row className="mt-1 items-center gap-4">
|
<Row className="mt-1 items-center gap-4">
|
||||||
<Col className="gap-2">
|
<Col className="gap-2">
|
||||||
<div className="relative ml-1 text-sm text-gray-500">
|
<div className="relative ml-1 text-sm text-gray-500">
|
||||||
Bet {isPseudoNumeric ? <HigherLabel /> : <YesLabel />} up to
|
Buy {isPseudoNumeric ? <HigherLabel /> : <YesLabel />} up to
|
||||||
</div>
|
</div>
|
||||||
<ProbabilityOrNumericInput
|
<ProbabilityOrNumericInput
|
||||||
contract={contract}
|
contract={contract}
|
||||||
|
@ -580,7 +580,7 @@ function LimitOrderPanel(props: {
|
||||||
</Col>
|
</Col>
|
||||||
<Col className="gap-2">
|
<Col className="gap-2">
|
||||||
<div className="ml-1 text-sm text-gray-500">
|
<div className="ml-1 text-sm text-gray-500">
|
||||||
Bet {isPseudoNumeric ? <LowerLabel /> : <NoLabel />} down to
|
Buy {isPseudoNumeric ? <LowerLabel /> : <NoLabel />} down to
|
||||||
</div>
|
</div>
|
||||||
<ProbabilityOrNumericInput
|
<ProbabilityOrNumericInput
|
||||||
contract={contract}
|
contract={contract}
|
||||||
|
@ -750,7 +750,7 @@ function QuickOrLimitBet(props: {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row className="align-center mb-4 justify-between">
|
<Row className="align-center mb-4 justify-between">
|
||||||
<div className="text-4xl">Bet</div>
|
<div className="text-4xl">Trade</div>
|
||||||
{!hideToggle && (
|
{!hideToggle && (
|
||||||
<Row className="mt-1 items-center gap-2">
|
<Row className="mt-1 items-center gap-2">
|
||||||
<PillButton
|
<PillButton
|
||||||
|
|
|
@ -441,7 +441,7 @@ function ContractSearchControls(props: {
|
||||||
selected={state.pillFilter === 'your-bets'}
|
selected={state.pillFilter === 'your-bets'}
|
||||||
onSelect={selectPill('your-bets')}
|
onSelect={selectPill('your-bets')}
|
||||||
>
|
>
|
||||||
Your bets
|
Your trades
|
||||||
</PillButton>
|
</PillButton>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
|
@ -294,7 +294,7 @@ export function ExtraMobileContractDetails(props: {
|
||||||
<Tooltip
|
<Tooltip
|
||||||
text={`${formatMoney(
|
text={`${formatMoney(
|
||||||
volume
|
volume
|
||||||
)} bet - ${uniqueBettors} unique bettors`}
|
)} bet - ${uniqueBettors} unique traders`}
|
||||||
>
|
>
|
||||||
{volumeTranslation}
|
{volumeTranslation}
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
|
@ -135,7 +135,7 @@ export function ContractInfoDialog(props: {
|
||||||
</tr> */}
|
</tr> */}
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>Bettors</td>
|
<td>Traders</td>
|
||||||
<td>{bettorsCount}</td>
|
<td>{bettorsCount}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ export function ContractLeaderboard(props: {
|
||||||
|
|
||||||
return users && users.length > 0 ? (
|
return users && users.length > 0 ? (
|
||||||
<Leaderboard
|
<Leaderboard
|
||||||
title="🏅 Top bettors"
|
title="🏅 Top traders"
|
||||||
users={users || []}
|
users={users || []}
|
||||||
columns={[
|
columns={[
|
||||||
{
|
{
|
||||||
|
|
|
@ -116,13 +116,13 @@ export function ContractTabs(props: {
|
||||||
badge: `${comments.length}`,
|
badge: `${comments.length}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Bets',
|
title: 'Trades',
|
||||||
content: betActivity,
|
content: betActivity,
|
||||||
badge: `${visibleBets.length}`,
|
badge: `${visibleBets.length}`,
|
||||||
},
|
},
|
||||||
...(!user || !userBets?.length
|
...(!user || !userBets?.length
|
||||||
? []
|
? []
|
||||||
: [{ title: 'Your bets', content: yourTrades }]),
|
: [{ title: 'Your trades', content: yourTrades }]),
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
{!user ? (
|
{!user ? (
|
||||||
|
|
|
@ -4,6 +4,6 @@ export const PlayMoneyDisclaimer = () => (
|
||||||
<InfoBox
|
<InfoBox
|
||||||
title="Play-money betting"
|
title="Play-money betting"
|
||||||
className="mt-4 max-w-md"
|
className="mt-4 max-w-md"
|
||||||
text="Mana (M$) is the play-money used by our platform to keep track of your bets. It's completely free for you and your friends to get started!"
|
text="Mana (M$) is the play-money used by our platform to keep track of your trades. It's completely free for you and your friends to get started!"
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|
|
@ -11,7 +11,7 @@ export function LoansModal(props: {
|
||||||
<Modal open={isOpen} setOpen={setOpen}>
|
<Modal open={isOpen} setOpen={setOpen}>
|
||||||
<Col className="items-center gap-4 rounded-md bg-white px-8 py-6">
|
<Col className="items-center gap-4 rounded-md bg-white px-8 py-6">
|
||||||
<span className={'text-8xl'}>🏦</span>
|
<span className={'text-8xl'}>🏦</span>
|
||||||
<span className="text-xl">Daily loans on your bets</span>
|
<span className="text-xl">Daily loans on your trades</span>
|
||||||
<Col className={'gap-2'}>
|
<Col className={'gap-2'}>
|
||||||
<span className={'text-indigo-700'}>• What are daily loans?</span>
|
<span className={'text-indigo-700'}>• What are daily loans?</span>
|
||||||
<span className={'ml-2'}>
|
<span className={'ml-2'}>
|
||||||
|
|
|
@ -83,14 +83,14 @@ export function ResolutionPanel(props: {
|
||||||
<div>
|
<div>
|
||||||
{outcome === 'YES' ? (
|
{outcome === 'YES' ? (
|
||||||
<>
|
<>
|
||||||
Winnings will be paid out to YES bettors.
|
Winnings will be paid out to traders who bought YES.
|
||||||
{/* <br />
|
{/* <br />
|
||||||
<br />
|
<br />
|
||||||
You will earn {earnedFees}. */}
|
You will earn {earnedFees}. */}
|
||||||
</>
|
</>
|
||||||
) : outcome === 'NO' ? (
|
) : outcome === 'NO' ? (
|
||||||
<>
|
<>
|
||||||
Winnings will be paid out to NO bettors.
|
Winnings will be paid out to traders who bought NO.
|
||||||
{/* <br />
|
{/* <br />
|
||||||
<br />
|
<br />
|
||||||
You will earn {earnedFees}. */}
|
You will earn {earnedFees}. */}
|
||||||
|
|
|
@ -260,7 +260,7 @@ export function UserPage(props: { user: User }) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Bets',
|
title: 'Trades',
|
||||||
content: (
|
content: (
|
||||||
<>
|
<>
|
||||||
<BetsList user={user} />
|
<BetsList user={user} />
|
||||||
|
|
|
@ -193,7 +193,7 @@ export function BuyButton(props: { className?: string; onClick?: () => void }) {
|
||||||
)}
|
)}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
>
|
>
|
||||||
Bet
|
Buy
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ const Home = (props: { auth: { user: User } | null }) => {
|
||||||
return (
|
return (
|
||||||
<SearchSection
|
<SearchSection
|
||||||
key={id}
|
key={id}
|
||||||
label={'Your bets'}
|
label={'Your trades'}
|
||||||
sort={'prob-change-day'}
|
sort={'prob-change-day'}
|
||||||
user={user}
|
user={user}
|
||||||
yourBets
|
yourBets
|
||||||
|
|
|
@ -390,7 +390,7 @@ function IncomeNotificationItem(props: {
|
||||||
reasonText = !simple
|
reasonText = !simple
|
||||||
? `Bonus for ${
|
? `Bonus for ${
|
||||||
parseInt(sourceText) / UNIQUE_BETTOR_BONUS_AMOUNT
|
parseInt(sourceText) / UNIQUE_BETTOR_BONUS_AMOUNT
|
||||||
} new bettors on`
|
} new traders on`
|
||||||
: 'bonus on'
|
: 'bonus on'
|
||||||
} else if (sourceType === 'tip') {
|
} else if (sourceType === 'tip') {
|
||||||
reasonText = !simple ? `tipped you on` : `in tips on`
|
reasonText = !simple ? `tipped you on` : `in tips on`
|
||||||
|
@ -508,7 +508,7 @@ function IncomeNotificationItem(props: {
|
||||||
{(isTip || isUniqueBettorBonus) && (
|
{(isTip || isUniqueBettorBonus) && (
|
||||||
<MultiUserTransactionLink
|
<MultiUserTransactionLink
|
||||||
userInfos={userLinks}
|
userInfos={userLinks}
|
||||||
modalLabel={isTip ? 'Who tipped you' : 'Unique bettors'}
|
modalLabel={isTip ? 'Who tipped you' : 'Unique traders'}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Row className={'line-clamp-2 flex max-w-xl'}>
|
<Row className={'line-clamp-2 flex max-w-xl'}>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user