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(x/metoken) rewards auction integration #2513

Merged
merged 11 commits into from
May 3, 2024
Merged

Conversation

robert-zaremba
Copy link
Member

Description

Copy link
Contributor

coderabbitai bot commented Apr 30, 2024

Walkthrough

The recent changes focus on enhancing the Umee protocol's auction and fee management systems. These updates introduce new reward distribution mechanisms, improve fee calculations, and enhance communication between modules. Additionally, mathematical utility functions now include equality checks for more robust operations within the system.

Changes

Files Change Summary
proto/umee/auction/v1/events.proto,
proto/umee/leverage/v1/events.proto
Added EventFundRewardsAuction for rewards and removed EventFundAuction.
proto/umee/metoken/v1/metoken.proto,
x/metoken/params.go
Introduced rewards_auction_factor and updated fee distribution logic.
util/bpmath/bp.go, util/bpmath/bp_test.go,
util/bpmath/fixed_bp.go, util/bpmath/fixed_bp_test.go
Added Equal methods and tests for precise mathematical comparisons.
x/leverage/keeper/oracle.go,
x/metoken/expected_keepers.go,
x/metoken/genesis.go,
x/metoken/keeper/fee.go,
x/metoken/keeper/intest/msg_server_test.go,
x/metoken/keeper/mocks_test.go,
x/metoken/keeper/redeem.go,
x/metoken/keeper/redeem_test.go,
x/metoken/keeper/swap.go,
x/metoken/keeper/swap_test.go,
x/metoken/keeper/unit_test.go
Enhanced module interactions, refined fee management, and updated test functions.

🐰✨
In the land of code, where the bits align,
A rabbit hopped through, making changes so fine.
With a tweak and a twirl of its little paw,
The auction rewards find a new law.
Hop, skip, a jump in the codebase vast,
Ensuring every byte is perfectly cast.
🌟🐇


Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 0c40d80 and 0e6dfcf.
Files selected for processing (2)
  • x/metoken/keeper/intest/msg_server_test.go (34 hunks)
  • x/metoken/keeper/swap.go (7 hunks)
Files skipped from review as they are similar to previous changes (2)
  • x/metoken/keeper/intest/msg_server_test.go
  • x/metoken/keeper/swap.go

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@robert-zaremba robert-zaremba force-pushed the robert/metoken-fees branch from afaf187 to 6ad381e Compare May 1, 2024 12:32
@robert-zaremba robert-zaremba marked this pull request as ready for review May 1, 2024 12:52
@robert-zaremba robert-zaremba requested a review from a team as a code owner May 1, 2024 12:52
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Out of diff range and nitpick comments (1)
x/metoken/params.go (1)

8-8: Consider adding a comment explaining the 1000 value for RewardsAuctionFactor to improve code readability and maintainability.

x/leverage/keeper/oracle.go Show resolved Hide resolved
x/metoken/keeper/intest/msg_server_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@kosegor kosegor left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@gsk967 gsk967 left a comment

Choose a reason for hiding this comment

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

utACK, LGTM

@robert-zaremba robert-zaremba enabled auto-merge May 3, 2024 19:53
Copy link

codecov bot commented May 3, 2024

Codecov Report

Attention: Patch coverage is 73.77049% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 63.10%. Comparing base (7f05ad4) to head (0e6dfcf).
Report is 462 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2513       +/-   ##
===========================================
- Coverage   75.38%   63.10%   -12.29%     
===========================================
  Files         100      272      +172     
  Lines        8025    15690     +7665     
===========================================
+ Hits         6050     9901     +3851     
- Misses       1589     5029     +3440     
- Partials      386      760      +374     
Files Coverage Δ
util/bpmath/bp.go 93.75% <100.00%> (ø)
util/bpmath/fixed_bp.go 80.00% <100.00%> (ø)
x/metoken/keeper/fee.go 68.96% <ø> (ø)
x/metoken/params.go 100.00% <100.00%> (ø)
x/leverage/keeper/oracle.go 58.97% <0.00%> (-8.86%) ⬇️
x/metoken/genesis.go 81.48% <50.00%> (ø)
x/auction/events.go 0.00% <0.00%> (ø)
x/metoken/keeper/redeem.go 51.92% <66.66%> (ø)
x/metoken/keeper/swap.go 65.54% <78.57%> (ø)

... and 231 files with indirect coverage changes

@robert-zaremba robert-zaremba added this pull request to the merge queue May 3, 2024
Merged via the queue into main with commit 5d47e66 May 3, 2024
20 of 26 checks passed
@robert-zaremba robert-zaremba deleted the robert/metoken-fees branch May 3, 2024 20:03
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

Successfully merging this pull request may close these issues.

3 participants