{"action":"created","issue":{"url":"https://api.github.com/repos/hsoft/moneyguru/issues/455","repository_url":"https://api.github.com/repos/hsoft/moneyguru","labels_url":"https://api.github.com/repos/hsoft/moneyguru/issues/455/labels{/name}","comments_url":"https://api.github.com/repos/hsoft/moneyguru/issues/455/comments","events_url":"https://api.github.com/repos/hsoft/moneyguru/issues/455/events","html_url":"https://github.com/hsoft/moneyguru/issues/455","id":140401466,"number":455,"title":"Decouple currency rates DB from CAD","user":{"login":"hsoft","id":505201,"avatar_url":"https://avatars.githubusercontent.com/u/505201?v=3","gravatar_id":"","url":"https://api.github.com/users/hsoft","html_url":"https://github.com/hsoft","followers_url":"https://api.github.com/users/hsoft/followers","following_url":"https://api.github.com/users/hsoft/following{/other_user}","gists_url":"https://api.github.com/users/hsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/hsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsoft/subscriptions","organizations_url":"https://api.github.com/users/hsoft/orgs","repos_url":"https://api.github.com/users/hsoft/repos","events_url":"https://api.github.com/users/hsoft/events{/privacy}","received_events_url":"https://api.github.com/users/hsoft/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hsoft/moneyguru/labels/feature","name":"feature","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-03-12T17:30:07Z","updated_at":"2016-08-08T00:34:31Z","closed_at":null,"body":"As seen in #454, having a currency rates DB work only with CAD as a base currency doesn't work well in some cases because rates aren't always transitive: `BTC -> CAD -> USD != BTC -> USD`.\r\n\r\nThe DB should be changed to store `date/currency1/currency2/rate` tuples instead of `date/currency/rate_in_CAD` ones.\r\n\r\nThis will have a significant impact of how currency rates resolution work, however. Right now, it's easy for moneyGuru to know how to get a `EUR/USD` rate: it gets `EUR/CAD` and then `USD/CAD` and it's good to go. Without CAD as a base currency, optimisations to minimize the number of currency rate fetches are not going to work any more, or they'll work differently.\r\n\r\nSo as a first step, I would simply change the DB schema and add the *option* to have direct rates stored in the DB. But everything else would still be based on CAD. Then, we'll see where to go from there."},"comment":{"url":"https://api.github.com/repos/hsoft/moneyguru/issues/comments/238119351","html_url":"https://github.com/hsoft/moneyguru/issues/455#issuecomment-238119351","issue_url":"https://api.github.com/repos/hsoft/moneyguru/issues/455","id":238119351,"user":{"login":"pfalcon","id":500451,"avatar_url":"https://avatars.githubusercontent.com/u/500451?v=3","gravatar_id":"","url":"https://api.github.com/users/pfalcon","html_url":"https://github.com/pfalcon","followers_url":"https://api.github.com/users/pfalcon/followers","following_url":"https://api.github.com/users/pfalcon/following{/other_user}","gists_url":"https://api.github.com/users/pfalcon/gists{/gist_id}","starred_url":"https://api.github.com/users/pfalcon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfalcon/subscriptions","organizations_url":"https://api.github.com/users/pfalcon/orgs","repos_url":"https://api.github.com/users/pfalcon/repos","events_url":"https://api.github.com/users/pfalcon/events{/privacy}","received_events_url":"https://api.github.com/users/pfalcon/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T00:34:31Z","updated_at":"2016-08-08T00:34:31Z","body":"+1. Actually, in my design (*) I have date/currency1/currency2/rate/source_id. Source ID is ID of a currency rate provider. A special ID is for \"accounting rate\" (which is used for actual calculations), this gets initialized from a particular provider or even by a more complicated algorithm (e.g. average). So, if you found out that a particular provider lied to you all this time, you can switch to another and have all xacts recalculated. You can also compare how much each of providers lies by graphing their rates.\r\n\r\n(*) Which I'm unable to develop further, so looking around for someone else to have done more and not worse than me.\r\n"}}
{"actor":{"display_login":"pfalcon"}}