Skip to content

Commit

Permalink
cast contract as sportscontract
Browse files Browse the repository at this point in the history
  • Loading branch information
SirSaltyy committed Jan 16, 2025
1 parent a81cd32 commit b6b9bd6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions backend/shared/src/resolve-sports-markets.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createSupabaseDirectClient } from 'shared/supabase/init'
import { log } from 'shared/utils'
import { CPMMMultiContract } from 'common/contract'
import { SportsContract } from 'common/contract'
import { HOUSE_LIQUIDITY_PROVIDER_ID } from 'common/antes'
import { resolveMarketHelper } from 'shared/resolve-market-helpers'
import { getLiveScores } from 'shared/get-sports-live-scores'
Expand Down Expand Up @@ -33,7 +33,7 @@ export async function resolveSportsMarkets() {
.join(', ')})
`,
completedGameIds,
(row) => convertContract(row)
(row) => convertContract<SportsContract>(row)
)

log(`Found ${unresolvedContracts.length} unresolved contracts.`)
Expand Down Expand Up @@ -77,7 +77,8 @@ export async function resolveSportsMarkets() {

for (const contract of matchingContracts) {
try {
const multiContract = contract as CPMMMultiContract
if (contract.mechanism!=='cpmm-multi-1') continue
const multiContract = contract
const { answers, sportsLeague } = multiContract
const isEPL = sportsLeague === 'English Premier League'

Expand Down

0 comments on commit b6b9bd6

Please sign in to comment.