creator fees messaging

This commit is contained in:
mantikoros 2022-03-11 00:16:01 -06:00
parent beedbed6ff
commit bb8f7cc966
2 changed files with 12 additions and 7 deletions

View File

@ -9,9 +9,10 @@ import { Spacer } from './layout/spacer'
import { ResolveConfirmationButton } from './confirmation-button' import { ResolveConfirmationButton } from './confirmation-button'
import { resolveMarket } from '../lib/firebase/api-call' import { resolveMarket } from '../lib/firebase/api-call'
import { ProbabilitySelector } from './probability-selector' import { ProbabilitySelector } from './probability-selector'
import { CREATOR_FEE } from '../../common/fees' import { DPM_CREATOR_FEE } from '../../common/fees'
import { getProbability } from '../../common/calculate' import { getProbability } from '../../common/calculate'
import { Binary, CPMM, DPM, FullContract } from '../../common/contract' import { Binary, CPMM, DPM, FullContract } from '../../common/contract'
import { formatMoney } from '../../common/util/format'
export function ResolutionPanel(props: { export function ResolutionPanel(props: {
creator: User creator: User
@ -25,6 +26,11 @@ export function ResolutionPanel(props: {
const { contract, className } = 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< const [outcome, setOutcome] = useState<
'YES' | 'NO' | 'MKT' | 'CANCEL' | undefined 'YES' | 'NO' | 'MKT' | 'CANCEL' | undefined
>() >()
@ -85,14 +91,14 @@ export function ResolutionPanel(props: {
Winnings will be paid out to YES bettors. Winnings will be paid out to YES bettors.
<br /> <br />
<br /> <br />
You earn {CREATOR_FEE * 100}% of trader profits. You will earn {earnedFees}.
</> </>
) : outcome === 'NO' ? ( ) : outcome === 'NO' ? (
<> <>
Winnings will be paid out to NO bettors. Winnings will be paid out to NO bettors.
<br /> <br />
<br /> <br />
You earn {CREATOR_FEE * 100}% of trader profits. You will earn {earnedFees}.
</> </>
) : outcome === 'CANCEL' ? ( ) : outcome === 'CANCEL' ? (
<>The pool will be returned to traders with no fees.</> <>The pool will be returned to traders with no fees.</>
@ -103,7 +109,7 @@ export function ResolutionPanel(props: {
probabilityInt={Math.round(prob)} probabilityInt={Math.round(prob)}
setProbabilityInt={setProb} setProbabilityInt={setProb}
/> />
<div>You earn {CREATOR_FEE * 100}% of trader profits.</div> You will earn {earnedFees}.
</Col> </Col>
) : ( ) : (
<>Resolving this market will immediately pay out traders.</> <>Resolving this market will immediately pay out traders.</>

View File

@ -236,10 +236,9 @@ export function NewContract(props: { question: string; tag?: string }) {
<div className="form-control mb-1 items-start"> <div className="form-control mb-1 items-start">
<label className="label mb-1 gap-2"> <label className="label mb-1 gap-2">
<span>Market ante</span> <span>Market subsidy</span>
<InfoTooltip <InfoTooltip
text={`Subsidize your market to encourage trading. Ante bets are set to match your initial probability. text={`Provide liquidity to encourage traders to participate.`}
You earn ${CREATOR_FEE * 100}% of trader profits.`}
/> />
</label> </label>
<AmountInput <AmountInput