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

feat(vpool): add event fields for web app #1019

Merged
merged 5 commits into from
Oct 22, 2022

Conversation

Unique-Divine
Copy link
Member

@Unique-Divine Unique-Divine commented Oct 22, 2022

Description

Adds a BlockHeight, MarkPrice, and BlockTimestamp to the snapshot event releaed in the perp module's EndBlocker. This will make the event more similar to common Ethereum tables (example Aave Deposits Table)

Purpose

Right now, two queries are required to get the full information needed to graph price data in the web app. The GraphQL query looks like this:

image

This query requires two separate DB reads (one for the timestamps and one for the reserves) and some parsing of the arrays after the query to iterate through and compute the mark price values.

image

By adding the few proto fields described in the PR description, the single query is much easier to work with in downstream applications.

@Unique-Divine Unique-Divine added the type: enhancement New feature or request label Oct 22, 2022
@Unique-Divine Unique-Divine requested a review from a team as a code owner October 22, 2022 22:22
@Unique-Divine Unique-Divine enabled auto-merge (squash) October 22, 2022 22:32
Copy link
Contributor

@NibiruHeisenberg NibiruHeisenberg left a comment

Choose a reason for hiding this comment

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

You don't need the block time in MarkPriceChangedEvent either?

CHANGELOG.md Outdated Show resolved Hide resolved
@Unique-Divine
Copy link
Member Author

You don't need the block time in MarkPriceChangedEvent either?

Might as well toss it in. One sec

@Unique-Divine Unique-Divine enabled auto-merge (squash) October 22, 2022 22:44
@Unique-Divine Unique-Divine merged commit db623d7 into master Oct 22, 2022
@Unique-Divine Unique-Divine deleted the ud/event-fields-for-web-app branch October 22, 2022 23:27
Unique-Divine added a commit that referenced this pull request Oct 22, 2022
Unique-Divine added a commit that referenced this pull request Oct 23, 2022
… auto-merge (#1021)

* Revert "feat(vpool): add event fields for web app (#1019)"

This reverts commit db623d7.

* event changes - re-run workflows

* add trivial change to run ci

* ci: try other runners

* fix: dependency on wrong version for oracle?

* ci: remove unnecessary run on PR description edit
NibiruHeisenberg pushed a commit that referenced this pull request Oct 23, 2022
* add fields to ReserveSnapshotSavedEvent

* (CHANGELOG): add PR number to description

* fix(CHANGELOG)

* refactor: Make names consistent for BlockTimestamp field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants