flat trade fee of M$0.1 aka bot tax
This commit is contained in:
parent
4285198f09
commit
9e289146af
|
@ -1,3 +1,5 @@
|
|||
export const FLAT_TRADE_FEE = 0.1 // M$0.1
|
||||
|
||||
export const PLATFORM_FEE = 0
|
||||
export const CREATOR_FEE = 0
|
||||
export const LIQUIDITY_FEE = 0
|
||||
|
|
|
@ -11,6 +11,7 @@ import { groupBy, mapValues, sumBy, uniq } from 'lodash'
|
|||
import { APIError, newEndpoint, validate } from './api'
|
||||
import { Contract, CPMM_MIN_POOL_QTY } from '../../common/contract'
|
||||
import { User } from '../../common/user'
|
||||
import { FLAT_TRADE_FEE } from '../../common/fees'
|
||||
import {
|
||||
BetInfo,
|
||||
getBinaryCpmmBetInfo,
|
||||
|
@ -162,10 +163,17 @@ export const placebet = newEndpoint({}, async (req, auth) => {
|
|||
}
|
||||
}
|
||||
|
||||
if (newBet.amount !== 0) {
|
||||
trans.update(userDoc, { balance: FieldValue.increment(-newBet.amount) })
|
||||
const balanceChange =
|
||||
newBet.amount !== 0
|
||||
? // quick bet
|
||||
newBet.amount + FLAT_TRADE_FEE
|
||||
: // limit order
|
||||
FLAT_TRADE_FEE
|
||||
|
||||
trans.update(userDoc, { balance: FieldValue.increment(-balanceChange) })
|
||||
log('Updated user balance.')
|
||||
|
||||
if (newBet.amount !== 0) {
|
||||
trans.update(
|
||||
contractDoc,
|
||||
removeUndefinedProps({
|
||||
|
|
Loading…
Reference in New Issue
Block a user