Hi Philip,
For GL - The difference between the rate at transaction date and rate at the 'To date' in the foreign currency revaluation form multiplied by the amount in transaction currency for all transactions in foreign currency
For AP & AR - The difference between the rate at transaction date and rate at the 'Date of rate' in the foreign currency revaluation form multiplied by the 'unsettled' part in transaction currency for all transactions in foreign currency
In both cases, AX uses the rates from the 'default exchange rate type' attached to the ledger (General ledger | Setup | Ledger)
Regards
Biju John