prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  USD Value for IOTA is incorrect
  ## Problem Definition
  
  The usd value reported on my exchange is inconsistent with the usd value that rotkehlchen shows.
  
  I tried to find where the USD value is calculated for exchange assets and I found the following API call: [rotkehlchen.inquirer#L68](https://github.com/kascheri12/rotkehlchen/blob/master/rotkehlchen/inquirer.py#L68) 
  
  The asset "IOTA" uses symbol "IOT" at the api endpoint therefore the incorrect rate is returned when querying: 
  https://min-api.cryptocompare.com/data/price?fsym=IOTA&tsyms=USD
  vs.
  https://min-api.cryptocompare.com/data/price?fsym=IOT&tsyms=USD
  USD Value for IOTA is incorrect
  ## Problem Definition
  
  The usd value reported on my exchange is inconsistent with the usd value that rotkehlchen shows.
  
  I tried to find where the USD value is calculated for exchange assets and I found the following API call: [rotkehlchen.inquirer#L68](https://github.com/kascheri12/rotkehlchen/blob/master/rotkehlchen/inquirer.py#L68) 
  
  The asset "IOTA" uses symbol "IOT" at the api endpoint therefore the incorrect rate is returned when querying: 
  https://min-api.cryptocompare.com/data/price?fsym=IOTA&tsyms=USD
  vs.
  https://min-api.cryptocompare.com/data/price?fsym=IOT&tsyms=USD
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `rotkehlchen/constants.py`
  Content:
  ```
  1 from typing import cast
  2 from rotkehlchen import typing
  3 
  4 ETH_DAO_FORK_TS = 1469020840  # 2016-07-20 13:20:40 UTC
  5 BTC_BCH_FORK_TS = 1501593374  # 2017-08-01 13:16:14 UTC
  6 
  7 SUPPORTED_EXCHANGES = ['kraken', 'poloniex', 'bittrex', 'bitmex', 'binance']
  8 ROTKEHLCHEN_SERVER_TIMEOUT = 5
  9 ALL_REMOTES_TIMEOUT = 20
  10 
  11 YEAR_IN_SECONDS = 31536000  # 60 * 60 * 24 * 365
  12 
  13 S_EMPTYSTR = typing.EmptyStr('')
  14 
  15 S_BTC = cast(typing.NonEthTokenBlockchainAsset, 'BTC')
  16 S_ETH = cast(typing.NonEthTokenBlockchainAsset, 'ETH')
  17 S_DATACOIN = cast(typing.NonEthTokenBlockchainAsset, 'DATAcoin')
  18 
  19 S_RDN = cast(typing.EthToken, 'RDN')
  20 
  21 
  22 S_USD = typing.FiatAsset('USD')
  23 S_EUR = typing.FiatAsset('EUR')
  24 S_GBP = typing.FiatAsset('GBP')
  25 S_JPY = typing.FiatAsset('JPY')
  26 S_CNY = typing.FiatAsset('CNY')
  27 FIAT_CURRENCIES = (S_USD, S_EUR, S_GBP, S_JPY, S_CNY)
  28 
  29 EV_BUY = typing.EventType('buy')
  30 EV_SELL = typing.EventType('sell')
  31 EV_TX_GAS_COST = typing.EventType('tx_gas_cost')
  32 EV_ASSET_MOVE = typing.EventType('asset_movement')
  33 EV_LOAN_SETTLE = typing.EventType('loan_settlement')
  34 EV_INTEREST_PAYMENT = typing.EventType('interest_rate_payment')
  35 EV_MARGIN_CLOSE = typing.EventType('margin_position_close')
  36
  ```
  
  Path: `rotkehlchen/inquirer.py`
  Content:
  ```
  1 from __future__ import unicode_literals
  2 
  3 import logging
  4 from typing import Dict, Iterable, Optional, cast
  5 
  6 import requests
  7 
  8 from rotkehlchen import typing
  9 from rotkehlchen.constants import FIAT_CURRENCIES, S_DATACOIN, S_RDN, S_USD
  10 from rotkehlchen.errors import RemoteError
  11 from rotkehlchen.fval import FVal
  12 from rotkehlchen.utils import query_fiat_pair, retry_calls, rlk_jsonloads
  13 
  14 logger = logging.getLogger(__name__)
  15 
  16 
  17 def get_fiat_usd_exchange_rates(
  18         currencies: Optional[Iterable[typing.FiatAsset]] = None,
  19 ) -> Dict[typing.FiatAsset, FVal]:
  20     rates = {S_USD: FVal(1)}
  21     if not currencies:
  22         currencies = FIAT_CURRENCIES[1:]
  23     for currency in currencies:
  24         rates[currency] = query_fiat_pair(S_USD, currency)
  25 
  26     return rates
  27 
  28 
  29 def world_to_cryptocompare(asset):
  30     # Adjust some ETH tokens to how cryptocompare knows them
  31     if asset == S_RDN:
  32         # remove this if cryptocompare changes the symbol
  33         asset = cast(typing.EthToken, 'RDN*')
  34     elif asset == S_DATACOIN:
  35         asset = cast(typing.NonEthTokenBlockchainAsset, 'DATA')
  36 
  37     return asset
  38 
  39 
  40 class Inquirer(object):
  41     def __init__(self, kraken=None):  # TODO: Add type after fixing cyclic dependency
  42         self.kraken = kraken
  43         self.session = requests.session()
  44 
  45     def query_kraken_for_price(
  46             self,
  47             asset: typing.Asset,
  48             asset_btc_price: FVal,
  49     ) -> FVal:
  50         if asset == 'BTC':
  51             return self.kraken.usdprice['BTC']
  52         return asset_btc_price * self.kraken.usdprice['BTC']
  53 
  54     def find_usd_price(
  55             self,
  56             asset: typing.Asset,
  57             asset_btc_price: Optional[FVal] = None,
  58     ) -> FVal:
  59         if self.kraken and self.kraken.first_connection_made and asset_btc_price is not None:
  60             return self.query_kraken_for_price(asset, asset_btc_price)
  61 
  62         asset = world_to_cryptocompare(asset)
  63         resp = retry_calls(
  64             5,
  65             'find_usd_price',
  66             'requests.get',
  67             requests.get,
  68             u'https://min-api.cryptocompare.com/data/price?'
  69             'fsym={}&tsyms=USD'.format(asset)
  70         )
  71 
  72         if resp.status_code != 200:
  73             raise RemoteError('Cant reach cryptocompare to get USD value of {}'.format(asset))
  74 
  75         resp = rlk_jsonloads(resp.text)
  76 
  77         # If there is an error in the response skip this token
  78         if 'USD' not in resp:
  79             if resp['Response'] == 'Error':
  80                 print('Could not query USD price for {}. Error: "{}"'.format(
  81                     asset,
  82                     resp['Message']),
  83                 )
  84             else:
  85                 print('Could not query USD price for {}'.format(asset))
  86             return FVal(0)
  87 
  88         return FVal(resp['USD'])
  89
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/rotkehlchen/constants.py b/rotkehlchen/constants.py
  --- a/rotkehlchen/constants.py
  +++ b/rotkehlchen/constants.py
  @@ -15,6 +15,7 @@
   S_BTC = cast(typing.NonEthTokenBlockchainAsset, 'BTC')
   S_ETH = cast(typing.NonEthTokenBlockchainAsset, 'ETH')
   S_DATACOIN = cast(typing.NonEthTokenBlockchainAsset, 'DATAcoin')
  +S_IOTA = cast(typing.NonEthTokenBlockchainAsset, 'IOTA')
   
   S_RDN = cast(typing.EthToken, 'RDN')
   
  diff --git a/rotkehlchen/inquirer.py b/rotkehlchen/inquirer.py
  --- a/rotkehlchen/inquirer.py
  +++ b/rotkehlchen/inquirer.py
  @@ -6,7 +6,7 @@
   import requests
   
   from rotkehlchen import typing
  -from rotkehlchen.constants import FIAT_CURRENCIES, S_DATACOIN, S_RDN, S_USD
  +from rotkehlchen.constants import FIAT_CURRENCIES, S_DATACOIN, S_RDN, S_USD, S_IOTA
   from rotkehlchen.errors import RemoteError
   from rotkehlchen.fval import FVal
   from rotkehlchen.utils import query_fiat_pair, retry_calls, rlk_jsonloads
  @@ -33,6 +33,8 @@
           asset = cast(typing.EthToken, 'RDN*')
       elif asset == S_DATACOIN:
           asset = cast(typing.NonEthTokenBlockchainAsset, 'DATA')
  +    elif asset == S_IOTA:
  +        asset = cast(typing.NonEthTokenBlockchainAsset, 'IOT')
   
       return asset
  
verification_info: {"golden_diff": "diff --git a/rotkehlchen/constants.py b/rotkehlchen/constants.py\n--- a/rotkehlchen/constants.py\n+++ b/rotkehlchen/constants.py\n@@ -15,6 +15,7 @@\n S_BTC = cast(typing.NonEthTokenBlockchainAsset, 'BTC')\n S_ETH = cast(typing.NonEthTokenBlockchainAsset, 'ETH')\n S_DATACOIN = cast(typing.NonEthTokenBlockchainAsset, 'DATAcoin')\n+S_IOTA = cast(typing.NonEthTokenBlockchainAsset, 'IOTA')\n \n S_RDN = cast(typing.EthToken, 'RDN')\n \ndiff --git a/rotkehlchen/inquirer.py b/rotkehlchen/inquirer.py\n--- a/rotkehlchen/inquirer.py\n+++ b/rotkehlchen/inquirer.py\n@@ -6,7 +6,7 @@\n import requests\n \n from rotkehlchen import typing\n-from rotkehlchen.constants import FIAT_CURRENCIES, S_DATACOIN, S_RDN, S_USD\n+from rotkehlchen.constants import FIAT_CURRENCIES, S_DATACOIN, S_RDN, S_USD, S_IOTA\n from rotkehlchen.errors import RemoteError\n from rotkehlchen.fval import FVal\n from rotkehlchen.utils import query_fiat_pair, retry_calls, rlk_jsonloads\n@@ -33,6 +33,8 @@\n         asset = cast(typing.EthToken, 'RDN*')\n     elif asset == S_DATACOIN:\n         asset = cast(typing.NonEthTokenBlockchainAsset, 'DATA')\n+    elif asset == S_IOTA:\n+        asset = cast(typing.NonEthTokenBlockchainAsset, 'IOT')\n \n     return asset\n", "issue": "USD Value for IOTA is incorrect\n## Problem Definition\r\n\r\nThe usd value reported on my exchange is inconsistent with the usd value that rotkehlchen shows.\r\n\r\nI tried to find where the USD value is calculated for exchange assets and I found the following API call: [rotkehlchen.inquirer#L68](https://github.com/kascheri12/rotkehlchen/blob/master/rotkehlchen/inquirer.py#L68) \r\n\r\nThe asset \"IOTA\" uses symbol \"IOT\" at the api endpoint therefore the incorrect rate is returned when querying: \r\nhttps://min-api.cryptocompare.com/data/price?fsym=IOTA&tsyms=USD\r\nvs.\r\nhttps://min-api.cryptocompare.com/data/price?fsym=IOT&tsyms=USD\nUSD Value for IOTA is incorrect\n## Problem Definition\r\n\r\nThe usd value reported on my exchange is inconsistent with the usd value that rotkehlchen shows.\r\n\r\nI tried to find where the USD value is calculated for exchange assets and I found the following API call: [rotkehlchen.inquirer#L68](https://github.com/kascheri12/rotkehlchen/blob/master/rotkehlchen/inquirer.py#L68) \r\n\r\nThe asset \"IOTA\" uses symbol \"IOT\" at the api endpoint therefore the incorrect rate is returned when querying: \r\nhttps://min-api.cryptocompare.com/data/price?fsym=IOTA&tsyms=USD\r\nvs.\r\nhttps://min-api.cryptocompare.com/data/price?fsym=IOT&tsyms=USD\n", "before_files": [{"content": "from typing import cast\nfrom rotkehlchen import typing\n\nETH_DAO_FORK_TS = 1469020840  # 2016-07-20 13:20:40 UTC\nBTC_BCH_FORK_TS = 1501593374  # 2017-08-01 13:16:14 UTC\n\nSUPPORTED_EXCHANGES = ['kraken', 'poloniex', 'bittrex', 'bitmex', 'binance']\nROTKEHLCHEN_SERVER_TIMEOUT = 5\nALL_REMOTES_TIMEOUT = 20\n\nYEAR_IN_SECONDS = 31536000  # 60 * 60 * 24 * 365\n\nS_EMPTYSTR = typing.EmptyStr('')\n\nS_BTC = cast(typing.NonEthTokenBlockchainAsset, 'BTC')\nS_ETH = cast(typing.NonEthTokenBlockchainAsset, 'ETH')\nS_DATACOIN = cast(typing.NonEthTokenBlockchainAsset, 'DATAcoin')\n\nS_RDN = cast(typing.EthToken, 'RDN')\n\n\nS_USD = typing.FiatAsset('USD')\nS_EUR = typing.FiatAsset('EUR')\nS_GBP = typing.FiatAsset('GBP')\nS_JPY = typing.FiatAsset('JPY')\nS_CNY = typing.FiatAsset('CNY')\nFIAT_CURRENCIES = (S_USD, S_EUR, S_GBP, S_JPY, S_CNY)\n\nEV_BUY = typing.EventType('buy')\nEV_SELL = typing.EventType('sell')\nEV_TX_GAS_COST = typing.EventType('tx_gas_cost')\nEV_ASSET_MOVE = typing.EventType('asset_movement')\nEV_LOAN_SETTLE = typing.EventType('loan_settlement')\nEV_INTEREST_PAYMENT = typing.EventType('interest_rate_payment')\nEV_MARGIN_CLOSE = typing.EventType('margin_position_close')\n", "path": "rotkehlchen/constants.py"}, {"content": "from __future__ import unicode_literals\n\nimport logging\nfrom typing import Dict, Iterable, Optional, cast\n\nimport requests\n\nfrom rotkehlchen import typing\nfrom rotkehlchen.constants import FIAT_CURRENCIES, S_DATACOIN, S_RDN, S_USD\nfrom rotkehlchen.errors import RemoteError\nfrom rotkehlchen.fval import FVal\nfrom rotkehlchen.utils import query_fiat_pair, retry_calls, rlk_jsonloads\n\nlogger = logging.getLogger(__name__)\n\n\ndef get_fiat_usd_exchange_rates(\n        currencies: Optional[Iterable[typing.FiatAsset]] = None,\n) -> Dict[typing.FiatAsset, FVal]:\n    rates = {S_USD: FVal(1)}\n    if not currencies:\n        currencies = FIAT_CURRENCIES[1:]\n    for currency in currencies:\n        rates[currency] = query_fiat_pair(S_USD, currency)\n\n    return rates\n\n\ndef world_to_cryptocompare(asset):\n    # Adjust some ETH tokens to how cryptocompare knows them\n    if asset == S_RDN:\n        # remove this if cryptocompare changes the symbol\n        asset = cast(typing.EthToken, 'RDN*')\n    elif asset == S_DATACOIN:\n        asset = cast(typing.NonEthTokenBlockchainAsset, 'DATA')\n\n    return asset\n\n\nclass Inquirer(object):\n    def __init__(self, kraken=None):  # TODO: Add type after fixing cyclic dependency\n        self.kraken = kraken\n        self.session = requests.session()\n\n    def query_kraken_for_price(\n            self,\n            asset: typing.Asset,\n            asset_btc_price: FVal,\n    ) -> FVal:\n        if asset == 'BTC':\n            return self.kraken.usdprice['BTC']\n        return asset_btc_price * self.kraken.usdprice['BTC']\n\n    def find_usd_price(\n            self,\n            asset: typing.Asset,\n            asset_btc_price: Optional[FVal] = None,\n    ) -> FVal:\n        if self.kraken and self.kraken.first_connection_made and asset_btc_price is not None:\n            return self.query_kraken_for_price(asset, asset_btc_price)\n\n        asset = world_to_cryptocompare(asset)\n        resp = retry_calls(\n            5,\n            'find_usd_price',\n            'requests.get',\n            requests.get,\n            u'https://min-api.cryptocompare.com/data/price?'\n            'fsym={}&tsyms=USD'.format(asset)\n        )\n\n        if resp.status_code != 200:\n            raise RemoteError('Cant reach cryptocompare to get USD value of {}'.format(asset))\n\n        resp = rlk_jsonloads(resp.text)\n\n        # If there is an error in the response skip this token\n        if 'USD' not in resp:\n            if resp['Response'] == 'Error':\n                print('Could not query USD price for {}. Error: \"{}\"'.format(\n                    asset,\n                    resp['Message']),\n                )\n            else:\n                print('Could not query USD price for {}'.format(asset))\n            return FVal(0)\n\n        return FVal(resp['USD'])\n", "path": "rotkehlchen/inquirer.py"}], "after_files": [{"content": "from typing import cast\nfrom rotkehlchen import typing\n\nETH_DAO_FORK_TS = 1469020840  # 2016-07-20 13:20:40 UTC\nBTC_BCH_FORK_TS = 1501593374  # 2017-08-01 13:16:14 UTC\n\nSUPPORTED_EXCHANGES = ['kraken', 'poloniex', 'bittrex', 'bitmex', 'binance']\nROTKEHLCHEN_SERVER_TIMEOUT = 5\nALL_REMOTES_TIMEOUT = 20\n\nYEAR_IN_SECONDS = 31536000  # 60 * 60 * 24 * 365\n\nS_EMPTYSTR = typing.EmptyStr('')\n\nS_BTC = cast(typing.NonEthTokenBlockchainAsset, 'BTC')\nS_ETH = cast(typing.NonEthTokenBlockchainAsset, 'ETH')\nS_DATACOIN = cast(typing.NonEthTokenBlockchainAsset, 'DATAcoin')\nS_IOTA = cast(typing.NonEthTokenBlockchainAsset, 'IOTA')\n\nS_RDN = cast(typing.EthToken, 'RDN')\n\n\nS_USD = typing.FiatAsset('USD')\nS_EUR = typing.FiatAsset('EUR')\nS_GBP = typing.FiatAsset('GBP')\nS_JPY = typing.FiatAsset('JPY')\nS_CNY = typing.FiatAsset('CNY')\nFIAT_CURRENCIES = (S_USD, S_EUR, S_GBP, S_JPY, S_CNY)\n\nEV_BUY = typing.EventType('buy')\nEV_SELL = typing.EventType('sell')\nEV_TX_GAS_COST = typing.EventType('tx_gas_cost')\nEV_ASSET_MOVE = typing.EventType('asset_movement')\nEV_LOAN_SETTLE = typing.EventType('loan_settlement')\nEV_INTEREST_PAYMENT = typing.EventType('interest_rate_payment')\nEV_MARGIN_CLOSE = typing.EventType('margin_position_close')\n", "path": "rotkehlchen/constants.py"}, {"content": "from __future__ import unicode_literals\n\nimport logging\nfrom typing import Dict, Iterable, Optional, cast\n\nimport requests\n\nfrom rotkehlchen import typing\nfrom rotkehlchen.constants import FIAT_CURRENCIES, S_DATACOIN, S_RDN, S_USD, S_IOTA\nfrom rotkehlchen.errors import RemoteError\nfrom rotkehlchen.fval import FVal\nfrom rotkehlchen.utils import query_fiat_pair, retry_calls, rlk_jsonloads\n\nlogger = logging.getLogger(__name__)\n\n\ndef get_fiat_usd_exchange_rates(\n        currencies: Optional[Iterable[typing.FiatAsset]] = None,\n) -> Dict[typing.FiatAsset, FVal]:\n    rates = {S_USD: FVal(1)}\n    if not currencies:\n        currencies = FIAT_CURRENCIES[1:]\n    for currency in currencies:\n        rates[currency] = query_fiat_pair(S_USD, currency)\n\n    return rates\n\n\ndef world_to_cryptocompare(asset):\n    # Adjust some ETH tokens to how cryptocompare knows them\n    if asset == S_RDN:\n        # remove this if cryptocompare changes the symbol\n        asset = cast(typing.EthToken, 'RDN*')\n    elif asset == S_DATACOIN:\n        asset = cast(typing.NonEthTokenBlockchainAsset, 'DATA')\n    elif asset == S_IOTA:\n        asset = cast(typing.NonEthTokenBlockchainAsset, 'IOT')\n\n    return asset\n\n\nclass Inquirer(object):\n    def __init__(self, kraken=None):  # TODO: Add type after fixing cyclic dependency\n        self.kraken = kraken\n        self.session = requests.session()\n\n    def query_kraken_for_price(\n            self,\n            asset: typing.Asset,\n            asset_btc_price: FVal,\n    ) -> FVal:\n        if asset == 'BTC':\n            return self.kraken.usdprice['BTC']\n        return asset_btc_price * self.kraken.usdprice['BTC']\n\n    def find_usd_price(\n            self,\n            asset: typing.Asset,\n            asset_btc_price: Optional[FVal] = None,\n    ) -> FVal:\n        if self.kraken and self.kraken.first_connection_made and asset_btc_price is not None:\n            return self.query_kraken_for_price(asset, asset_btc_price)\n\n        asset = world_to_cryptocompare(asset)\n        resp = retry_calls(\n            5,\n            'find_usd_price',\n            'requests.get',\n            requests.get,\n            u'https://min-api.cryptocompare.com/data/price?'\n            'fsym={}&tsyms=USD'.format(asset)\n        )\n\n        if resp.status_code != 200:\n            raise RemoteError('Cant reach cryptocompare to get USD value of {}'.format(asset))\n\n        resp = rlk_jsonloads(resp.text)\n\n        # If there is an error in the response skip this token\n        if 'USD' not in resp:\n            if resp['Response'] == 'Error':\n                print('Could not query USD price for {}. Error: \"{}\"'.format(\n                    asset,\n                    resp['Message']),\n                )\n            else:\n                print('Could not query USD price for {}'.format(asset))\n            return FVal(0)\n\n        return FVal(resp['USD'])\n", "path": "rotkehlchen/inquirer.py"}]}