-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix rounding of surplus/protocol_fee/score (#2857)
# Description Related to #2797 (comment) Fixes issue in `driver` and new `autopilot` code. Old `autopilot` code is not fixed and I don't intend to do it. This means that settlement observations will still be wrong until new code is used. Dependent on #2843 Note that this change affects the whole range of functionalities: surplus, protocol fee, score calculation. # Changes <!-- List of detailed changes (how the change is accomplished) --> - [ ] Whenever we calculate `buy_amount` for `sell` orders, use `ceil_div` to be consistent with settlement contract logic ## How to test Added unit test that shows that new code calculates the expected circuit breaker surplus of `384509480572312` Expected score is 2 x surplus. <!-- ## Related Issues Fixes # -->
- Loading branch information
Showing
4 changed files
with
156 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters