Closed 0xApotheosis closed 1 year ago
Will fix tests, then open.
For expediency of fixing a prod issue I'm going to open a separate PR that excludes the name fixes.
I'll do this once the monorail service is up and running 🚄
Replaced by https://github.com/shapeshift/lib/pull/1235.
Tip for reviewers: the only actual logic change in this PR is in https://github.com/shapeshift/lib/commit/65beae0c4ad9fff1cd2c94b50fbf5f276e27b289, the reset is just renaming.
Existing logic incorrectly assumes that the
sellAmountCryptoBaseUnit
is the amount not including fees.In reality, CoW Swap subtracts any trading fees from the
sellAmountCryptoBaseUnit
value in the returned response, so we need to add them back on to get the true "sell amount" of the sell asset.This is causing the UI to show that the "sell amount is lower than the fee" when the sell amount is above the minimum by less than the fee amount.
To test, attempt to use CoW swap to trade, say, $21 - this should now work, whereas previously is would not until you sold $20 plus the fee amount.
Also refactors the naming of
minimum
andmaximum
to show their actual units.