Allow customizing starting balance & antes

This commit is contained in:
Austin Chen 2022-07-03 16:45:52 -07:00
parent e5c3c782e6
commit 1fcb7ab479
3 changed files with 8 additions and 9 deletions

View File

@ -10,12 +10,9 @@ import {
import { User } from './user' import { User } from './user'
import { LiquidityProvision } from './liquidity-provision' import { LiquidityProvision } from './liquidity-provision'
import { noFees } from './fees' import { noFees } from './fees'
import { ENV_CONFIG } from './envs/constants'
export const FIXED_ANTE = 100 export const FIXED_ANTE = ENV_CONFIG.fixedAnte ?? 100
// deprecated
export const PHANTOM_ANTE = 0.001
export const MINIMUM_ANTE = 50
export const HOUSE_LIQUIDITY_PROVIDER_ID = 'IPTOzEqrpkWmEzh6hwvAyY9PqFb2' // @ManifoldMarkets' id export const HOUSE_LIQUIDITY_PROVIDER_ID = 'IPTOzEqrpkWmEzh6hwvAyY9PqFb2' // @ManifoldMarkets' id

View File

@ -1,3 +1,5 @@
import { ENV_CONFIG } from './envs/constants'
export type User = { export type User = {
id: string id: string
createdTime: number createdTime: number
@ -38,8 +40,9 @@ export type User = {
referredByContractId?: string referredByContractId?: string
} }
export const STARTING_BALANCE = 1000 export const STARTING_BALANCE = ENV_CONFIG.startingBalance ?? 1000
export const SUS_STARTING_BALANCE = 10 // for sus users, i.e. multiple sign ups for same person // for sus users, i.e. multiple sign ups for same person
export const SUS_STARTING_BALANCE = ENV_CONFIG.startingBalance ?? 10
export const REFERRAL_AMOUNT = 500 export const REFERRAL_AMOUNT = 500
export type PrivateUser = { export type PrivateUser = {
id: string // same as User.id id: string // same as User.id

View File

@ -7,7 +7,7 @@ import { Spacer } from 'web/components/layout/spacer'
import { useUser } from 'web/hooks/use-user' import { useUser } from 'web/hooks/use-user'
import { Contract, contractPath } from 'web/lib/firebase/contracts' import { Contract, contractPath } from 'web/lib/firebase/contracts'
import { createMarket } from 'web/lib/firebase/api-call' import { createMarket } from 'web/lib/firebase/api-call'
import { FIXED_ANTE, MINIMUM_ANTE } from 'common/antes' import { FIXED_ANTE } from 'common/antes'
import { InfoTooltip } from 'web/components/info-tooltip' import { InfoTooltip } from 'web/components/info-tooltip'
import { Page } from 'web/components/page' import { Page } from 'web/components/page'
import { Row } from 'web/components/layout/row' import { Row } from 'web/components/layout/row'
@ -156,7 +156,6 @@ export function NewContract(props: {
question.length > 0 && question.length > 0 &&
ante !== undefined && ante !== undefined &&
ante !== null && ante !== null &&
ante >= MINIMUM_ANTE &&
ante <= balance && ante <= balance &&
// closeTime must be in the future // closeTime must be in the future
closeTime && closeTime &&