change fee structure
This commit is contained in:
parent
6c9f566d3d
commit
4294481b5b
|
@ -104,7 +104,7 @@ export function calculateShareValue(contract: Contract, bet: Bet) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function calculateSaleAmount(contract: Contract, bet: Bet) {
|
export function calculateSaleAmount(contract: Contract, bet: Bet) {
|
||||||
return (1 - 2 * FEES) * calculateShareValue(contract, bet)
|
return (1 - FEES) * calculateShareValue(contract, bet)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function calculatePayout(
|
export function calculatePayout(
|
||||||
|
@ -145,7 +145,7 @@ export function calculateStandardPayout(
|
||||||
totalShares[outcome] - phantomShares[outcome] - totalBets[outcome]
|
totalShares[outcome] - phantomShares[outcome] - totalBets[outcome]
|
||||||
const winningsPool = truePool - totalBets[outcome]
|
const winningsPool = truePool - totalBets[outcome]
|
||||||
|
|
||||||
return amount + (1 - 2 * FEES) * ((shares - amount) / total) * winningsPool
|
return amount + (1 - FEES) * ((shares - amount) / total) * winningsPool
|
||||||
}
|
}
|
||||||
|
|
||||||
export function calculatePayoutAfterCorrectBet(contract: Contract, bet: Bet) {
|
export function calculatePayoutAfterCorrectBet(contract: Contract, bet: Bet) {
|
||||||
|
@ -204,7 +204,7 @@ function calculateMktPayout(contract: Contract, bet: Bet) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
betP * bet.amount +
|
betP * bet.amount +
|
||||||
(1 - 2 * FEES) *
|
(1 - FEES) *
|
||||||
((betP * (bet.shares - bet.amount)) / weightedShareTotal) *
|
((betP * (bet.shares - bet.amount)) / weightedShareTotal) *
|
||||||
winningsPool
|
winningsPool
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export const PLATFORM_FEE = 0.01 // == 1%
|
export const PLATFORM_FEE = 0.01
|
||||||
export const CREATOR_FEE = 0.01
|
export const CREATOR_FEE = 0.09
|
||||||
|
|
||||||
export const FEES = PLATFORM_FEE + CREATOR_FEE
|
export const FEES = PLATFORM_FEE + CREATOR_FEE
|
||||||
|
|
|
@ -38,12 +38,12 @@ export const getStandardPayouts = (
|
||||||
userId: bet.userId,
|
userId: bet.userId,
|
||||||
payout:
|
payout:
|
||||||
bet.amount +
|
bet.amount +
|
||||||
(1 - 2 * FEES) *
|
(1 - FEES) *
|
||||||
((bet.shares - bet.amount) / shareDifferenceSum) *
|
((bet.shares - bet.amount) / shareDifferenceSum) *
|
||||||
winningsPool,
|
winningsPool,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const creatorPayout = 2 * CREATOR_FEE * winningsPool
|
const creatorPayout = CREATOR_FEE * winningsPool
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
'resolved',
|
'resolved',
|
||||||
|
@ -98,7 +98,7 @@ export const getMktPayouts = (
|
||||||
userId: bet.userId,
|
userId: bet.userId,
|
||||||
payout:
|
payout:
|
||||||
p * bet.amount +
|
p * bet.amount +
|
||||||
(1 - 2 * FEES) *
|
(1 - FEES) *
|
||||||
((p * (bet.shares - bet.amount)) / weightedShareTotal) *
|
((p * (bet.shares - bet.amount)) / weightedShareTotal) *
|
||||||
winningsPool,
|
winningsPool,
|
||||||
}))
|
}))
|
||||||
|
@ -107,12 +107,12 @@ export const getMktPayouts = (
|
||||||
userId: bet.userId,
|
userId: bet.userId,
|
||||||
payout:
|
payout:
|
||||||
(1 - p) * bet.amount +
|
(1 - p) * bet.amount +
|
||||||
(1 - 2 * FEES) *
|
(1 - FEES) *
|
||||||
(((1 - p) * (bet.shares - bet.amount)) / weightedShareTotal) *
|
(((1 - p) * (bet.shares - bet.amount)) / weightedShareTotal) *
|
||||||
winningsPool,
|
winningsPool,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const creatorPayout = 2 * CREATOR_FEE * winningsPool
|
const creatorPayout = CREATOR_FEE * winningsPool
|
||||||
|
|
||||||
return [
|
return [
|
||||||
...yesPayouts,
|
...yesPayouts,
|
||||||
|
|
|
@ -36,8 +36,8 @@ export const getSellBetInfo = (
|
||||||
const probBefore = getProbability(contract.totalShares)
|
const probBefore = getProbability(contract.totalShares)
|
||||||
const probAfter = getProbability(newTotalShares)
|
const probAfter = getProbability(newTotalShares)
|
||||||
|
|
||||||
const creatorFee = 2 * CREATOR_FEE * adjShareValue
|
const creatorFee = CREATOR_FEE * adjShareValue
|
||||||
const saleAmount = (1 - 2 * FEES) * adjShareValue
|
const saleAmount = (1 - FEES) * adjShareValue
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
'SELL M$',
|
'SELL M$',
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { cloneElement } from 'react'
|
import { cloneElement } from 'react'
|
||||||
|
import { CREATOR_FEE } from '../../common/fees'
|
||||||
import { Page } from '../components/page'
|
import { Page } from '../components/page'
|
||||||
import { SEO } from '../components/SEO'
|
import { SEO } from '../components/SEO'
|
||||||
import { useContracts } from '../hooks/use-contracts'
|
|
||||||
import styles from './about.module.css'
|
import styles from './about.module.css'
|
||||||
|
|
||||||
export default function About() {
|
export default function About() {
|
||||||
|
@ -132,8 +132,9 @@ function Contents() {
|
||||||
</p>
|
</p>
|
||||||
<h3 id="how-are-markets-resolved-">How are markets resolved?</h3>
|
<h3 id="how-are-markets-resolved-">How are markets resolved?</h3>
|
||||||
<p>
|
<p>
|
||||||
The creator of the prediction market decides the outcome and earns 1% of
|
The creator of the prediction market decides the outcome and earns{' '}
|
||||||
the betting pool for their effort.
|
{CREATOR_FEE * 100}% of the winnings as a commission for creating and
|
||||||
|
resolving the market.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
This simple resolution mechanism has surprising benefits in allowing a
|
This simple resolution mechanism has surprising benefits in allowing a
|
||||||
|
|
|
@ -177,7 +177,7 @@ export function NewContract(props: { question: string; tag?: string }) {
|
||||||
<span>Market ante</span>
|
<span>Market ante</span>
|
||||||
<InfoTooltip
|
<InfoTooltip
|
||||||
text={`Subsidize your market to encourage trading. Ante bets are set to match your initial probability.
|
text={`Subsidize your market to encourage trading. Ante bets are set to match your initial probability.
|
||||||
You earn ${CREATOR_FEE * 100}% of trading volume.`}
|
You earn ${CREATOR_FEE * 100}% of the winnings.`}
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<AmountInput
|
<AmountInput
|
||||||
|
|
Loading…
Reference in New Issue
Block a user