daily free markets' liquidity provided by @ManifoldMarkets

This commit is contained in:
mantikoros 2022-04-29 15:58:01 -04:00
parent 5f86637ca5
commit 5cb6ee3bca
3 changed files with 9 additions and 4 deletions

View File

@ -11,8 +11,10 @@ export const FIXED_ANTE = 100
export const PHANTOM_ANTE = 0.001 export const PHANTOM_ANTE = 0.001
export const MINIMUM_ANTE = 50 export const MINIMUM_ANTE = 50
export const HOUSE_LIQUIDITY_PROVIDER_ID = 'IPTOzEqrpkWmEzh6hwvAyY9PqFb2' // @ManifoldMarkets' id
export function getCpmmInitialLiquidity( export function getCpmmInitialLiquidity(
creator: User, providerId: string,
contract: FullContract<CPMM, Binary>, contract: FullContract<CPMM, Binary>,
anteId: string, anteId: string,
amount: number amount: number
@ -21,7 +23,7 @@ export function getCpmmInitialLiquidity(
const lp: LiquidityProvision = { const lp: LiquidityProvision = {
id: anteId, id: anteId,
userId: creator.id, userId: providerId,
contractId: contract.id, contractId: contract.id,
createdTime, createdTime,
isAnte: true, isAnte: true,

View File

@ -22,6 +22,7 @@ import {
getAnteBets, getAnteBets,
getCpmmInitialLiquidity, getCpmmInitialLiquidity,
getFreeAnswerAnte, getFreeAnswerAnte,
HOUSE_LIQUIDITY_PROVIDER_ID,
MINIMUM_ANTE, MINIMUM_ANTE,
} from '../../common/antes' } from '../../common/antes'
import { getNoneAnswer } from '../../common/answer' import { getNoneAnswer } from '../../common/answer'
@ -144,8 +145,10 @@ export const createContract = functions
.collection(`contracts/${contract.id}/liquidity`) .collection(`contracts/${contract.id}/liquidity`)
.doc() .doc()
const providerId = isFree ? HOUSE_LIQUIDITY_PROVIDER_ID : creator.id
const lp = getCpmmInitialLiquidity( const lp = getCpmmInitialLiquidity(
creator, providerId,
contract as FullContract<CPMM, Binary>, contract as FullContract<CPMM, Binary>,
liquidityDoc.id, liquidityDoc.id,
ante ante

View File

@ -106,7 +106,7 @@ async function recalculateContract(contractRef: DocRef, isCommit = false) {
const liquidityDocRef = contractRef.collection('liquidity').doc() const liquidityDocRef = contractRef.collection('liquidity').doc()
const lp = getCpmmInitialLiquidity( const lp = getCpmmInitialLiquidity(
{ id: 'IPTOzEqrpkWmEzh6hwvAyY9PqFb2' } as User, // use @ManifoldMarkets' id 'IPTOzEqrpkWmEzh6hwvAyY9PqFb2', // use @ManifoldMarkets' id
{ {
...contract, ...contract,
...contractUpdate, ...contractUpdate,