calculateCpmmPurchase: deduct creator fee
This commit is contained in:
parent
c1a800f4c6
commit
48df0ac7ce
|
@ -76,10 +76,12 @@ export function calculateCpmmPurchase(
|
||||||
const shares = calculateCpmmShares(pool, remainingBet, outcome)
|
const shares = calculateCpmmShares(pool, remainingBet, outcome)
|
||||||
const { YES: y, NO: n } = pool
|
const { YES: y, NO: n } = pool
|
||||||
|
|
||||||
|
const { liquidityFee: fee } = fees
|
||||||
|
|
||||||
const [newY, newN] =
|
const [newY, newN] =
|
||||||
outcome === 'YES'
|
outcome === 'YES'
|
||||||
? [y - shares + bet, n + bet]
|
? [y - shares + remainingBet + fee, n + remainingBet + fee]
|
||||||
: [y + bet, n - shares + bet]
|
: [y + remainingBet + fee, n - shares + remainingBet + fee]
|
||||||
|
|
||||||
const newPool = { YES: newY, NO: newN }
|
const newPool = { YES: newY, NO: newN }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user