Automatic Exchange Rates is a way to automatically fetch new exchange rates from the available providers. It is available on: Sidebar > Management > Automation > Automatic Exchange Rates.
You'll need to configure one or more providers for this to work.
Providers
When creating a new provider you'll have some options:
- Service Name: For displaying only, pick a descriptive name
- Service Type: Pick from one of our built-in providers. You can open an issue or a PR to add your own providers
- Active: If the provider should be ran, deactivated providers won't be ran
- One exchange rate per day: If true, each fetch updates that day's Exchange Rate instead of adding a new one
- Exchange rates to keep: The most Exchange Rates kept per currency pair, the oldest are deleted first. Leave empty to keep them all. Investments use past rates for their history, so keep this empty or high if you track investments
- API Key: Optional, only required if the selected provider requires an API Key
- Options: Settings specific to the provider. Only shown for providers that use it, see the provider's section below
- Interval Type: How intervals should be interpreted
- Interval: The interval to fetch new Exchange Rates (based on Interval Type)
- Target Currencies and Target Accounts: Pick which currencies and/or accounts this provider will fetch Exchange Rates for
Interval Type and Interval
Note
The minimum amount of time between fetches is 1 hour, currently it is not possible to lower this.
Note
All hours defined below are ran in UTC, unless you explicitly define a custom timezone using the TZ environment variable in your .env file
Currently there are 3 options for Interval Types:
OnWill only fetch exchange rates on the specified hours in interval. Interval can be:
- a single number representing an hour in 24hour format (e.g. 2 represents Everyday at 2 A.M., 14 represents Everyday at 2 P.M.)
- a range with a start hour and an end hour, both in the 24hour format, separated by a hyphen (e.g. 2-5 will fetch Everyday at 2, 3, 4, and 5 A.M.)
- A list of hours, in 24hour format, separated by comma (e.g. 2,3,4,5 will fetch Everyday at 2, 3, 4, and 5 A.M.)
-
Every X hoursWill fetch exchange rates every X hours defined by interval. Interval needs to be a positive integer between 1 and 24 hours (e.g. 2 will fetch every 2 hours) -
Not onFetch every hour, except for the specified hours, great if your currency market is closed by a number of hours everyday. Interval can be:
- a single number representing an hour in 24hour format (e.g. 2 represents NOT at 2 A.M., 14 represents NOT at 2 P.M.)
- a range with a start hour and an end hour, both in the 24hour format, separated by a hyphen (e.g. 2-5 will NOT fetch at 2, 3, 4, and 5 A.M.)
- A list of hours, in 24hour format, separated by comma (e.g. 2,3,4,5 will NOT fetch at 2, 3, 4, and 5 A.M.)
Targets
Both currencies and accounts can be configured to have an Exchange Currency. When selecting a target, the selected Exchange Currency will be used to fetch exchange rates. For example: if an account has a currency of BRL and an exchange currency of USD, BRL x USD will be the pairing searched for.
When configuring your currency pay close attention to the Code field, this will be used on the various providers to fetch exchange rates. For example, CoinGecko doesn't accept BTC as a valid crypto code, you need to set bitcoin as the currency code for it to work, meanwhile USD is an accepted currency for Dollar, so to get an BTCxUSD exchange rate you need to have a Bitcoin currency with bitcoin as the code exchanging against Dollar currency with USD as the code.
Providers
SynthFinance
SynthFinance has been shutdown and is no longer available.
Existing instances will be converted to Frankfurter, while existing SynthFinanceStock instances will be removed as there is no API Key-less alternative available.
CoinGecko Free/Pro
Provides near real-time crypto exchange rates
- Requires API Key: Yes
- Website: https://www.coingecko.com/en/developers/dashboard
Frankfurter
Provides daily currency exchange rates updated everyday at 4 p.m. CET
- Requires API Key: No
- Website: https://frankfurter.dev
TwelveData
Provides currency exchange rates.
- Requires API Key: Yes
- Website: https://twelvedata.com/
TwelveData Markets
Provides stocks/other financial assets prices. Some assets require a paid plan.
- Requires API Key: Yes
- Website: https://twelvedata.com/
When configuring the code for your currency, you have 4 options:
figi:<your_code>will use a FIGI code (this requires a paid plan!). E.g.figi:BBG000N9MNX3cusip:<your_code>will use a CUSIP code. E.g.cusip:097023105isin:<your_code>will use a ISIN code. E.g.isin:US02079K1079<your_code>will use a normal ticker. E.g.AAPL
Check https://api.twelvedata.com/stocks?apikey=demo for available stocks and codes, there are other asset catalogs available on the documentation for TwelveDocs.
Note
This uses a minimum of two requests per market per fetch. TwelveData's free plan provides 800 requests/day, plan accordingly.
Yahoo Finance
Provides prices for stocks and other assets listed on Yahoo Finance.
- Requires API Key: No
- Website: https://finance.yahoo.com
Set the currency's code to the asset's Yahoo Finance symbol, exactly as Yahoo shows it. For example, AAPL for Apple or PETR4.SA for Petrobras on B3. The exchange currency has to be the one the asset is quoted in on Yahoo, because the price is used as is.
Each fetch takes the latest hourly price from the last 5 days, so it still finds a price over weekends and holidays.
FXMacroData
Provides daily central bank reference rates.
- Requires API Key: Yes
- Website: https://fxmacrodata.com
It makes one request per currency pair on each fetch. On days without a published rate, the most recent one is used.
AllRatesToday Central Banks
Provides the latest exchange rate table published by a central bank. It's a good fit when your currency isn't one Frankfurter covers.
- Requires API Key: No
- Website: https://allratestoday.com
Put the central bank's code in Options, for example bcb for Brazil or rbi for India. Leave it empty to use the European Central Bank. Each service reads one central bank, so add a service per bank if you need more than one.
When the table has no middle rate for a pair, the average of its buy and sell rates is used. When a pair isn't in the table, it's calculated through a currency that is. Pairs it can't work out are skipped.
Transitive (Calculated from Existing Rates)
Calculates rates from the Exchange Rates you already have instead of fetching them. For example, with USD to EUR and EUR to BRL rates, it works out USD to BRL.
- Requires API Key: No
Use it for pairs no provider offers directly.