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
Add dynamic fee support for protocol and swap fees #3
Conversation
Tests added for different being used, on each test case multiple trades are executed and we check the right protocolFee is transferred in the next liquidity change. |
Next question is the protocolFee variable, should we change the name to something that implies that is the value for whats the swapFee is divided? Like |
@AugustoL what about |
protocolFeeDivider ? ^^ |
@pimato We will leave the change of the protocolFee for the next PR. |
- Adds protocolFee variable with a setter in the token factory. - Adds a swapFee with a setter in the token pair and token pair factory contracts. - Get the fees from the contract public variables when is used in the math.
58759ac
to
0aa23c0
Compare
I just changed it here for protocolFeeDenominator |
This PR implements the smart contract changes discussed in issue #1.
Changes in TokenPair factory:
protocolFee
public variable, used as divider for the swap fee.protocolFeePercentage = swapFeePercentage * 1/protocolFee+1
changessetSwapFee
function in the token pair, which can be called only by the pair factory contract. changesAdded two test cases, one that tests the new protocolFee after changed and another that tests the swapFee after changed in #6