fix calculation of exchanged amount