open-contracting / standard

Documentation of the Open Contracting Data Standard (OCDS)
http://standard.open-contracting.org/
Other
138 stars 46 forks source link

Value: Exchange rate #384

Closed timgdavies closed 1 year ago

timgdavies commented 8 years ago

This issue is under consideration for an extension in OCDS 1.1

It builds on discussions in #277

The issue

We have encountered a range of situations where publishers or data users may wish to provide/access multiple currency values. These include where:

Creating an extension for value to provide optional properties for altAmount, altCurrency, exchangeRate, and exchangeRateDate.

"value": {
   "amount": 6563700,
   "currency":"MXN",
   "altAmount":429000,
   "altCurrency":"USD",
   "exchangeRate":0.065,
   "exchangeRateDate":"2015-11-04T00:00:00-05:00"
}

Engagement

Please indicate support or opposition for this proposal using the +1 / -1 buttons or a comment. If opposing the proposal, please give clear justifications, and where possible, make an alternative proposals.

davidmegginson commented 8 years ago

(deleted previous comment — posting too early in the day)

I think this makes sense, and we can look into something similar for IATI if the need arises.

patxiworks commented 7 years ago

The instability of exchange rates in some countries may increase the relevance of this. In Nigeria, we've been experiencing a constant fluctuation for the past year or so. Capturing the exchange rate adopted for a contract at the time of award could provide better (and historical) context – and prevent potential fraud through fiscal leakages.

I propose that this be included as a community extension.

timgdavies commented 7 years ago

Thanks @patxiworks - we will try and get this developed shortly.

timgdavies commented 7 years ago

I believe @juanpane has suggested a reworking of the model so that we collect exchange rate properties in their own object, such as below:

"value": {
   "amount": 6563700,
   "currency":"MXN",
   "exchangeRate": {
       "currency":"USD",
       "rate":0.065,
       "date":"2015-11-04T00:00:00-05:00"
   }
}

In this version I've dropped the suggestion of altAmount as this does not fit well under 'exchangeRate'.

I still prefer the flat modelling, as I think it copes better with the case where 'Two currencies are reported for a given contract' but without specifying the exchange rate.

Thoughts welcome.

siemvaessen commented 7 years ago

This has been adressed on IATI discuss as well. I am wondering what type of conversion rate needs to be used, market on non-market based.

timgdavies commented 7 years ago

I've been reviewing the valuable IATI discussion (and examples of real data) and thinking through two main use-cases:

(1) Asserting the exchange rate that was agreed at the time of a contract/aid project being signed off;

(2) Explaining any changes that an application has made in order to normalise currency values in it's dataset;

This leads me towards the following modelling:

"value": {
   "amount": 6563700,
   "currency":"MXN",
   "exchangeRates": [
       {
          "currency":"USD",
           "rate":0.065,
           "date":"2015-11-04T00:00:00-05:00",
           "source":"contract"
       }
   ]
}

where this adds:

This appears to cover most of the cases we might encounter with (1).

What it does not do is given the value in different currencies, which is what we see in the examples of real data in https://discuss.iatistandard.org/t/currency-conversion/413/11

We would then need guidance for an application on whether, if converting data to a common currency (e.g. converting data which is coming in using MXN, EUR and GBP into only USD for display in a front-end interface), it should:

(a) would go against the definition of amount as "the value in the currency in which the contract was signed", so my leaning is towards making (b) the guidance we give.

markbrough commented 7 years ago

I think this looks pretty good @timgdavies, I reckon the examples of real data from the IATI thread should be covered by this pretty well as I imagine the exact value amount will almost always be calculable through the exchange rate. Does it matter if it is very slightly off (through rounding errors)? Perhaps it does, so adding an additional amount field might also be helpful.

Is the plan also to be able to provide this at implementation/transactions? The rate agreed at the time of the contract will still change depending on market fluctuations and perhaps according to non-public sources, so would probably make sense to include it there as well?

timgdavies commented 7 years ago

Is the plan also to be able to provide this at implementation/transactions? The rate agreed at the time of the contract will still change depending on market fluctuations and perhaps according to non-public sources, so would probably make sense to include it there as well?

@markbrough Yes - this would be done as an extension to the value object, so would be available anywhere a financial value is given.

antonioherrera commented 6 years ago

Hello everyone!

We'll be using this extension and I'm wondering if you have already developed it. We are looking forward to see the complete extension (with the final descriptions and codelists).

timgdavies commented 6 years ago

This is not yet worked up into formal extension - but we can prioritise over the next two weeks.

timgdavies commented 6 years ago

The first draft of this extension is now staged at https://github.com/open-contracting/ocds_exchangeRate_extension

There is some more work to do testing and finalising this - but feedback on the docs and schema is welcome.

Tim0th1 commented 6 years ago

Looking at the issue, I think there are four questions that are relevant but not easy to combine to form for the extension:

  1. What determines the transaction time? (we need to know if it is an event trigger or an agreed time-stamp)
  2. What is the transaction time? (time-stamp)
  3. Is the exchange rate predetermined?(contractually agreed, or contingent on the transaction time, above)
  4. What is the exchange rate? (rate)

The area where I have questions is in the codelist for the source 'exchangeRateSource'.

We offer three open codelist options: contract, market and application.

I am not sure how much they add value (yet) - if we have the currency, rate and time-stamp an investigator can check how far the transaction diverges from average exchange rates at the time. Is that actually enough information?

jpmckinney commented 4 years ago

There has not been further engagement on this issue for two years.

I am not confident in the model, in particular the use of amount_ALT fields (like amount_USD) to describe values in other currencies. The obvious alternative is to separate amount and currency into two fields (e.g. an array of Value objects). The consequence of encoding the currency in the field name is that a user who wants to get all amounts in all currencies (without knowledge of which currencies might exist beforehand) needs to loop over all fields starting with amount_ and in effect reconstruct an array of Value objects – which is unnecessary work.

Happy to re-open to address any outstanding issues pending new demand.

duncandewhurst commented 2 years ago

This issue came up again in relation to modelling a bidder's turnover, which can be provided in multiple currencies (see CRM-7727 for details):

image

The obvious alternative is to separate amount and currency into two fields (e.g. an array of Value objects).

Do you envisage a sibling to existing .value fields, e.g. contracts.altValues, or a property of the Value object, e.g. contracts.value.altValues?

jpmckinney commented 2 years ago

In general, this seems to be a rare need, and not one that is clearly the responsibility of OCDS.

In CRM-7727, exchange rates come up in the context of selection criteria (yearly turnover). Presumably, local suppliers would evaluate themselves against the local currency. The buyer, I suppose, includes USD conversions because it is the world's reserve currency, so that foreign suppliers can more easily evaluate themselves.

I think the partner's solution to describe the requirement as "yearly turnover in CUR1" and "yearly turnover in CUR2" is fine.

In this issue and #277, there seems to be more interest from IATI than from OCDS stakeholders.

Currency conversion requires methodological decisions (which date is used for the conversion, do you take the market rate or include some fee, etc.), but at any rate exchange rates are easy to look up over APIs. It's not clear that these need to be stored in OCDS. They are facts external to the contracting process.

jpmckinney commented 1 year ago

Closing per previous comment.

The drafted extension was https://github.com/open-contracting/ocds_exchangeRate_extension