-
Notifications
You must be signed in to change notification settings - Fork 41
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
Implement swap fees #676
Implement swap fees #676
Conversation
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.
This PR extends the pool creation with fee functionality, so that every trade on the pool afterwards charges a fee of a maximum MaxSwapFee
amount. Great job!
I wonder where the fee amount goes? To the liquidity providers? Is that already implemented and part of another PR?
Co-authored-by: Chralt <chralt98@gmail.com>
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.
LGTM. Thank you @maltekliemann for the detailed answers. You really nailed it.
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.
Finally another feature that motivates to think before doing the swap 😄 .
Good PR, couldn't find anything critical. Assume this is the usual high standard you provide and the detailed review from @Chralt98 . Good job!
Co-authored-by: Harald Heckmann <mail@haraldheckmann.de>
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.
Now the swap fee is correctly regarded in the calc_spot_price
calculation. You added useful sanity checks, that check if a malicious actor can steal out of the pool. Looks cool.
Closes #643.