-
Notifications
You must be signed in to change notification settings - Fork 5
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
Generic Time Series Queries #191
Comments
Hi Sam. For those who aren't as familiar with SQL but are still curious in what is proposed, could you provide a pseudo-example response from each query? |
So each of these take the form of Similarly Here is an example in GraphQL form:
Does this explain better? It also probably makes sense to add an optional ilk filter and to order the result by date. |
Thanks for the input! Will put some thought into considering how we could support these kinds of queries 👍 |
Wrote a PR for ilk_snapshot: #202 I think this format can be generalized to many of the other trigger/storage tables. In particular I am prefixing |
PR for auctions: #211 |
Continuing on from here: #179
I think a common use case for this data is going to be displaying time series data on these values/events.
I think we should provide a common generic api for querying stats with 3 parameters. A start datetime, an end datetime and a granularity bucket size. I've added these three for collateral price, savings dai and collateral locked:
I'm not the best with Postgres so maybe there is a cleaner way to write those, but I think this pattern can be generalized to produce aggregation over most stats. For single values we can provide the latest value in the bucket (as in the examples above). For event-based stats such as Draws/Wipes we can provide both SUM and AVERAGE aggregators.
Also, does it make sense to have all these definitions in one giant schema.sql file? Maybe it makes sense to break these apart into more manageable pieces?
The text was updated successfully, but these errors were encountered: