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

View File

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

View File

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