From a63405ca7c4d43a8f317a0d7028f7c4a5cd7be86 Mon Sep 17 00:00:00 2001 From: mantikoros Date: Thu, 6 Oct 2022 16:47:52 -0500 Subject: [PATCH] change dpm elasticity --- common/calculate-metrics.ts | 15 +++++++-------- common/new-contract.ts | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/common/calculate-metrics.ts b/common/calculate-metrics.ts index 524dfadd..bf588345 100644 --- a/common/calculate-metrics.ts +++ b/common/calculate-metrics.ts @@ -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) => { diff --git a/common/new-contract.ts b/common/new-contract.ts index 8ab44d2e..9a73e2ea 100644 --- a/common/new-contract.ts +++ b/common/new-contract.ts @@ -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,