From bb8f7cc966c947711e0ca119b15dccc6189c5cff Mon Sep 17 00:00:00 2001 From: mantikoros Date: Fri, 11 Mar 2022 00:16:01 -0600 Subject: [PATCH] creator fees messaging --- web/components/resolution-panel.tsx | 14 ++++++++++---- web/pages/create.tsx | 5 ++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/web/components/resolution-panel.tsx b/web/components/resolution-panel.tsx index b9d8e2dd..2fe4717d 100644 --- a/web/components/resolution-panel.tsx +++ b/web/components/resolution-panel.tsx @@ -9,9 +9,10 @@ import { Spacer } from './layout/spacer' import { ResolveConfirmationButton } from './confirmation-button' import { resolveMarket } from '../lib/firebase/api-call' import { ProbabilitySelector } from './probability-selector' -import { CREATOR_FEE } from '../../common/fees' +import { DPM_CREATOR_FEE } from '../../common/fees' import { getProbability } from '../../common/calculate' import { Binary, CPMM, DPM, FullContract } from '../../common/contract' +import { formatMoney } from '../../common/util/format' export function ResolutionPanel(props: { creator: User @@ -25,6 +26,11 @@ export function ResolutionPanel(props: { const { contract, className } = props + const earnedFees = + contract.mechanism === 'dpm-2' + ? `${DPM_CREATOR_FEE * 100}% of trader profits` + : `${formatMoney(contract.collectedFees.creatorFee)} in fees` + const [outcome, setOutcome] = useState< 'YES' | 'NO' | 'MKT' | 'CANCEL' | undefined >() @@ -85,14 +91,14 @@ export function ResolutionPanel(props: { Winnings will be paid out to YES bettors.

- You earn {CREATOR_FEE * 100}% of trader profits. + You will earn {earnedFees}. ) : outcome === 'NO' ? ( <> Winnings will be paid out to NO bettors.

- You earn {CREATOR_FEE * 100}% of trader profits. + You will earn {earnedFees}. ) : outcome === 'CANCEL' ? ( <>The pool will be returned to traders with no fees. @@ -103,7 +109,7 @@ export function ResolutionPanel(props: { probabilityInt={Math.round(prob)} setProbabilityInt={setProb} /> -
You earn {CREATOR_FEE * 100}% of trader profits.
+ You will earn {earnedFees}. ) : ( <>Resolving this market will immediately pay out traders. diff --git a/web/pages/create.tsx b/web/pages/create.tsx index c4feb11c..d6600cd0 100644 --- a/web/pages/create.tsx +++ b/web/pages/create.tsx @@ -236,10 +236,9 @@ export function NewContract(props: { question: string; tag?: string }) {