Skip to content

Futures remove closure fee and rounding#1610

Merged
artdgn merged 3 commits intofutures-implementationfrom
futures-remove-closure-fee
Dec 9, 2021
Merged

Futures remove closure fee and rounding#1610
artdgn merged 3 commits intofutures-implementationfrom
futures-remove-closure-fee

Conversation

@artdgn
Copy link
Copy Markdown
Contributor

@artdgn artdgn commented Nov 26, 2021

Warning: This PR is on top of futures-next-price branch (#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).

Loading
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.

2 participants