-
Notifications
You must be signed in to change notification settings - Fork 113
fix(TPU): add trade fee estimation for TPU code #2624
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: dev
Are you sure you want to change the base?
Conversation
…ee, use non zero address, add funding spend fee
* dev: fix(TPU): correct dexfee in check balance to prevent swap failures (#2600) fix(tests): fix/remove kmd rewards failing test (#2633) chore(ci): bump CI container image to debian bullseye-slim to match dev (#2641) chore(release): add changelog entries for v2.5.2-beta (#2639) chore(release): bump mm2 version to 2.5.2-beta (#2638) feat(ci): add macos universal2 build (#2628) fix(metrics): remove memory_db size metric (#2632) fix(zcoin): exact-anchor witnesses in wasm get_spendable_notes (#2629) fix(evm-swapv2): no mempool inclusion required for maker payment validation (#2618) chore(rust 1.90): make CI clippy/fmt pass Revert "fix(ordermatch): ignore loop-back; clear on null root; reject stale keep-alives (#2580)" Revert "fix(orderbook): validate roots before commit (#2605)"
|
Conflicts resolved, |
One important test fails. To draft for now.. |
… fake swap values which did not work w/o token approval first)
Looks like tests are okay now. I saw once failure of So I am converting the PR to ready now. |
|
@shamardy |
|
@shamardy |
|
@shamardy |
|
@shamardy |
|
@shamardy |
8 similar comments
|
@shamardy |
|
@shamardy |
|
@shamardy |
|
@shamardy |
|
@shamardy |
|
@shamardy |
|
@shamardy |
|
@shamardy |
Before this PR, the legacy swap functions were used to estimate trade fees (tx fees) for TPU swaps, so those estimations may not have been quite accurate.
This PR adds trade fee estimation functions for TPU swap steps (like send taker funding, spend taker funding, send maker payment etc).
As refactoring, a new SwapTotalFeeHelper trait is added to abstract getting fees for balance checking in swaps.
TODO: add more tests to validate taker and maker max_volume/trade_preimage estimations for TPU swap fee estimations added in this PR.