-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fixed net profit panel, sync updateAuctionsPrices calls #566
Conversation
Since it could be tricky to directly test the fix with simulated or live auctions, I adjusted the default story of |
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 doesn't solve actual problem. Actual problem is: at first auction is fetched and added to the store, then another enrichment is applied that is not initially await
ed. Instead, we should await all enrichments before the auction is added to the store
The proposal is to remove changes introduced here (or just open a new pr) and instead solve actual problem
I guess this comment is meant for another PR? Here, we’re merely passing the selected auction’s net profit to the profit check panel. |
No, I'm talking about the root cause of the problem and speculating on the solution (which might not be correct). The actual problem is not "profit check panel", but this state of the auction: Which should not exists in the first place. If automatic router is enabled, the UI should always:
But what is correctly happening
Above was a speculation on why it is happening: auto-router is not |
:gross-profit="auctionTransaction.transactionGrossProfit" | ||
:net-profit="auctionTransaction.transactionNetProfit" |
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.
I still think the changes are relevant. Here, we are passing the gross and net profit from the auctionTransaction
directly, which are based on suggestedMarketId
alone, not the currently selected marketId
. So, the problem will happen even for collaterals that don't support auto router.
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.
Created a testing scenario via USDC-A
auction simulation (see recording below). As required the net profit panel now is inline with the callee selection.
updateAuctionsPricesIntervalId = setInterval( | ||
async () => await dispatch('updateAuctionsPrices'), | ||
TIMER_INTERVAL | ||
); |
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.
btw, @KirillDogadin-std, this change doesn't make any difference 🙂
updateAuctionsPricesIntervalId = setInterval( | |
async () => await dispatch('updateAuctionsPrices'), | |
TIMER_INTERVAL | |
); | |
updateAuctionsPricesIntervalId = setInterval(() => dispatch('updateAuctionsPrices'), TIMER_INTERVAL); |
setInterval
doesn't expect any promises and doesn't do anything different if received a promise() => Promise
would already return the promise, making itasync () => await Promise
not change what is returned or how it's awaited
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.
yes, buuuuut i have an everlasting problem with forgetting to await sometimes. Aaand making the async syntax propagated to the top helps a bit because it explicitly screams of promises.
Closes #564.
switching.mp4
Checklist:
#
)