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.
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.