From ff92338873ff63e072fbec2146eb925dcac2085b Mon Sep 17 00:00:00 2001 From: James Grugett Date: Mon, 7 Mar 2022 13:14:56 -0800 Subject: [PATCH] Fix multi payout calculation! --- common/payouts.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/payouts.ts b/common/payouts.ts index 446b75d7..ab7f00af 100644 --- a/common/payouts.ts +++ b/common/payouts.ts @@ -138,8 +138,7 @@ export const getPayoutsMultiOutcome = ( const prob = resolutions[outcome] / probTotal const winnings = (shares / sharesByOutcome[outcome]) * prob * poolTotal const profit = winnings - amount - - const payout = amount + (1 - FEES) * Math.max(0, profit) + const payout = deductFees(amount, winnings) return { userId, profit, payout } })