Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sweeps #3165

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

sweeps #3165

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion backend/shared/src/create-cash-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { getNewContract } from 'common/new-contract'
import { convertContract } from 'common/supabase/contracts'
import { clamp } from 'lodash'
import { runTransactionWithRetries } from './transact-with-retries'
import { getTierFromLiquidity } from 'common/tier'
import { MarketContract } from 'common/contract'

// cribbed from backend/api/src/create-market.ts

Expand Down Expand Up @@ -70,7 +72,6 @@ export async function createCashContractMain(
closeTime: manaContract.closeTime,
visibility: manaContract.visibility,
isTwitchContract: manaContract.isTwitchContract,

min: 0,
max: 0,
isLogScale: false,
Expand Down Expand Up @@ -101,6 +102,13 @@ export async function createCashContractMain(
token: 'CASH',
})

await updateContract(tx, cashContract.id, {
marketTier: getTierFromLiquidity(
cashContract as MarketContract,
subsidyAmount
),
})

log(
`Created cash contract ${cashContract.id} for mana contract ${manaContractId}`
)
Expand Down