The simplest model is to assume the same exchange rate for both buying and selling each currency; and that exchanging through an intermediate currency nets the same result as a direct exchange. That is,
- You get back exactly your initial investment if you convert from currency A to currency B and then back to A again.
- You get the same result exchanging currency A to B to C as you do by exchanging A to C.
Real-world foreign exchange markets are not so simple. There are separate buy/sell exchange rates for every pair of currencies.
Can you make the simplifying assumptions listed above or does your program need to accommodate the messier real world?