The Math Behind Bancor Token Exchange Smart Contract