-
Notifications
You must be signed in to change notification settings - Fork 95
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
TradeModuleV2 and GeneralIndexModuleV2 #154
base: master
Are you sure you want to change the base?
Conversation
Commenting the diff for TradeModule and GeneralIndexModule |
internal | ||
returns (uint256 protocolFee, uint256 managerRebate) | ||
{ | ||
uint256 totalFeePercentage = controller.getModuleFee(address(this), TRADE_MODULE_V2_TOTAL_FEE_INDEX); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use:
uint256 totalFees = getModuleFee(TRADE_MODULE_PROTOCOL_FEE_INDEX, _exchangedQuantity);
managerRebate = controller.getModuleFee(address(this), TRADE_MODULE_V2_MANAGER_REBATE_SPLIT_INDEX).preciseMul(totalFees);
protocolFee = totalFees.sub(managerRebate);
I think that way you can be more confident about not having some extra wei sent out due to rounding and you aren't recalculating totalFeePercentage.preciseMul(_exchangedQuantity)
* @param _setToken Instance of the SetToken to update fee recipient | ||
* @param _newRebateRecipient New rebate fee recipient address | ||
*/ | ||
function updateFeeRecipient( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make this clearer and call it updateRebateRecipient
* @param _setToken Instance of the SetToken to update fee recipient | ||
* @param _newRebateRecipient New rebate fee recipient address | ||
*/ | ||
function updateFeeRecipient( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would call this updateRebateRecipient
as well
uint256 totalFeePercentage = controller.getModuleFee(address(this), GENERAL_INDEX_MODULE_V2_TOTAL_FEE_INDEX); | ||
uint256 managerRebateSplitPercentage = controller.getModuleFee(address(this), GENERAL_INDEX_MODULE_V2_MANAGER_REBATE_SPLIT_INDEX); | ||
|
||
managerRebate = totalFeePercentage.preciseMul(exchangedQuantity).preciseMul(managerRebateSplitPercentage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would change this math similarly to TradeModuleV2
comment
Code Review Processes
New Feature Review
Before submitting a pull request for new review, make sure the following is done:
README Checks
Code Checks
Broader Considerations