-
Notifications
You must be signed in to change notification settings - Fork 101
feat: add tests for aux native fees #2642
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
…epool.ts Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
| const grossRelayerFeeUsd = inputAmountUsd.sub(outputAmountUsd).sub(lpFeeUsd).sub(auxiliaryNativeTokenCostUsd); | ||
| const grossRelayerFeePct = grossRelayerFeeUsd.gt(bnZero) | ||
| ? grossRelayerFeeUsd.mul(fixedPoint).div(inputAmountUsd) | ||
| : bnZero; |
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.
We cap grossRelayerFeePct at 0 min, and not reporting negative values, whereas we do report negative values netRelayerFeePct (which is also crucial for our min profitability caps because if we drop the minRelayerProfitability to e.g. 0, then we don't want to be filling relays with profitability -100%, which is giving away all of our money).
So should we report negatives for grossRelayerFeePct? We don't really use grossRelayerFeePct anywhere other than in logs, so it's not that mission critical for now.
Also, grossRelayerFeePct is from user POV, whereas netRelayerFeePct is from relayer POV. A bit confusing
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.
To me it makes sense to have this value go negative. It seems that in cases where auxiliaryNativeTokenCostUsd is nonzero, there are chances for grossRelayerFeeUsd to be negative and that information would just be lost when we floor to 0.
Updates to
ProfitClientlogicWe should treat aux fees as a part of gross capital outlay for relayer, otherwise values like
grossFeeUsd(the fee relayer is receiving from user directly, but before relayer gas expenditure) andtotalFeePct(total fee pct paid by user into the system: relayer + lps) don't make senseTests for
ProfitClient(SVM-destined deposits only):+ sdk bump
Closes ACX-4497