rssnyder / discord-stock-ticker

Add live stock & crypto prices to your discord sidebar.
https://rssnyder.github.io/discord-stock-ticker/
MIT License
294 stars 113 forks source link

[BUG] #88

Closed matheusturmina closed 3 years ago

matheusturmina commented 3 years ago

Describe the bug When i change the "currency" of an cryptobot, the bot dont get the variation of an crypto on the same currency. It keeps getting the usd variation.

To Reproduce Steps to reproduce the behavior:

  1. add a bot in brl currency
  2. look at status, the variation in % match with usd variation

Expected behaviour The bot should get the brl variation

rssnyder commented 3 years ago

The math is a little off based on duckduckgo's conversion rate compared to yahoo finance, but everything seems to add up to me.

USD: image image

BRL: image image

image image

As the conversion rate is the same for the current price and the price difference, the percent change across currencies is the same, it shouldn't be different for non-USD currencies.

My test case: USD:

{
  "name": "cardano",
  "crypto": true,
  "set_color": true,
  "decorator": " ",
  "set_nickname": true,
  "frequency": 3,
  "discord_bot_token": "xxxxxxxxxxxxxxxxxx"
}

BRL:

{
  "name": "cardano",
  "crypto": true,
  "set_color": true,
  "decorator": " ",
  "currency": "BRL",
  "set_nickname": true,
  "frequency": 3,
  "discord_bot_token": "xxxxxxxxxxxxxxxxxx"
}
rssnyder commented 3 years ago

stale