payouts: fix subsidyPool undefined bug
This commit is contained in:
parent
de76557326
commit
93ceaa52c4
|
@ -56,7 +56,8 @@ export const getLiquidityPoolPayouts = (
|
||||||
liquidities: LiquidityProvision[]
|
liquidities: LiquidityProvision[]
|
||||||
) => {
|
) => {
|
||||||
const { pool, subsidyPool } = contract
|
const { pool, subsidyPool } = contract
|
||||||
const finalPool = pool[outcome] + subsidyPool
|
const finalPool = pool[outcome] + (subsidyPool ?? 0)
|
||||||
|
if (finalPool < 1e-3) return []
|
||||||
|
|
||||||
const weights = getCpmmLiquidityPoolWeights(liquidities)
|
const weights = getCpmmLiquidityPoolWeights(liquidities)
|
||||||
|
|
||||||
|
@ -95,7 +96,8 @@ export const getLiquidityPoolProbPayouts = (
|
||||||
liquidities: LiquidityProvision[]
|
liquidities: LiquidityProvision[]
|
||||||
) => {
|
) => {
|
||||||
const { pool, subsidyPool } = contract
|
const { pool, subsidyPool } = contract
|
||||||
const finalPool = p * pool.YES + (1 - p) * pool.NO + subsidyPool
|
const finalPool = p * pool.YES + (1 - p) * pool.NO + (subsidyPool ?? 0)
|
||||||
|
if (finalPool < 1e-3) return []
|
||||||
|
|
||||||
const weights = getCpmmLiquidityPoolWeights(liquidities)
|
const weights = getCpmmLiquidityPoolWeights(liquidities)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user