IATI / D-Portal

http://d-portal.org/
Other
30 stars 23 forks source link

Documentation on exchange rates used #659

Open stevieflow opened 7 months ago

stevieflow commented 7 months ago

We had a query about where d-portal exchange rates are sourced from

I went to : https://d-portal.org/faq.html#tech5

Default USD

Currently (please note this may change soon) converting to USD using the exchange rate of the date specified in the value-date attribute. So when we display USD, it is very accurate to that date.

Other currencies

For other currencies, the USD value is just converted using today’s exchange rate (please note this may change soon).

For budget information in future?

Using the latest exchange rates ([International Monetary Fund](http://www.imf.org/external/np/fin/data/rms_five.aspx)) every night and doing a full re-import once a week, so future budgets will use the current exchange rates and should be updated weekly.

Could this be updated to be more definitive?

Thanks

xriss commented 7 months ago

FAQ is a bit old and slightly out of date.

The exchange rates are sourced from freechange which itself fetches them in the given order / priority described here

https://github.com/xriss/freechange?tab=readme-ov-file#sources

The later sources are used if no data is available in the earlier sources. Hence IMF is preferred but the IMF does not publish data for all currencies for all of history. So we fill in gaps and expand the coverage from alternative sources.

A visualisation of the exchange rate used can be found at https://xriss.github.io/freechange-charts/ to help catch any bugs or possible inaccuracies.

We only handle 4 currencies fully. USD GBP EUR and CAD. By fully I mean the exchange rate at the transaction or budget value date is used for conversions. This is performed at import time hence the limited currencies.

For all the other currencies we convert to USD and then convert from that at todays rate into the target currency, this is more of an estimate and may get increasingly inaccurate as transactions get older.

We do not perform any adjustments for inflation.

The FAQ should be updated but it is a bit complicated to explain so If you have any suggestions on how best to word the FAQ then please suggest away...