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

refactor: emit tick spread factor reward and uptime reward events when tick is crossed (APR calc #1) #5366

Merged
merged 4 commits into from
May 31, 2023

Conversation

p0mvn
Copy link
Member

@p0mvn p0mvn commented May 31, 2023

Closes: #XXX

What is the purpose of the change

This PR introduces changes necessary for the data team to compute the position APRs.

Data team needs to track 4 things to be able to do that:

  1. Spread reward and uptime accumulator tick updates in events (this PR)
  2. Query pool spread rewards accumulator (future PR)
  3. Query pool uptime accumulator (future PR)
  4. Query reward accumulators for each individual tick (future PR)

This PR focuses on point #1 only.

To enable this adds a new proto generated struct

message UptimeTrackers {
  repeated UptimeTracker list = 1
      [ (gogoproto.moretags) = "yaml:\"list\"", (gogoproto.nullable) = false ];
}

This allows us tor serialize the uptime tracker list easily for the events. Otherwise, we would have to implement a custom serializer.

Testing and Verifying

  • Added basic test that event is emitted

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes?
  • Changelog entry added to Unreleased section of CHANGELOG.md?

Where is the change documented?

  • Specification (x/{module}/README.md)
  • Osmosis documentation site
  • Code comments?
  • N/A

@p0mvn p0mvn added V:state/compatible/no_backport State machine compatible PR, depends on prior breaks A:no-changelog labels May 31, 2023
@p0mvn p0mvn changed the title refactor: emit tick fee reward and uptime reward events when tick is crossed (APR calc #1) refactor: emit tick spread factor reward and uptime reward events when tick is crossed (APR calc #1) May 31, 2023
@p0mvn p0mvn marked this pull request as ready for review May 31, 2023 00:27
@p0mvn p0mvn requested a review from czarcas7ic as a code owner May 31, 2023 00:27
@p0mvn p0mvn merged commit 20650cf into main May 31, 2023
@p0mvn p0mvn deleted the roman/emit-cross-tick-reward-events branch May 31, 2023 01:54
pysel pushed a commit that referenced this pull request Jun 6, 2023
…n tick is crossed (APR calc #1) (#5366)

* refactor: emit tick fee reward and uptime reward events when tick is crossed

* script go mod

* lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:no-changelog C:x/concentrated-liquidity V:state/compatible/no_backport State machine compatible PR, depends on prior breaks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants