-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: utility to calculate quote amounts and costs #210
Conversation
ce4738f
to
7a1d600
Compare
7a1d600
to
143c42b
Compare
No dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No dependency changes detected in pull request |
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.
Soft approve. I agree with leandro that the price being a number is error prone. As a financial app is better to not have rounding issues
Approved, but keep in mind that even after removing the price from the response, the calculation still uses native number for deriving the returned values. |
This is a refactored and improved version of:
Goals of the refactoring:
OrderParameters
which is a DTO from/quote
API.*withFee
/*withoutFee
with*afterFees
/*beforeFees
. Depending on sell/buy order we substract/add network costs to the amounts and it's not super clear whatwith/without
means.network costs
andpartner fees
. Currently,network costs
are named asfeeAmount
inOrderParameters
which is not super clear.bigint
.