Skip to content

Configuration reference

Every option Currencyinfo accepts, matching config.default.jsonc and the strict schema in src/global/config/schema.ts.

The file

AspectDetail
FormatJSONC — JSON with // and /* */ comments and trailing commas
Locationconfig.jsonc in the process working directory
Templateconfig.default.jsonc, committed to the repository
Permissions600, owned by the runtime user. It holds every credential
Gitconfig.jsonc and config.test.jsonc are git-ignored

Resolution order:

  1. config.test.jsonc, only under NODE_ENV=development or Jest
  2. config.jsonc
  3. config.default.jsonc, only under NODE_ENV=development or Jest

A production start with no config.jsonc is an error, not a fallback to the template.

How validation behaves

The file is parsed and validated before the HTTP port is opened. Any failure prints a formatted report and exits non-zero.

  • the schema is strict: an unknown key is an error. A typo cannot silently disable a source
  • an enabled source that cannot work — missing key, empty coin list, an impossible quote asset — fails at startup rather than on every request
  • the shipped credential placeholders are recognised and treated as no credential at all, so enabling a source without replacing one fails loudly. Placeholders from earlier templates and from Currencyinfo v1 are recognised too
  • coin symbols are uppercased. mappings keys are uppercased as well, so a key differing only in case is not a silent no-op

Core options

OptionTypeDefaultDescription
namestring"Currencyinfo"Instance name, prefixed to every notification
decimalsinteger 0–10012Decimal places every stored and served rate is rounded to
strategyenumHow the winning group resolves to one rate. Required
rateDifferencePercentThresholdnumber 0–20025Maximum percentage distance between two quotes in the same group
groupPercentagenumber 0–200Minimum percentage distance between the two heaviest groups. Required
minSourcespositive integer1Upper bound on the sources required per pair
prioritiesstring arraySource resolution order for strategy: "priority". Required
refreshIntervalpositive number10Minutes between refresh cycles
rateLifetimepositive numberMinutes a quote stays usable. Required
base_coinsstring array, non-emptyCurrencies every rate is expressed in. Required
mappingsobject{}Symbol rewrites applied everywhere
log_levelenum"log"none, error, warn, log, info

strategy

ValueResult
avgArithmetic mean of the winning group's prices
minLowest price in the group
maxHighest price in the group
priorityPrice from the source highest in priorities
weightPrice from the source with the highest weight

rateDifferencePercentThreshold and groupPercentage

Both are percentages measured against the mean of the two compared values, so both cap at 200.

  • rateDifferencePercentThreshold set to 200 disables rate-distance splitting entirely: every quote lands in one group
  • groupPercentage behaves the opposite way. 200 can never be exceeded, so every pair that splits into more than one group is rejected

The mechanics are worked through in rate calculation.

minSources

An upper bound, not a guarantee. The effective threshold per pair is min(minSources, number of enabled sources advertising that pair), so a pair offered by a single provider is still served from that one quote. Startup logs every pair whose coverage is below the configured value.

priorities

An ordered list of connector names, highest priority first. Names must match exactly:

CurrencyApi   ExchangeRateApi   ExchangeRateHost   MOEX   Coinmarketcap
CryptoCompare   Coingecko   CoinPaprika   CoinLore   Binance

A source not in the list ranks below every listed source. The shipped default omits CryptoCompare, which is disabled by default; add it back when running with a subscription.

base_coins

jsonc
{
  "base_coins": ["USD", "RUB", "EUR", "CNY", "JPY", "BTC", "ETH"]
}

Connectors quote against USD, and every other base coin is triangulated from those quotes. A base coin no source quotes produces no cross-rates and is named in a startup warning.

mappings

jsonc
{
  "mappings": {
    "CWIF": "$CWIF"
  }
}

Rewrites a symbol into its canonical form in incoming quotes, in base_coins, and in the coverage map. Do not use it to alias a stablecoin to USD — see symbol mappings.


server

jsonc
{
  "server": {
    "port": 36661,
    "mongodb": {
      "host": "mongodb",
      "port": 27017,
      "db": "tickersdb"
    }
  }
}
OptionTypeDefaultDescription
server.portinteger 0–6553536661HTTP listen port
server.mongodb.hoststring"127.0.0.1"Hostname. mongodb in the shipped Compose file, 127.0.0.1 for a local install
server.mongodb.portinteger 1–6553527017MongoDB port
server.mongodb.dbstring"tickersdb"Database name

Connection is attempted once with a 2 second server-selection timeout and no retry, so a wrong host fails fast.


notify

All fields are optional; omit the object entirely to disable every channel. Alerts still go to the log.

jsonc
{
  "notify": {
    "slack": ["https://hooks.slack.com/services/T00000000/B00000000/REPLACE-WITH-YOUR-WEBHOOK-TOKEN"],
    "discord": ["https://discord.com/api/webhooks/000000000000000000/EXAMPLE-ONLY-not-a-real-token"],
    "adamantPassphrase": "example example example example example example example example example example example example",
    "adamant": ["U0000000000000000000"]
  }
}
OptionTypeValidation
notify.slackstring arrayhttps://hooks.slack.com/services/T…/B…/…
notify.discordstring arrayhttps://discord.com/api/webhooks/<id>/<token>, discordapp.com also accepted
notify.adamantstring arrayU followed by 6 to 21 digits
notify.adamantPassphrasestringRequired when notify.adamant is non-empty

Every value on this page is synthetic. See notifications for how to obtain real ones.


Rate sources

Each source is an optional object. Common fields:

FieldTypeMeaning
enabledbooleanWhether the source is used
weightnon-negative numberVoting power when choosing the dominant group. Defaults to 10; 0 means a quote with no vote

enabled is not a plain default

For the authenticated sources — exchange_rate_host, coinmarketcap, coingecko, cryptocompare — an omitted enabled on a configured source is treated as enabled, and the source then requires its API key. Set it explicitly.

For currency_api, exchange_rate_api, and moex the schema is stricter still: when the block is present at all, both enabled and url are required. Delete the whole block to drop the source rather than emptying it.

Beyond enabled, a source is only actually active when it has something to fetch: a non-empty coin or code list, and a real API key where one is required.

Per-provider quotas, terms, and behaviour are documented in the source reference. The schema shapes follow.

coinpaprika

Keyless. Enabled by default.

jsonc
{
  "coinpaprika": {
    "enabled": true,
    "coins": ["BTC", "ETH", "ADM"],
    "ids": ["btc-bitcoin", "eth-ethereum", "adm-adamant-messenger"],
    "bulk_limit": 200,
    "max_individual_requests": 5
  }
}
FieldTypeDefaultDescription
coinsstring arrayTicker symbols. Ambiguous on CoinPaprika; prefer ids
idsstring arrayCoinPaprika coin IDs, the preferred form
bulk_limitinteger 1–2000200Rows requested in the single ranked bulk call
max_individual_requestsinteger 0–1005Cap on per-coin calls for coins outside the bulk range

At least one of coins or ids is required when enabled. Details

coinlore

Keyless. Enabled by default.

jsonc
{
  "coinlore": {
    "enabled": true,
    "coins": ["BTC", "ETH", "ADM"],
    "ids": { "BTC": 90, "ETH": 80, "ADM": 33250 }
  }
}
FieldTypeDescription
coinsstring arraySymbols, resolved at startup from the asset directory when not in ids
idsobject of symbol to positive integerCoinLore numeric IDs, the preferred form

At least one of coins or ids is required when enabled. Details

binance

Keyless. Enabled by default.

jsonc
{
  "binance": {
    "enabled": true,
    "quote_asset": "USDT",
    "coins": ["BTC", "ETH", "BNB", "XRP", "SOL", "DOGE", "ADA", "TRX", "LTC", "DASH"]
  }
}
FieldTypeDefaultDescription
quote_assetstring"USDT"Asset the markets are quoted against, restricted to USD-pegged assets
coinsstring arrayBase symbols. Required when enabled, and must not contain quote_asset

Accepted quote_asset values: USD, USDT, USDC, FDUSD, USD1, USDS, TUSD, USDP, PYUSD, RLUSD, DAI, BUSD. Details

exchange_rate_api

Keyless fiat. Enabled by default.

jsonc
{
  "exchange_rate_api": {
    "enabled": true,
    "url": "https://open.er-api.com/v6/latest/USD",
    "codes": ["USD", "RUB", "EUR", "CNY", "JPY"]
  }
}
FieldTypeDescription
urlHTTP(S) URLEndpoint. The base currency is part of the path and must stay USD
codesstring arrayFiat codes to request. Required when enabled

Fiat only. Crypto codes belong to the crypto sources. Details

currency_api

Keyless fiat. Enabled by default.

jsonc
{
  "currency_api": {
    "enabled": true,
    "url": "https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies/usd.json",
    "codes": ["USD", "EUR", "RUB", "CNY", "JPY"]
  }
}
FieldTypeDescription
urlHTTP(S) URLEndpoint returning USD-based rates
codesstring arrayCodes to request. Required when enabled

Details

coingecko

Needs a free Demo key. Disabled by default.

jsonc
{
  "coingecko": {
    "enabled": false,
    "api_key": "Demo API key for CoinGecko",
    "coins": ["BTC", "ETH", "ADM"],
    "ids": ["bitcoin", "ethereum", "adamant-messenger"]
  }
}
FieldTypeDescription
api_keystringFree Demo plan key, sent as x-cg-demo-api-key. Required when enabled
coinsstring arraySymbols. Ambiguous on CoinGecko; prefer ids
idsstring arrayCoinGecko coin IDs, the preferred form

Details

coinmarketcap

Needs an API key. Disabled by default.

jsonc
{
  "coinmarketcap": {
    "enabled": false,
    "api_key": "API key for CoinMarketCap",
    "coins": ["BTC", "ETH", "ADM"],
    "ids": { "BTC": 1, "ETH": 1027, "ADM": 3703 }
  }
}
FieldTypeDescription
api_keystringSent as X-CMC_PRO_API_KEY. Required when enabled
coinsstring arraySymbols. Deprecated in favour of ids
idsobject of symbol to positive integerCoinMarketCap UCIDs, the preferred form

Details

exchange_rate_host

Needs an API key. Disabled by default.

jsonc
{
  "exchange_rate_host": {
    "enabled": false,
    "api_key": "API key for ExchangeRate",
    "codes": ["USD", "EUR", "RUB", "CNY", "JPY", "BTC"]
  }
}
FieldTypeDescription
api_keystringSent as the access_key query parameter. Required when enabled
codesstring arrayCodes to request. Required when enabled

Details

moex

Keyless. Disabled by default.

jsonc
{
  "moex": {
    "enabled": false,
    "url": "https://rusdoor.adamant.im/securities.jsonp",
    "codes": {
      "USD/RUB": "USDRUB_TOM",
      "EUR/RUB": "EURRUB_TOM",
      "CNY/RUB": "CNYRUB_TOM"
    }
  }
}
FieldTypeDescription
urlHTTP(S) URLEndpoint or proxy. Required
codesobject of pair to market codePairs to read. Required when enabled

Details

cryptocompare

Subscription only. Deprecated and disabled by default.

jsonc
{
  "cryptocompare": {
    "enabled": false,
    "api_key": "API key for CoinDesk Data (CryptoCompare)",
    "coins": ["USD", "EUR", "RUB", "BTC", "ETH", "ADM"]
  }
}
FieldTypeDescription
api_keystringCoinDesk Data key. Required when enabled; the free tier was retired on 21 May 2026
coinsstring arraySymbols. Required when enabled

Details


Cross-field rules

Rules the schema enforces beyond individual field types:

RuleMessage
notify.adamant non-empty implies a passphraseProvide passphrase to use ADAMANT notifier
An enabled authenticated source needs its keyProvide an API key when … is enabled
CryptoCompare needs a CoinDesk Data keyProvide a CoinDesk Data (former CryptoCompare) API key when CryptoCompare is enabled. The free tier was retired on 21 May 2026
CoinGecko needs a Demo keyProvide a free CoinGecko Demo API key when CoinGecko is enabled
An enabled source needs something to fetchProvide at least one coin or ID when … is enabled
binance.quote_asset must track the dollar'quote_asset' must be a USD-pegged asset: …
binance.coins must not contain binance.quote_assetRemove '…' from the Binance coins: it is the configured quote asset and has no market against itself

Placeholder credentials

These exact strings are recognised as placeholders and treated as absent, compared case-insensitively after trimming:

PlaceholderOrigin
API key for ExchangeRateCurrent template
API key for CoinMarketCapCurrent template
API key for CoinDesk Data (CryptoCompare)Current template
Demo API key for CoinGeckoCurrent template
apple banana...Current template, notify.adamantPassphrase
API key for CryptoCompareSuperseded template spelling
Put yours CoinMarketCap API keyCurrencyinfo v1
Put yours CryptoCompare API keyCurrencyinfo v1
No need for CoinGecko API keyCurrencyinfo v1

An empty or whitespace-only value is also treated as absent, which is what Currencyinfo v1 used to mean "no key".


Migrating a v1 configuration

bash
pnpm run migrate ./config.json

The script writes config.jsonc beside the source file and never overwrites an existing one. It never leaves a source enabled that cannot work:

  • CryptoCompare stays enabled only when the legacy ccApiKey is present, and the script reminds you to add CryptoCompare back to priorities
  • CoinMarketCap stays enabled only when the legacy cmcApiKey is present
  • CoinGecko is always disabled, because a v1 configuration carries no Demo key

Read every warning it prints: each one names a follow-up step.

Released under the GPL-3.0 License. Maintained by the ADAMANT developer community.