FIX API Specification – Market Data

Workflow 

 

Messages Structure 

The Feed server is using a slightly modified FIX 4.4. specification(see Market Data Incremental Refresh). 

Header

Tag Field Name RequiredCommentsExample
8 BeginStringYIdentifies the beginning of the message and represents the Transmission
Protocol version.
Supported Value:
FIX4.4
8=FIX4.4
9BodyLengthYMessage length (number of bytes) forward to the CheckSum tag.9=502
35MsgType YDefines message type e.g. Logon(A)35=A
49SenderCompIDYAssigned value used to identify sender of a message49=COMPANY_NAME
56 TargetCompIDYAssigned value used to identify receiving firm
Supported Values:
XTRD-MD-1
56=XTR-MD-1
34MsgSeqNumYInteger message sequence number34=1000123
52SendingTimeYTime of message transmission (always expressed in UTC (Universal Time
Coordinated, also known as "GMT")
52=2018-08-02T03:30:30.658

Footer

TagField NameRequiredCommentsExample
10 CheckSumYThree bytes, simple checksum10=250

Messages 

Logon

MsgType: A

Direction: IN/OUT

Description: Logon should be sent as a very first message to establish FIX session and pass authentication process. In the case of successful authentication, server will respond with corresponding Logon message. 

TagField Name Required Comments Example
98EncryptMethod YSupported Values:

  • 0 - None

89=0
108HeartBtIntY108=5
141ResetSeqNumFlagNIndicates both sides of a FIX session should reset sequence numbers141=Y
553UsernameYSession Username

Required for Outgoing message
553=account_1
554PasswordYSession Password

Required for Outgoing message
554=StR0nG_P

Logout

MsgType: 5

Direction: IN/OUT

Description: Logout message is used as a confirmation 

TagField NameRequiredCommentsExample
58TextNDisconnection reason in human-readable format

Please note, that this field might be absent
58=Incorrect Username or Password

SecurityListRequest

MsgType: x

Direction: OUT

Description: this message is used to receive a list of all tradable instruments on a particular exchange. 

TagFieldNameRequiredCommentsExample
320SecurityReqIDYUnique request ID320=REQ_1
559SecurityListRequestTypeYType of request being performed by a counterparty.
Supported values:
  • 4 - All Securities
    559=0
    207SecurityExchangeYExchange name to extract a list of all instruments207=HUOBI

    SecurityList

    MsgType: y

    Direction: IN

    Description: this message is used to return a list of Securities that matched criteria, specified in SecurityListRequest. Taking into account, that such lists could be big enough, all instruments will be streamed one by one(one instrument per SecurityList message). 

    Combination of TotNoRelatedSym(393) and LastFragment(893) tags can be used to identify the end of a transmission. 

    TagFieldNameRequiredCommentsExample
    320SecurityReqIDYID from the initiating SecurityListRequest320=REQ_1
    322SecurityResponseIDY
    560SecurityRequestRe
    sult
    YSupported Values:

    • 0 - Valid request

    • 1 - Invalid or unsupported request

    • 2 - No instruments found those match selection criteria

    • 3 - Not authorized to retrieve instruments data
    560=0
    393TotNoRelatedSymNThis field contains information about a number of instruments that matched initial
    search criteria.
    393=51
    893LastFragmentNBoolean field that indicates is given message is last in particular transmission or not893=false
    58TextCOptional field that will held human-readable information about the error(if occurred) 58=Exchange ABC not found
    146NoRelatedSymCIn case of successful request - always 1146=1
    55SymbolC55=ETH
    /BTC
    207SecurityExchangeC207=HUO
    BI
    5001Price PrecisionCInteger value that represents a number of decimal points in prices for given Symbol/Exchange5001=8
    5002Size PrecisionCInteger value that represents a number of deciman points in size for given Symbol/Exchange5002=4

    MarketDataRequest

    MsgType: V

    Direction: OUT

    Description: given command used to initiate subscription on real-time market data for symbol(s) on the particular exchange(s). In case of a successful request, the server will respond with a book’s snapshot followed by incremental updates for this book. 

    Server provides flexibility to choose between a quantity of information being transmitted by configuring MarketDepth. Caller might choose to receive a full book(sometimes a way big) by specifying setting zero to tag 264 or use a custom quantity such as 5(5 BIDSs and 5 ASKs). 

    MDEntryTypes should always contain two types – BID(0) and OFFER(1). 

    Caller might subscribe on several instruments from several exchanges using single MarketDataRequest message.

    Please note, that subscription request will be processed using “all or nothing” principles. This means that for complex requests that contain at least one error in subscription, the whole message will be rejected. 

    TagField NameRequiredCommentsExample
    262MDReqIDYUnique ID262=1001_1
    263SubscriptionRequestTypeYSupported Values:

    • 1 - Snapshot plus Updates

    • 2 - disable previous Snapshot plus Updates request

    263=1
    264MarketDepthYThe field used to specify the number of bids/asks to receive.
    Supported Values:

    • 0 - Full book

    264=0
    265MDUpdateTypeYSupported values:

    • 1 - Incremental updates

      265=1
      267NoMDEntryTypesYYou can choose one or several values
      269MDEntryTypeYSupported Values:

      • 0 - BID

      • 1 - OFFER

      • 2 - TRADE

        269=0
        146NoRelatedSymYIt is possible to subscribe to several symbols using a single MarketDataRequest
        message
        55SymbolYSymbol name55=ETH
        /BTC
        207SecurityExchangeYName of the exchange to receive market data207=HUOBI

        MarketDataRequestReject

        MsgType: Y

        Direction: IN

        Description: in case of logically incorrect MarketDataRequest message, subscription for the particular symbol will be rejected and server will provide additional information about the cause. 

        If initial MarketDataRequest messages contained several instruments that caused errors, then the server will respond with the only one MarketDataRequestReject messages under the same MDReqID and contains a description of the first error. 

        TagField NameRequiredCommentsExample
        262MDReqID YUnique MDReqID provided in MarketDataRequest message that has been failed.262=100_112
        281MDReqRejReasonY

        • 0 - Unknown symbol

        • 1 - Duplicated MDReqID

        • 3 - Insufficient Permissions

        • E - Unknown SecurityExchange

        281=0
        58TextYError description in a human-readable format58=ABC/TEST

        MarketDataSnapshotFullRefresh

        MsgType: W

        Direction: IN

        Description: this message contains book snapshot for the particular instrument. A number of levels could be controlled by MarketDepth parameter submitted as part of MarketDataRequest message. 

        TagField NameRequiredCommentsExample
        262MDReqIDYMDReqID associated with the previous request262=100_1
        55SymbolYSymbol name 55=ETH/BTC
        207SecurityExchangeYExchange name207=HUOBI
        83RptSeqYSequence number of events 83=2685
        268NoMDEntriesY
        269MDEntryTypeYSupported Values:

        • 0 - BID

        • 1 - OFFER

          270MDEntryPxYPrice270=0.035089
          271MDEntrySizeYEntry size271=3.014
          272MDEntryDateYDate when the given entry has been added or modified last time
          ISO 8601 format is used, UTC timezone
          272=20180601
          273MDEntryTimeYTime when the given entry has been added or modified, UTC timezone273=03:30:30.657145

          MarketDataIncrementalRefresh

          MsgType: X

          Direction: IN

          Description: given message is used to transmit sequential updates for the particular order book. It might contain any number of NEW, UPDATE, DELETE and TRADE events that reflect the most recent book’s changes. 

          Valid processing order: DELETE → UPDATE → NEW.

          Server always stream explicit DELETE events. 

          Please note, that standard FIX 4.4 MarketDataIncrementalRefresh message has been changed by moving Symbol(55) and Security Exchange(207) fields out of NoMDEntires(268) group.

          TagField Name Required CommentsExample
          262 MDReqID YMDReqID associated with the previous request 262=100_1
          55Symbol YSymbol Name55=ETH/BTC
          207 SecurityExchangeYExchange Name207=HUOBI
          268 NoMDEntriesY
          279MDUpdateActionYSupported Values:

          • 0 - NEW

          • 1 - CHANGE

          • 2 - DELETE

          • 3 - RESET


          For trade event should be NEW
          279=1
          2699 MDEntryTypeYSupported Values:

          • 0 - BID

          • 1 - OFFER

          • 2 - TRADE

          269=0
          270MDEntryPxYPrice270=0.035089
          271MDEntrySize NEntry size. This field might be absent in case of DELETE event271=3.214
          272MDEntryDate YDate when the given entry has been added or modified last time
          ISO 8601 format is used, UTC timezone
          272=20180601
          273MDEntryTimeYTime when the given entry has been added or modified, UTC timezone 273=03:30:32.506124
          2446AggressorSide N Indicates which side is the aggressor of the trade (MDEntryType = TRADE).
          Supported Values:

          • 0 - BID

          • 1 - ASK

          • 2 - UNDEFINED

          2446=0
          83 RptSeqYMD Entry sequence number per instrument update 83=587