-
Notifications
You must be signed in to change notification settings - Fork 0
Daily stats expansion #36
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
Conversation
| { | ||
| holders_over_threshold: number | ||
| }[] | ||
| >(holderStatsQuery) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
src/utils/coingecko.ts
Outdated
| export async function applyCoingeckoData( | ||
| ctx: Context, | ||
| props: { | ||
| Entity: any |
There was a problem hiding this comment.
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()), |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
apexearth
left a comment
There was a problem hiding this 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
Uh oh!
There was an error while loading. Please reload this page.