Skip to content
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

Challenge #2 #1

Open
platschi opened this issue Jun 21, 2023 · 0 comments
Open

Challenge #2 #1

platschi opened this issue Jun 21, 2023 · 0 comments

Comments

@platschi
Copy link

Subgraph Tech Challenge

The goal is to provide historical market size data from the Kwenta subgraph, intended to be consumed by the frontend for populating charts.

You will need to create a new entity HistoricalMarketStats and include the fields:

timestamp: BigInt
marketKey: Bytes
marketAsset: Bytes
period: "Daily" (1 time period for now but let's create the enum anyway)
marketSize: BigInt

Inside the handlePositionModified handler you should fetch the market size of the market being traded and create / update the daily stat. The latest stat can overwrite the existing one if there has already been one logged for that day.

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

No branches or pull requests

1 participant