fix: cross-subnet received amount in stake move display#910
Conversation
d0fe30e to
4e208a7
Compare
thewhaleking
left a comment
There was a problem hiding this comment.
I'll look into this more later, but I also want @ibraheem-abe's insight, specifically involving the fact it seems from this we'd be doing pricing calculations twice: once within SimSwap, and once within MovementPricing
Thanks for your feedback. This PR only switches the confirmation table’s |
ibraheem-abe
left a comment
There was a problem hiding this comment.
The previous calculation was consistent as a spot-price / linear-pricing estimate, but sim_swap is the more authoritative source for received since it reflects the runtime swap path directly.
I tried a few scenarios (dynamic -> 0, dynamic -> dynamic) and the behavior looked reasonable.
In the cases I checked, the displayed delta versus the old estimate was small, roughly 0.02% to 0.06%.
Closes #909
Use
sim_swap.alpha_amountfor the cross-subnet received amount instead of recalculating it with linear math. Add missingif not proxy:guard for extrinsic fee deduction in the cross-subnet path.