MDA.CONFIG(5)

NAME
mda.config - mda configuration file

SYNOPSIS
/etc/mda.config

DESCRIPTION
Usually the configuration file is installed in the /etc directory, but could be installed elsewhere (see the --config conffile command line option). The file format is similar to other Unix configuration files - comments begin with a # character and extend to the end of the line; blank lines are ignored. Initial whitespaces are ignored but are present in the supplied default configuration file for readability reasons.

Configuration commands consist of an initial keyword followed by an argument, separated by whitespace(s). Commands may not be continued over multiple lines. An empty keyword (i.e one that have no value) defines a section and are case insensitive while keywords with a value defines a setting and are case sensitive.

If the first character in a value is '$' then the value will be fetched from a environment variable with a name of the contents of value.

  Sections

MILLISTREAM
    This section configures the Millistream Data Feed (libmdf) connection with the Millistream distribution node.

    username username
        Username to authenticate with the Millistream distribution node.

    password password
        Password to authenticate with the Millistream distribution node.

    server host:port...
        Millistream distribution node to connect to. host can be a host name, a fully qualified domain name, a IPv4 address or a IPv6 address. If host is a IPv6 address then it has to be enclosed in square brackets such as: [2001:db8::1428:57ab]. If multiple host:port are defined (comma separated list), then mda will try each in order when connecting.

    +server host:port...
        Additional Millistream distribution nodes to connect to. Works like server but allows you to enter multiple nodes to connect to simultaneously. Only to be used in very special setups. Any requestXXXX set to 0 before this in the file will disable that data for this particular node.

    reconnectinterval seconds
        The number of seconds to wait between reconnect attempts, default 0.

    instrumenthashsize items
        mda maintains an internal hash table for the 'orderbooks' table in memory. The currently used number of items in this hash table can be seen by the instrument-hash-size value from the --status option to mda where the output is "current/maximum" and with this setting the "maximum" part can be set, default 100000.

    queuehashsize items
        mda maintains a hash table per queue in order to quickly lookup the location of a insref in the queue. The currently used number of items can be seen by the qX-queue value from the --status option to mda since most items on the queue occupies one item in the hash, default 100000.

    The requestXXXX settings tell mda which messages to request and subscribe to from the Millistream distribution node, if mda can request the message(s) or not is controlled by the entitlements on the account used to log on. Also there have to be a definition for the message in question in the tabledef file or mda will not perform the request regardless of the settings. The default value for all these are 1, i.e to perform the request. So the main use of these settings are to disable data for various tables if you so desire.

    requestrades [0 | 1]
        Subscribe to and populate the trades table.

    requestorderbooks [0 | 1]
        Subscribe to and populate the orderbooks table.

    requestquotes [0 | 1]
        Subscribe to and populate the quotes table with Last-Sale info.

    requestquotesbbo [0 | 1]
        Subscribe to and populate the quotes table with BBO info.

    requestquotesex [0 | 1]
        Subscribe to and populate the quotesex table with Extra Session info.

    requestpricehistory [0 | 1]
        Subscribe to and populate the pricehistory and adjustedpricehistory tables. For the prices in the adjustedpricehistory table to be adjusted you must also enable requestcorporateactions.

    requestnews [0 | 1]
        Subscribe to and populate the news, newscoding and newstags tables.

    requestbasicdata [0 | 1]
        Subscribe to and populate the instruments table.

    requestcorporateactions [0 | 1]
        Subscribe to and populate the corporateactions table.

    requestfundamentals [0 | 1]
        Subscribe to and populate the fundamentals table.

    requesttradestate [0 | 1]
        Subscribe to and populate the tradestate column in the instruments table.

    requestperformance [0 | 1]
        Subscribe to and populate the performance table.

    requestkeyratios [0 | 1]
        Subscribe to and populate the keyratios table.

    requestestimates [0 | 1]
        Subscribe to and populate the estimates and estimateshistory tables.

    requestnoii [0 | 1]
        Subscribe to and populate the noii (Net Order Imbalance Indicator) table.

    requestl10n [0 | 1]
        Subscribe to and populate the l10n (Localization) table.

    requestci [0 | 1]
        Subscribe to and populate the ci and cihistory (Corporate Information) tables.

    requestpriip [0 | 1]
        Subscribe to and populate the priip (European PRIIPs Template EPT) table.

    requestmifid [0 | 1]
        Subscribe to and populate the mifid (European MiFID Template EMT) and mifidhistory tables.

    requesteet [0 | 1]
        Subscribe to and populate the eet (European ESG Template EET) table.

    requestmappings [0 | 1]
        Subscribe to and populate the sectors table.

    requestmbo [0 | 1]
        Subscribe to and populate the mbo table.

    requestgreeks [0 | 1]
        Subscribe to and populate the greeks table.

    insrefs insref1,insref2,insref3,...
        A comma separated list of the insrefs to subscribe to, if set to * or if commented out, mda will subscribe to all available insrefs.

DATABASE

    instance plugin
        Specify the name and path of the SQL plugin to use, currently there exists plugins for PostgreSQL, MySQL/MariaDB, ODBC and Blackhole (a plugin that does nothing, used internally for benchmarking). By default the plugins are installed to /usr/lib/mda/. Note that the MySQL/MariaDB plugin can read options from the mda group in the my.cnf file.

    updateinterval minimum-queue-time
        Specifies the minimum time between two updates for the same instrument to the same table for Queue #1 (Queues #2 and #3 are hardcoded to 0) in number of seconds.

    connectionstring connectionstring
        For PostgreSQL the format and supported key words can be found at https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING For ODBC you can look at https://www.connectionstrings.com/ where there are numerous examples for various SQL servers. The MySQL/MariaDB plugin parses the string according to the format rules specified at https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms722656(v=vs.85) and supports the following keywords: host, server, port, dbname, database, data source, datasource, user, uid, user id, user name, username, password, pwd, sslkey, sslcert, sslrootcert, sslcapath, sslcipher, sslcrl, sslcrlpath, connect_timeout, connection timeout, write_timeout and write timeout. They are used to set the correspondingly named options from https://dev.mysql.com/doc/refman/8.0/en/mysql-options.html as well as being used as the arguments to the mysql_real_connect() call where port will be used as unix_socket if it starts with a / character.

    keepdeleted  [0 | 1]
        If set to 1 mda will set the tradestate column in the instruments table to 9 when it receives a Instrument Delete message in the feed instead of deleting it from the database, default 1.

    checkdatabase  [0 | 1]
        If set to 1 mda will perform the same check as if executed with the --check option upon start and if the check fails for whatever reason mda will immediately terminate, default 1.

    localtime  [0 | 1]
        If set to 1 then timestamps are converted from UTC to the local time zone of the machine where mda runs. Do note that the timestamps in tables pricehistory, adjustedpricehistory and corporateactions are never converted since the time column there are strictly to enforce order of events and are not to be used as the time of the closing prices, default 0.

    deletelimit limit
        Upon start and if requestbasicdata is enabled, mda will delete instruments that have been deleted during the time mda where disconnected. Only insrefs with a value < limit will be deleted so with this setting you can protect internal/private insrefs from being deleted, also setting limit to 0 effectively disables this functionality. As a protection mda will not perform the delete if the number of insrefs to delete exceeds maxdeletes. Default 18446744073709551615.

    maxdeletes limit
        If the number of instruments marked to be deleted due to the functionality described for deletelimit exceeds this value the delete won't happen. Default 10000.

    transactions maxstatements
        Maximum number of SQL statements to use per transaction. If maxstatements is < 2 then transactions are disabled, default 1.

    truncatetime [0 | 1 | 2]
        How to handle timestamps with subsecond resolution. If 0 allow full "HH:MM:SS:mmmuu", if 1 truncate to "HH:MM:SS" and if 2 truncate to "HH:MM:SS:mmm". Default 0.

    aggtrades  [0 | 1]
        If set to 1 then trades are also aggregated to one row per minute into the aggtrades table for easier charting, default 0.

    disableupsert  [0 | 1| Y]
        If set to 1 or Y then MDA will for 'insertfirst="yes"' tables try an INSERT first and then perform an UPDATE if the INSERT fails instead of doing upsert statements (only on supported sql servers, if upsert is enabled then MDA will log that on start). Default 0.

APPLICATION

    tabledefinitions tabledef
        Specify the name and path of the tabledef file to use, default /etc/mda.tabledef.

    pidfile pidfile
        Specify the name and path of the file used to record the mda process ID. Main use is for users of the SysV Init scripts since neither Upstart nor systemd needs this.

    user user
        Specify a Unix account user to switch to.

    group group
        Specify a Unix account group to switch to.

    switch_user_early [0 | 1]
        Older versions of the MDA switched to the user/group above after connecting to the sql server. If the old behaviour is still needed then you can set this variable to 0. Default 1.

LOG

    logsqlpath logpath
        If set mda will log all executed SQL statements to files at logpath/sqYYMMDD.log, default is to disable logging.

    facility [LOG_AUTH | LOG_AUTHPRIV | LOG_CRON | LOG_DAEMON | LOG_FTP | LOG_KERN | LOG_LOCAL0 | LOG_LOCAL1 | LOG_LOCAL2 | LOG_LOCAL3 | LOG_LOCAL4 | LOG_LOCAL5 | LOG_LOCAL6 | LOG_LOCAL7 | LOG_LPR | LOG_MAIL | LOG_NEWS | LOG_SYSLOG | LOG_USER | LOG_UUCP]
        Defines the syslog facility to log as, default is to disable syslog (i.e no facility).

    debug [0 | 1]
        If set to 1 then debug logging is enabled (mostly orderbook related errors), default is 0.

FILES

/etc/mda.config
    default name of the configuration file

/etc/mda.tabledef
    default name of the tabledef file

/usr/share/doc/mda/
    SQL scripts to create the database are stored in this directory

/usr/lib/mda/
    Plugins to support various SQL servers

AUTHOR

Millistream Market Data AB (https://millistream.com)

SEE ALSO
mda(8),