rainbow-me / rainbow

🌈‒ the Ethereum wallet that lives in your pocket
https://rainbow.me
GNU General Public License v3.0
3.82k stars 590 forks source link

Hook up minimum received and max sold values #5900

Closed jinchung closed 2 days ago

jinchung commented 3 days ago

Fixes APP-1620

What changed (plus any additional context for devs)

Issues solved:

  1. The minimum received value in the review panel was not hooked up correctly and always showed the same value as the output amount.
  2. The minimum received value always displayed, even for output-based trades (which should show the maximum sold amount instead.)
  3. Includes a version bump to swaps SDK v0.22.0

This PR will require some follow up after launch. We have a few updates that we want to do from the backend, so for now, the minimum received value is hooked up correctly (value after fees and slippage) but the maximum sold amount currently matches the input amount for output-based trades (the most pessimistic/conservative estimate we have.) We'll update this in a later release.

What to test

Test with a variety of input-based vs output-based trades. Input-based trades should show "Minimum Received" in the review panel with a value that is less than the output amount. Output-based trades should show "Maximum Sold" in the review panel with a value that matches in the input amount. (This will be updated later)

Screen recordings / screenshots

Simulator Screenshot - iPhone 15 Pro - 2024-06-28 at 07 12 11 Simulator Screenshot - iPhone 15 Pro - 2024-06-28 at 07 12 42 Simulator Screenshot - iPhone 15 Pro - 2024-06-28 at 07 13 03 Simulator Screenshot - iPhone 15 Pro - 2024-06-28 at 07 13 16 Simulator Screenshot - iPhone 15 Pro - 2024-06-28 at 07 14 10

linear[bot] commented 3 days ago

APP-1620 Quoted output amount same as min received

socket-security[bot] commented 3 days ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@rainbow-me/swaps@0.22.0 environment, eval, network +11 3.4 MB brunobar79

🚮 Removed packages: npm/@rainbow-me/swaps@0.21.0

View full report↗︎