change dpm elasticity

This commit is contained in:
mantikoros 2022-10-06 16:47:52 -05:00
parent 7ca0fb72fc
commit a63405ca7c
2 changed files with 8 additions and 9 deletions

View File

@ -1,11 +1,7 @@
import { last, sortBy, sum, sumBy } from 'lodash'
import { calculatePayout } from './calculate'
import { Bet, LimitBet } from './bet'
import {
Contract,
CPMMContract,
DPMContract,
} from './contract'
import { Contract, CPMMContract, DPMContract } from './contract'
import { PortfolioMetrics, User } from './user'
import { DAY_MS } from './util/time'
import { getBinaryCpmmBetInfo, getNewMultiBetInfo } from './new-bet'
@ -61,7 +57,7 @@ export const computeElasticity = (
export const computeBinaryCpmmElasticity = (
bets: Bet[],
contract: CPMMContract,
betAmount = 50
betAmount: number
) => {
const limitBets = bets
.filter(
@ -91,8 +87,11 @@ export const computeBinaryCpmmElasticity = (
return resultYes - resultNo
}
export const computeDpmElasticity = (contract: DPMContract, betAmount = 50) => {
return getNewMultiBetInfo('', betAmount, contract).newBet.probAfter
export const computeDpmElasticity = (
contract: DPMContract,
betAmount: number
) => {
return getNewMultiBetInfo('', 2 * betAmount, contract).newBet.probAfter
}
const computeTotalPool = (userContracts: Contract[], startTime = 0) => {

View File

@ -70,7 +70,7 @@ export function getNewContract(
volume: 0,
volume24Hours: 0,
volume7Days: 0,
elasticity: propsByOutcomeType.mechanism === 'cpmm-1' ? 0.38 : 0.56,
elasticity: propsByOutcomeType.mechanism === 'cpmm-1' ? 0.38 : 0.75,
collectedFees: {
creatorFee: 0,