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

Remove duplicated one minus spread factor calculations (backport #8040) #8066

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Apr 17, 2024

Remove duplicated one minus spread factor calculations.

Since there are only a small number of spread factors, we may consider just putting this in RAM eventually. In a subsequent (state breaking PR) I also want to cache spreadfactor / (1 - spreadfactor) and use that directly in computations.

I'm interested in feedback if this is worth the code complexity. This PR: cosmos/cosmos-sdk#20034 will also help speedup the quo logic in this code. (It will 50% reduce the QuoRoundUpMut time seen in prod)

Summary by CodeRabbit

  • New Features
    • Improved consistency in spread factor calculations across various trading strategies.
  • Refactor
    • Updated functions related to spread reward charges to include new parameters and logic enhancements, enhancing accuracy and performance in trading calculations.

This is an automatic backport of pull request #8040 done by [Mergify](https://mergify.com).

@ValarDragon ValarDragon merged commit 7196714 into v24.x Apr 17, 2024
1 check passed
@ValarDragon ValarDragon deleted the mergify/bp/v24.x/pr-8040 branch April 17, 2024 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant