# B3 Binary UMDF: packet header, framing header, SBE messages and the schema

> Learn how B3's Binary UMDF feed frames SBE market-data messages inside UDP multicast packets, how its streams and gap recovery work, what differs in its schema, and where to download it.

Page: https://structure.fi/guides/b3-umdf/

Binary UMDF (Unified Market Data Feed) is the real-time market-data protocol of B3, Brazil's exchange for equities and derivatives. Trading firms and market-data vendors subscribe to Binary UMDF over UDP multicast for live order-book updates, trades, and statistics encoded in [Simple Binary Encoding (SBE)](https://structure.fi/guides/sbe-message-layout/)—a lower-overhead replacement for B3's older FIX/FAST UMDF feed.

This page breaks down a Binary UMDF packet from byte 0 (its 16-byte packet header, 4-byte framing header, and SBE messages), outlines B3's channels and snapshot recovery, flags schema quirks like custom `nullValue="0"` types, and shows where to download B3's public XML schema.

This guide is not affiliated with or endorsed by B3; where this page and B3's Binary UMDF documents (under sources) differ, B3's documents are authoritative. See the [protocol directory](https://structure.fi/guides/protocol-directory/) for B3's FAST feed and order entry.

## A packet, from the first byte

Packets travel over UDP multicast, are at most 1,400 bytes, contain one or more whole messages (never fragmented across packets), and are entirely [little-endian](https://structure.fi/guides/binary-message/#endianness).

**Packet header (16 bytes, once per packet):**

- Channel number (1 byte) + reserved (1 byte).
- Sequence version (`uint16`): starts at 1 on the incremental stream and increments weekly or after failover; increments each loop on the loop streams.
- Sequence number (`uint32`): increments by 1 per packet within a channel and sequence version.
- Sending time (`uint64`): nanoseconds since the Unix epoch ([timestamps as integers](https://structure.fi/guides/prices-and-times-as-integers/#a-note-on-timestamps-the-same-integer-idea)).

**Each message (repeated to end of packet):**

1. **4-byte framing header** (B3's compact little-endian [SOFH](https://structure.fi/guides/sbe-message-header/#variations-and-framing)): `messageLength` (`uint16`, total message bytes from the start of the framing header) and encoding type (`uint16`, always `0xEB50` for SBE 1.0 little-endian).
2. **8-byte standard [SBE message header](https://structure.fi/guides/sbe-message-header/):** `blockLength`, `templateId`, `schemaId`, `version`.
3. **SBE message body** ([as SBE lays it out](https://structure.fi/guides/sbe-message-layout/)): root block, [repeating groups](https://structure.fi/guides/variable-sized-data/#sbe-count-prefixed-groups-and-length-prefixed-data), variable-length data. Advance by `messageLength` from the start of the framing header to reach the next message.

Unlike CME's [MDP 3.0](https://structure.fi/guides/cme-mdp3/) schema, B3's XML actually declares `PacketHeader` and `FramingHeader` as composites, though no `<message>` references them—their wire order comes from B3's specification guidelines.

## Channels and feeds

Instruments are divided into channels, each carrying three streams:

- **Incremental stream:** real-time book updates, trades, and statistics, duplicated on Feed A and Feed B (receivers keep the first copy of each packet).
- **Instrument definition stream:** repeating loop of security definitions (Feed A only).
- **Snapshot recovery stream:** repeating loop of full books and latest statistics (Feed A only).

B3 also operates Feed C from its disaster recovery site.

## Recovery in brief

When incremental sequence numbers show a gap, queue incoming incremental messages and read the affected instrument's snapshot from the snapshot recovery stream. Each instrument has its own `rptSeq` counter, and each snapshot reports the last `rptSeq` it includes; apply only queued messages with a higher `rptSeq` and the same sequence version.

## What is in the schema

One SBE XML file holds all Binary UMDF templates: market-by-order book updates, trades, statistics, security definitions, security status, snapshots, and channel control messages.

Two details catch developers used to CME schemas off guard:

- **Custom `nullValue="0"`:** `Int8NULL` through `UInt64NULL`, `RptSeq`, and `FirmOptional` declare `0` as null instead of the SBE min/max defaults. Hard-coding SBE defaults misreads empty fields as zero and valid `255` values as null ([null values](https://structure.fi/guides/binary-message/#null-values) and [SBE presence and null values](https://structure.fi/guides/sbe-schema-file/#presence-and-null-values)).
- **Two version numbers:** the root element carries both wire `version` (sent in every header) and `semanticVersion` (B3's release version, e.g. `2.3.1`, matching the file name and top-of-file XML change history).

Prices follow CME's fixed-exponent pattern: an `int64` mantissa paired with a constant exponent ([fixed-point integers](https://structure.fi/guides/prices-and-times-as-integers/#fixed-point-one-fixed-scale)).

## Get the schema

- **Where:** B3's public Binary UMDF developer page lists the XML schemas (e.g. `b3-market-data-messages-2.3.1.xml` under sources), Message Specification Guidelines, Message Reference, and sample PCAP captures for equities and derivatives.
- **Fetching:** no login required; download with a browser or `curl`. B3's server sends no CORS header, so another website cannot fetch it directly in browser JS.
- **Licence:** the XML carries no licence text and the guidelines are marked public without reuse terms; fetch directly from B3 rather than republishing.
- **Other venues:** where each venue publishes its specifications, schemas and sample pcap files is in [market data schemas and sample files: where to get them](https://structure.fi/guides/sample-market-data-files/).

## In the Market Data Visualizer

Open your copy of `b3-market-data-messages-2.3.1.xml` in the Market Data Visualizer to inspect all templates, offsets, groups, and versions. Pick **B3 UMDF UDP packet** in the **Framing** select of the pane bar to draw the 16-byte packet header, the 4-byte framing header and the SBE header as their own layers in front of each message (`PacketHeader` → repeating `FramingHeader` → `messageHeader`). With **No framing**, layouts start at byte 0 of the root block.

## Sources

- https://www.fixtrading.org/what-is-the-fix-protocol/
- https://www.b3.com.br/en_us/solutions/platforms/puma-trading-system/for-developers-and-vendors/binary-umdf/
- https://www.b3.com.br/data/files/84/B7/1D/9E/AB611A103BBB511AAC094EA8/BinaryUMDF-MessageSpecificationGuidelines-v.2.3.1.2-enUS.pdf
- https://www.b3.com.br/data/files/D9/B7/3B/07/C706F910CEC024F9AC094EA8/b3-market-data-messages-2.3.1.xml

Reviewed by Structure on 2026-11-24. Last changed 2026-11-26.
