Open taoeffect opened 2 weeks ago
Also, as a stop-gap measure, not to close this issue but to temporarily address it, we can simply disable changing the currency type.
This can be done in one of three ways:
- Remove the option to change the currency from the UI
- Leave it there but disable the popup and write some text next to the popup that says
Feature coming soon
- Allow changing it but display an alert to the user when they try to change it that says
Feature coming soon
My preference would be for one of the latter two options. It's probably OK to even link to this issue, e.g. "Feature coming soon"
Options 1 & 2 are best UX imho, so looks like we agree on 2. Let's go with that one:
Leave it there but disable the popup and write some text next to the popup that says Feature coming soon
Problem
In a group with 3 users and a mincome of $1000 USD/month, I performed the following steps:
One: I changed the currency to BTC:
This resulted in an immediate change from $1000 USD/month to 1000 BTC/month:
This is already a bug for 2 reasons:
Two: I then tried changing the mincome amount from 1000 BTC to 0.01728549 BTC ($1000 USD equivalent at $57852/BTC exchange rate)
This resulted in the following proposal:
Three: I changed the currency back to USD
Now things in the group have gotten really crazy:
It's completely nonsensical at this point.
Solution
gi.currency
and a new selectorgi.currency/exchangeRate
for this purpose. Identify at least 2 different free public websites / APIs that you can query to get the currency exchange rate info. Query both of them at the same time and use the value of the one that returns fastest (but discard it if the value is nonsensical or an error and use the other one in that case).Also, as a stop-gap measure, not to close this issue but to temporarily address it, we can simply disable changing the currency type.
This can be done in one of three ways:
Feature coming soon
Feature coming soon
My preference would be for one of the latter two options. It's probably OK to even link to this issue, e.g. "Feature coming soon"
Note on exchange rate APIs
If you cannot find a free public API that doesn't require signup to use, then feel free to scrape public websites instead.
Here is Claude's response to:
Response:
group.js
contract details regarding exchange ratesPlease note the existing comments in
group.js
related to the payment period's exchange rate:Note also that in the future we should be able to support sending payments from 1 currency type to a different type.
For example, the group's currency can be USD, but the payment that someone sends could be in BTC (to someone who supports receiving BTC). The exchange rate info at the time of payment should be stored along with that payment, and the payment data already has partial support for this when creating a payment:
(From
RecordPayment.vue
)(From
group.js
)Remember that for the distribution algorithm all the numbers that are compared need to be in the same currency (the group's currency currency type).
Note: this issue is an expanded version of #784.