From eaab8191e318bb0c5b35e824c73704828e966c08 Mon Sep 17 00:00:00 2001 From: mantikoros Date: Tue, 15 Mar 2022 16:05:42 -0500 Subject: [PATCH] fix dpm free response payout for single outcome --- common/payouts-dpm.ts | 2 +- common/payouts.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/common/payouts-dpm.ts b/common/payouts-dpm.ts index f740f9a6..a90cfb10 100644 --- a/common/payouts-dpm.ts +++ b/common/payouts-dpm.ts @@ -168,7 +168,7 @@ export const getPayoutsMultiOutcome = ( liquidityFee: 0, } - const fees = addObjects(finalFees, contract.collectedFees ?? {}) + const fees = addObjects(finalFees, contract.collectedFees ?? noFees) console.log( 'resolved', diff --git a/common/payouts.ts b/common/payouts.ts index ebc06bfe..d932a4c0 100644 --- a/common/payouts.ts +++ b/common/payouts.ts @@ -110,14 +110,24 @@ export const getDpmPayouts = ( Payout[], Fees ] + case 'MKT': return getDpmMktPayouts(contract, openBets, resolutionProbability) as [ Payout[], Fees ] + case 'CANCEL': return getDpmCancelPayouts(contract, openBets) as [Payout[], Fees] + default: + if (outcome) + // single outcome free response + return getDpmStandardPayouts(outcome, contract, openBets) as [ + Payout[], + Fees + ] + // Multi outcome. return getPayoutsMultiOutcome( resolutions,