# Change or Add Currency

## Change or Add Currency

The dashboard comes preconfigured to support 17 different currencies for fiat value conversions.

| USD | EUR | JPY |
| --- | --- | --- |
| GBP | AUD | CAD |
| CHF | CNY | HKD |
| NZD | ILS | KRW |
| MXN | RUB | SGD |
| TWD | INR |     |

It is easy to change to one of the supported currencies through the Grafana UI using the instructions below. If you want to add an unsupported currency, instructions are included for that afterward.

## Change Currency

Follow these steps to change the selected currency to another supported currency.

Click on the gear icon in the upper-right corner of the Grafana dashboard.

<figure><img src="https://971382438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZON6xeJcH6NDhbzjDAWf%2Fuploads%2FfORATU5sXrKqNWE1rTq6%2Fgrafana-dashboard-settings.png?alt=media&#x26;token=8e13e59e-3813-4ce5-8810-b99eb43d95db" alt=""><figcaption></figcaption></figure>

Click on the Variables link on the left-hand side of the screen.

<figure><img src="https://971382438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZON6xeJcH6NDhbzjDAWf%2Fuploads%2FIaqBD0xyXuBjWk3PBral%2Fgrafana-variables-menu.png?alt=media&#x26;token=850b25ac-fcaa-45c6-9986-d98706bc7eb9" alt=""><figcaption></figcaption></figure>

Click on the `currency` variable name.

<figure><img src="https://971382438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZON6xeJcH6NDhbzjDAWf%2Fuploads%2F9nq4diKpuyLFqUvRAJAG%2Fgrafana-variables.png?alt=media&#x26;token=4b66e450-fca6-41a5-9718-f849859d1670" alt=""><figcaption><p>The currency variable in the variables list</p></figcaption></figure>

Change the variable value to one of the 17 supported currencies listed in the Description field.

<figure><img src="https://971382438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZON6xeJcH6NDhbzjDAWf%2Fuploads%2FwwWQe432nVSkLYvGa9h4%2Fgrafana-currency-variable.png?alt=media&#x26;token=25a537d0-362d-4f1f-bcef-dffc75560b11" alt=""><figcaption><p>Updating the currency value to GBP</p></figcaption></figure>

Click the Apply button to save the change.

<figure><img src="https://971382438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZON6xeJcH6NDhbzjDAWf%2Fuploads%2FlHe2UJE0ysZvqRyAUGAF%2Fgrafana-apply.png?alt=media&#x26;token=6b64e635-f1cf-4a5e-a308-fbab9b644711" alt=""><figcaption><p>Click the Apply button to apply the new currency value</p></figcaption></figure>

Click on the Save Dashboard button in the upper-right corner of the screen.

<figure><img src="https://971382438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZON6xeJcH6NDhbzjDAWf%2Fuploads%2FHlEPjjEpRajAgXvWdsE0%2Fgrafana-save-dashboard-button.png?alt=media&#x26;token=468c4241-657b-45ea-90c4-717fd21c0156" alt=""><figcaption><p>Click the Save Dashboard button to open the save panel</p></figcaption></figure>

The Save Dashboard panel will open. Enter a note and then click on the Save button.

<figure><img src="https://971382438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZON6xeJcH6NDhbzjDAWf%2Fuploads%2FPEoQpKQypFdUNWePjkB8%2Fgrafana-save-dashboard.png?alt=media&#x26;token=01fbd324-8090-4b7c-ad6f-c25359db5b88" alt=""><figcaption><p>Enter a note and click the Save button</p></figcaption></figure>

## Add New Currency

Additional languages may be added manually by modifying two configuration files and then following the above instructions to change the currency variable.

Currencies must be supported by the [Coingecko API](https://www.coingecko.com/en/api/documentation).

#### /etc/json\_exporter/json\_exporter.yml

First, edit the `json_exporter` configuration file to add support for parsing the new currency values

```bash
sudo nano /etc/json_exporter/json_exporter.yml
```

Find the `coingecko_eth_price` section and look for the list of currencies under the `values` line. That section should look similar to the following.

```
  coingecko_eth_price:
    metrics:
    - name: eth
      type: object
      path: '{.ethereum}'
      help: Ether (ETH) price in fiat
      values:
        USD: '{.usd}'
        EUR: '{.eur}'
        JPY: '{.jpy}'
        GBP: '{.gbp}'
        AUD: '{.aud}'
        CAD: '{.cad}'
        CHF: '{.chf}'
        CNY: '{.cny}'
        HKD: '{.hkd}'
        NZD: '{.nzd}'
        ILS: '{.ils}'
        KRW: '{.krw}'
        MXN: '{.mxn}'
        RUB: '{.rub}'
        SGD: '{.sgd}'
        TWD: '{.twd}'
        INR: '{.inr}'
```

Add a new currency line following the model of the other currency lines, with the three-character currency code first in all caps and then in lowercase.

For example, if we want to add support for Swedish krona, we would add the following line to the `values` section of the `coingecko_eth_price` module. There should be eight spaces before the currency code.

```yaml
         SEK: '{.sek}'
```

#### /etc/prometheus/files\_sd/other/currencies.yml

Second, edit the `currencies.yml` configuration file to add support for the new currency to the CoinGeck query.

```bash
sudo nano /etc/prometheus/files_sd/stakelocal/other/coingecko.yml
```

In the `targets` line, add the three-character currency code to the comma-delimited list of currencies to be queried. All three-character currency codes must be contained within the single set of quotes.

For example, to continue adding support for Swedish Krona, we would add `,sek` to the end of the `targets` line list of currencies. The final result may look like the following.

```
    - targets: ['usd,eur,jpy,gbp,aud,cad,chf,cny,hkd,nzd,ils,krw,mxn,rub,sgd,twd,inr,sek']
```

After modifying these two files, restart json\_exporter only. The changes to the Prometheus configuration will be picked up automatically.

```bash
sudo systemctl restart json_exporter
```

After completing the setup, set your new currency code as the `currency` variable value using the [instructions at the top of this page](#change-currency).
