The arithmetic
Money in = coins × buy price + buy fee + other costs. Money back = coins × sell price − sell fee − other costs. The profit is the difference, and the return is that profit divided by the money in, so it is measured against what you actually committed rather than the size of the position.
The break-even price solves money back = money in, which is why it sits above the price you originally paid: the selling fee has to be covered before anything is recovered.
The fee percentages are clamped at a sensible ceiling, and every input is forced to zero if left negative, so the arithmetic cannot return a nonsense figure from a stray keystroke. The result is a single net number that already contains every cost the trade carries.