-
Notifications
You must be signed in to change notification settings - Fork 39
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
Maker fee #64
base: dev
Are you sure you want to change the base?
Maker fee #64
Conversation
ivanzhelyazkov
commented
Apr 12, 2023
- Add maker fee (strategy owner fee) logic
- Add maker fee tests
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.
Looks great, just a few cosmetic comments
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.
Please take a closer look (carefully review) of the impact of the maker fee in function _updateStrategy
.
Specifically, where value
is addressed a second time:
// refund native token when there's no deposit in the order
// note that deposit handles refunds internally
if (token.isNative() && value > 0 && newOrders[i].y <= orders[i].y) {
payable(address(owner)).sendValue(value);
}
contracts/carbon/Strategies.sol
Outdated
@@ -156,6 +158,8 @@ abstract contract Strategies is Initializable { | |||
|
|||
uint256 private constant ONE = 1 << 48; | |||
|
|||
uint256 private constant DEFAULT_MAKER_FEE = 5e14; // 0.0005 ETH |
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.
I believe that you can simply use 0.0005 ether
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.
changed to 0.0005 ether
, removed comment - seems a bit clearer
contracts/carbon/Strategies.sol
Outdated
* @dev checks if maker fee has been sent with the transaction and returns updated tx value | ||
*/ | ||
function _deductMakerFee(bool revertOnExcess, uint256 txValue) private returns (uint256) { | ||
uint fee = _makerFee; |
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.
Minor: uint256
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.
fixed