Open temptemp3 opened 1 month ago
This issue resides in the ulujs lib, when swapping 'b for a' the decimal setting of the other token is used. This fixes it but is there a nicer way? The price impact would still jump of course but at least the final output is correct with this.
I think this makes sense especially since since the final value is correct. I'm thinking there seams like a nicer way especially one where we don't have to call decA the B.decimals. Let me see ; )
It seams like we would be able to achieve the same results here https://github.com/HumbleOSS/humble-interface/blob/beta/src/components/Swap/index.tsx#L721
However I am leaning towards you being right about updating the library function because we set decA and decB before we know the direction. Perhaps A and B should be mA and mB (maybeA lol)
If ulujs.swap::rate is just wrong we would fix it first to resolve the issue ; )
You are right on the money ; )
You should be able to bump ulujs up to latest version. The rest of the price impact jumping is something that you could handle in the ui.
Bumped ulujs in beta branch
2024年10月27日(日) 6:57 Jelle Bekker @.***>:
This issue resides in the ulujs lib, when swapping 'b for a' the decimal setting of the other token is used. This fixes it but is there a nicer way? image.png (view on web) https://github.com/user-attachments/assets/c276fdbc-f14b-4b67-a98e-c7deba4c8122
— Reply to this email directly, view it on GitHub https://github.com/HumbleOSS/humble-interface/issues/2#issuecomment-2440005509, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFQ4AW653X5VYKVQBXVT7P3Z5TIJXAVCNFSM6AAAAABPMYB2RKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBQGAYDKNJQHE . You are receiving this because you authored the thread.Message ID: @.***>