Clone
4
Automatic Exchange Rates
Herculino Trotta edited this page 2025-11-25 23:27:51 -03:00

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
  • Single exchange rate: If true, this provider will create one Exchange Rate and update it continuously, otherwise, a new Exchange Rate will be created each time (great for avoiding database clutter)
  • API Key: Optional, only required if the selected provider requires an API Key
  • 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:

  1. On Will 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.)
  1. Every X hours Will 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)

  2. Not on Fetch 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

Frankfurter

Provides daily currency exchange rates updated everyday at 4 p.m. CET

TwelveData

Provides currency exchange rates.

TwelveData Markets

Provides stocks/other financial assets prices. Some assets require a paid plan.

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:BBG000N9MNX3
  • cusip:<your_code> will use a CUSIP code. E.g. cusip:097023105
  • isin:<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.