Skip to content

Conversation

@nick
Copy link
Contributor

@nick nick commented Dec 18, 2023

  • Add OGVDailyStat
  • Add the following fields to OUSDDailyStat and OETHDailyStat: tradingVolumeUSD, marketCapUSD, holdersOverThreshold, yieldETH7Day, yieldUSD7Day

@nick nick requested a review from apexearth December 19, 2023 22:32
{
holders_over_threshold: number
}[]
>(holderStatsQuery)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't mind centralizing these queries somewhere.
Perhaps with some sort of syntax like queries(ctx.store).ogvHolderStats()
Important factor being having all our one-off queries in a single place. I bring it up because I keep seeing new ones introduced.

const holderStatsQuery = `
SELECT COUNT(*) as holders_over_threshold
FROM ogv_address
WHERE balance > 100000000000000000000
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi think we can do WHERE balance > 1e17 which is cool

export async function applyCoingeckoData(
ctx: Context,
props: {
Entity: any
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: otoken processor shows how to do this, and yeah i know it's a pain in the rear


const updatedStats = []
let whereClause = {
timestamp: LessThanOrEqual(getStartOfDayTimestamp()),
Copy link
Collaborator

@apexearth apexearth Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively dayjs.utc().startOf('day').toDate()

} else {
const coingeckData = processCoingeckoData(coingeckoJson)
for (const dayId in coingeckData) {
const stat = statsWithNoPrice.find((s) => s.id === dayId) as
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's good that we cast it here since we define it as any above

Copy link
Collaborator

@apexearth apexearth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall lgtm, left some comments

@nick nick merged commit dbfd813 into main Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants