Skip to content

Instantly share code, notes, and snippets.

@adrake33
Last active March 17, 2019 20:47
Show Gist options
  • Save adrake33/c4b671181a1b4fb350b5dc6f18d11570 to your computer and use it in GitHub Desktop.
Save adrake33/c4b671181a1b4fb350b5dc6f18d11570 to your computer and use it in GitHub Desktop.
export interface GetMarketsInfoResults {
id: string, // MarketCreated.market
universe: string, // MarketCreated.universe
marketType: string, // MarketCreated.marketType
numOutcomes: number, // Derived from MarketCreated.outcomes
minPrice: string, // MarketCreated.minPrice
maxPrice: string, // MarketCreated.maxPrice
cumulativeScale: string, // MarketCreated.maxPrice - MarketCreated.minPrice
author: string, // MarketCreated.marketCreator
creationTime: number, // Block timestamp of MarketCreated event
creationBlock: number, // Block number of MarketCreated event
creationFee: string, // MarketCreated.marketCreationFee
settlementFee: string, // reportingFeeRate - marketCreatorFeeRate
reportingFeeRate: string, // Universe.getOrCacheReportingFeeDivisor() -- Should be logged?
marketCreatorFeeRate: string, // Market.getMarketCreatorSettlementFeeDivisor() -- Should be logged?
marketCreatorFeesBalance: string, // Should be logged?
marketCreatorMailbox: string, // Market.getMarketCreatorMailbox() -- Should be logged?
marketCreatorMailboxOwner: string, // Should be logged?
initialReportSize: string|null, // InitialReportSubmitted.amountStaked
category: string, // MarketCreated.topic -- should be called topic in v2
tags: Array<(string|null)>, // MarketCreated.topic -- should be removed in v2
volume: string, // MarketVolumeChanged.volume
openInterest: string, // Use most recent CompleteSetsPurchased.marketOI or CompleteSetsSold.marketOI
outstandingShares: string, // Should be logged?
reportingState: ReportingState|null, // Should be logged?
forking: boolean|number, // Should be logged?
needsMigration: boolean|number, // Should be logged?
feeWindow: string, // DisputeWindow in v2
endTime: number, // Market.getEndTime() -- Should be logged?
finalizationBlockNumber: number|null, // Block number of MarketFinalized event
finalizationTime: number|null, // Market.getFinalizationTime() -- Should be logged?
lastTradeBlockNumber: number|null, // Block number of last OrderFilled event?
lastTradeTime: number|null, // Block timestamp of last OrderFilled event?
description: string, // MarketCreated.description
details: string|null, // MarketCreated.extraInfo.longDescription
scalarDenomination: string|null, // Market.getDenominationToken() -- Should be logged?
designatedReporter: string, // InitialReportSubmitted.isDesignatedReporter & InitialReportSubmitted.reporter
designatedReportStake: string, // InitialReportSubmitted.isDesignatedReporter & InitialReportSubmitted.amount
resolutionSource: string|null, // MarketCreated.extraInfo.resolutionSource
numTicks: string, // Market.getNumTicks() -- Should be logged?
tickSize: string, // maxPrice - minPrice / numTicks?
consensus: NormalizedPayout|null, // Should be logged?
outcomes: Array<OutcomeInfo> // MarketCreated.outcomes
}
@nuevoalex
Copy link

I think these values shouldn't be included in this and can be pulled on demand when a singular market is being rendered in some non-card capacity (correct me if I'm mistaken on that):

reportingFeeRate
marketCreatorFeeRate
initialReportSize
outstandingShares
forking
feeWindow
lastTradeBlockNumber
lastTradeTime
designatedReporter
designatedReportStake

scalarDenomination is from the extraInfo field that is logged

Should be logged:

endTime
finalizationTime
numTicks
consensus (From the market finalization log)

Looks right otherwise!

In this case the existing "join" behavior will really just be an amalgamation of queries into specific event tables requesting their data for a collection of market ids so its pretty easy. The joins we really want to hopefully avoid are conditional things if possible.

@adrake33
Copy link
Author

Yep, I agree that moving the first list of values into a separate getter makes sense. For the second list, are you saying that those values should be logged in v2, or that they should already be logged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment