excellent portal, well done!
This being said, I'd like to point out some details that bug me:
Apparently the calculation of the fee for the taker (=0.0015 * xlm_offer) isn't subtracted from the amount displayed in the "To receive xxx" field, where xxx is the name of the asset.
This leads to 2 problems for the user:
1/ the UI doesn't display correct information about the trade, before trading
2/ this way of calculating and collecting fees constitutes a problem in some situations, although all the math behind is correct
Let's consider a real-life example that illustrates both 1/ and 2/
Imagine I want to buy 2 units of a custom asset named "atoz" at a price, say, of 1 XLM each.
Thus, I select the pair XLM <> atoz, type 2 in the "Offer XLM" field…
The software displays the number 2 in the "To receive atoz" field ⚠
BUT creating this bid effectively credits the account with 1.997 atoz.
Proof:
https://stellar.expert/explorer/tx/6018d6a70bdeb069faf7c1f7455705f7e2d8236048fb5e0dfec150cfcad66c81
In this example, the value received does not match the value displayed by the software.
As a end-user, I can feel fooled. This is no minor issue, I think.
(explained 1/ )
Another side effect: it is overly difficult to buy precisely 2.0 atoz in a single trade
Once the fee calculation is understood, what should I type in the "Offer XLM" field to receive exactly 2.0 atoz?
I challenge you to find the answer without a pen and a paper!
If that were not enough, the correct answer depends in some cases on wether your algorithm rounds or truncates the fee amount…
(explained 2/ )
Possible solutions:
. allow spending more from the base asset than what's the user typed, in order to collect fees.
I, for example, don't care at all paying 2.0xxxxxx XLM instead of 2.0XLM to get what I precisely want that is: 2.0 atoz.
. OR allow both ways of taking the fee into account (and let the user choose what is appropriate for him) like many bitcoin clients did for subtracting transaction fees (in satoshis)
Keep up the good work! ? thanks a lot