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

fix: add fees in TT price calculation #1990

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Conversation

mustermeiszer
Copy link
Collaborator

Description

See issue

Fixes #1989

Changes and Descriptions

  • just adds fees to tranche token price calculation

Checklist:

  • I have added Rust doc comments to structs, enums, traits and functions
  • I have made corresponding changes to the documentation
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works

@mustermeiszer mustermeiszer added the D0-ready Pull request can be merged without special precaution and notification. label Sep 11, 2024
Copy link
Contributor

@lemunozm lemunozm left a comment

Choose a reason for hiding this comment

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

Makes sense! LGTM

let nav = Nav::new(nav_loans, nav_fees);
let total_assets = nav
.total(pool.reserve.total)
.unwrap_or(<T as Config>::Balance::zero());
Copy link
Contributor

Choose a reason for hiding this comment

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

Super NIT: unwrap_or_default()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am not the biggest fan of default in these case. Zero is really explicit and also what we want.

Copy link

codecov bot commented Sep 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.22%. Comparing base (7af4729) to head (49cce6b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1990      +/-   ##
==========================================
+ Coverage   48.19%   48.22%   +0.02%     
==========================================
  Files         183      183              
  Lines       13403    13406       +3     
==========================================
+ Hits         6460     6465       +5     
+ Misses       6943     6941       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mustermeiszer
Copy link
Collaborator Author

Why did the pipeline fcancel.

@mustermeiszer mustermeiszer merged commit 927af06 into main Sep 13, 2024
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D0-ready Pull request can be merged without special precaution and notification.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Calculate Tranche Token Prices with NavFees
2 participants