|
| 1 | +Introduction |
| 2 | +========================================================================================================================================================= |
| 3 | + |
| 4 | +FIX Simple Binary Encoding (SBE) targets high performance trading |
| 5 | +systems. It is optimized for low latency of encoding and decoding while |
| 6 | +keeping bandwidth utilization reasonably small. For compatibility, it is |
| 7 | +intended to represent all FIX semantics. |
| 8 | + |
| 9 | +This encoding specification describes the wire protocol for messages. |
| 10 | +Thus, it provides a standard for interoperability between communicating |
| 11 | +parties. Users are free to implement the standard in a way that best |
| 12 | +suits their needs. |
| 13 | + |
| 14 | +The encoding standard is complimentary to other FIX standards for |
| 15 | +session protocol and application level behavior. |
| 16 | + |
| 17 | +Binary type system |
| 18 | +---------------------------------------------------------------------------------------------------------------- |
| 19 | + |
| 20 | +In order to support traditional FIX semantics, all the documented field |
| 21 | +types are supported. However, instead of printable character |
| 22 | +representations of tag-value encoding, the type system binds to native |
| 23 | +binary data types, and defines derived types as needed. |
| 24 | + |
| 25 | +The binary type system has been enhanced in these ways: |
| 26 | + |
| 27 | +- Provides a means to specify precision of decimal numbers and |
| 28 | + timestamps, as well as valid ranges of numbers. |
| 29 | + |
| 30 | +- Differentiates fixed-length character arrays from variable-length |
| 31 | + strings. Allows a way to specify the minimum and maximum length of |
| 32 | + strings that an application can accept. |
| 33 | + |
| 34 | +- Provides a consistent system of enumerations, Boolean switches and |
| 35 | + multiple-choice fields. |
| 36 | + |
| 37 | +Design principles |
| 38 | +--------------------------------------------------------------------------------------------------------------- |
| 39 | + |
| 40 | +The message design strives for direct data access without complex |
| 41 | +transformations or conditional logic. This is achieved by: |
| 42 | + |
| 43 | +- Usage of native binary data types and simple types derived from |
| 44 | + native binaries, such as prices and timestamps. |
| 45 | + |
| 46 | +- Preference for fixed positions and fixed length fields, supporting |
| 47 | + direct access to data and avoiding the need for management of heaps |
| 48 | + of variable-length elements which must be sequentially processed. |
| 49 | + |
| 50 | +Message schema |
| 51 | +------------------------------------------------------------------------------------------------------------ |
| 52 | + |
| 53 | +This standard describes how fields are encoded and the general structure |
| 54 | +of messages. The content of a message type is specified by a message |
| 55 | +schema. A message schema tells which fields belong to a message and |
| 56 | +their location within a message. Additionally, the metadata describes |
| 57 | +valid value ranges and information that need not be sent on the wire, |
| 58 | +such as constant values. |
| 59 | + |
| 60 | +Message schemas may be based on standard FIX message specifications, or |
| 61 | +may be customized as needed by agreement between counterparties. |
| 62 | + |
| 63 | +Glossary |
| 64 | +------------------------------------------------------------------------------------------------------ |
| 65 | + |
| 66 | +**Data type** - A field type with its associated encoding attributes, |
| 67 | +including backing primitive types and valid values or range. Some types |
| 68 | +have additional attributes, e.g. epoch of a date. |
| 69 | + |
| 70 | +**Encoding** - a message format for interchange. The term is commonly used |
| 71 | +to mean the conversion of one data format to another, such as text to |
| 72 | +binary. However, Simple Binary Encoding strives to use native binary |
| 73 | +data types in order to make conversion unnecessary, or at least trivial. |
| 74 | +Encoding also refers to the act of formatting a message, as opposed to |
| 75 | +decoding. |
| 76 | + |
| 77 | +**Message schema** - metadata that specifies messages and their data |
| 78 | +types and identifiers. Message schemas may be disseminated out of band. |
| 79 | +For Simple Binary Encoding, message schemas are expressed as an XML |
| 80 | +document that conforms to an XML schema that is published as part of |
| 81 | +this standard. |
| 82 | + |
| 83 | +**Message template** - metadata that specifies the fields that belong to |
| 84 | +one particular message type. A message template is contained by a |
| 85 | +message schema. |
| 86 | + |
| 87 | +**Session protocol** - a protocol concerned with the reliable delivery of |
| 88 | +messages over a transport. FIX protocol makes a distinction between |
| 89 | +session protocol and the encoding of a message payload, as described by |
| 90 | +this document. See the specifications section of FIX protocol web site |
| 91 | +for supported protocols. The original FIX session protocol is known as |
| 92 | +FIXT. |
| 93 | + |
| 94 | +**XML schema** - defines the elements and attributes that may appear in an |
| 95 | +XML document. The SBE message schema is defined in W3C (XSD) schema |
| 96 | +language since it is the most widely adopted format for XML schemas. |
| 97 | + |
| 98 | +Documentation |
| 99 | +----------------------------------------------------------------------------------------------------------- |
| 100 | + |
| 101 | +This document explains: |
| 102 | + |
| 103 | +- The binary type system for field encoding |
| 104 | + |
| 105 | +- Message structure, including field arrangement, repeating groups, |
| 106 | + and relationship to a message header that may be provided by a |
| 107 | + session protocol. |
| 108 | + |
| 109 | +- The Simple Binary Encoding message schema. |
| 110 | + |
| 111 | +### Specification terms |
| 112 | + |
| 113 | +These key words in this document are to be interpreted as described in |
| 114 | +[Internet Engineering Task Force RFC2119](http://www.apps.ietf.org/rfc/rfc2119.html). These terms indicate |
| 115 | +an absolute requirement for implementations of the standard: "**must**", |
| 116 | +or "**required**". |
| 117 | + |
| 118 | +This term indicates an absolute prohibition: "**must not**". |
| 119 | + |
| 120 | +These terms indicate that a feature is allowed by the standard but not |
| 121 | +required: "**may**", "**optional**". An implementation that does not |
| 122 | +provide an optional feature must be prepared to interoperate with one |
| 123 | +that does. |
| 124 | + |
| 125 | +These terms give guidance, recommendation or best practices: |
| 126 | +"**should**" or "**recommended**". A recommended choice among |
| 127 | +alternatives is described as "**preferred**". |
| 128 | + |
| 129 | +These terms give guidance that a practice is not recommended: "**should not**" |
| 130 | +or "**not recommended**". |
| 131 | + |
| 132 | +### Document format |
| 133 | + |
| 134 | +In this document, these formats are used for technical specifications |
| 135 | +and data examples. |
| 136 | + |
| 137 | +This is a sample encoding specification |
| 138 | + |
| 139 | +```xml |
| 140 | +<type name="short" primitiveType="int16" semanticType="int" /> |
| 141 | +``` |
| 142 | + |
| 143 | +This is sample data as it would be transmitted on the wire |
| 144 | + |
| 145 | +`10270000` |
| 146 | + |
| 147 | +References |
| 148 | +------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 149 | + |
| 150 | +### Related FIX Standards |
| 151 | + |
| 152 | +*Simple Open Framing Header*, FIX Protocol, Limited. Release Candidate 1 |
| 153 | +specification has been published at |
| 154 | +<http://www.fixtradingcommunity.org/> |
| 155 | + |
| 156 | +For FIX semantics, see the current FIX message specification, which is |
| 157 | +currently [FIX 5.0 Service Pack 2](http://www.fixtradingcommunity.org/pg/structure/tech-specs/fix-version/50-service-pack-2) |
| 158 | +with Extension Packs. |
| 159 | + |
| 160 | +### Dependencies on other standards |
| 161 | + |
| 162 | +SBE is dependent on several industry standards. Implementations must |
| 163 | +conform to these standards to interoperate. Therefore, they are |
| 164 | +normative for SBE. |
| 165 | + |
| 166 | +[IEEE 754-2008](http://ieeexplore.ieee.org/servlet/opac?punumber=4610933) A |
| 167 | +Standard for Binary Floating-Point Arithmetic |
| 168 | + |
| 169 | +[ISO 639-1:2002](http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=22109) |
| 170 | +Codes for the representation of names of languages - Part 1: Alpha-2 |
| 171 | +code |
| 172 | + |
| 173 | +[ISO 3166-1:2013](http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=63545) |
| 174 | +Codes for the representation of names of countries and their |
| 175 | +subdivisions - Part 1: Country codes |
| 176 | + |
| 177 | +[ISO 4217:2008](http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=46121) |
| 178 | +Codes for the representation of currencies and funds |
| 179 | + |
| 180 | +[ISO 8601:2004](http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=40874) |
| 181 | +Data elements and interchange formats - Information interchange - |
| 182 | +Representation of dates and times |
| 183 | + |
| 184 | +[ISO 10383:2012](http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=61067) |
| 185 | +Securities and related financial instruments - Codes for exchanges and |
| 186 | +market identification (MIC) |
| 187 | + |
| 188 | +XML 1.1 schema standards are located here [W3C XML Schema](http://www.w3.org/XML/Schema.html#dev) |
0 commit comments