Futures remove closure fee and rounding#1610
Merged
artdgn merged 3 commits intofutures-implementationfrom Dec 9, 2021
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning: This PR is on top of
futures-next-pricebranch (#1609) so should be merged only AFTER that PR is merged. But can be reviewed already.Implements Synthetixio/issues#380
Also removes usage of rounding for decimal operations in futures contracts and tests.
The order fee calculation has been simplified to only consider the direction of the trade w.r.t. the skew before the trade. This makes the code simpler, more efficient, and easier to reason about and test. This means that in the edge-case of a trade that flips the skew - the fee will be charged as if it doesn't. This should be negligible both because this will a rare edge case, and because the difference in that case is very small (whether the full fee is all taker, all maker, or a combination).