Since when you buy a currency pair you actually sign a contract and then when you close your position you sign another contract with the same quantity but with just a diference value for each currency, you just have to have the difference between the contract values

which is your margin. Thats how I understand the market

maybe im wrong
