Omi P4 Definitions
September 25, 2026 · View on GitHub
Omi P4 definitions describe common binary exchange protocols as target independent P4₁₆ programs, so the wire format parses on P4 software and hardware data planes.
These definitions are built and tested with the P4 reference toolchain: p4c
Usage
Each .p4 file is a complete P4₁₆ (v1model) program for one protocol version: header type declarations, a parser that walks the message stack dispatching on message type, and the v1model control and package scaffold. Compile a definition to the bmv2 target with the P4 reference compiler:
p4c-bm2-ss --p4v 16 iex/tops/iexequities_tops_v1_66.p4 -o iexequities_tops.json
The resulting bmv2 JSON runs on the behavioral model reference switch, and the same program compiles to hardware targets through their P4 back ends.
For compiler and target information: p4c
Development
Updates are greatly appreciated; however, this entire repository is source generated...including the words you are reading right now. If you wish to suggest definition updates, the recommended process is to create an issue with changes and explanation. Time permitting, we will update the models and regenerate.
| Protocol Count | Generated Lines |
|---|---|
| 852 | 751,290 |
Testing
Please report any parsing errors as an issue. Include a small note on the protocol and version, and a minimal capture demonstrating the problem. Also consider including a link or pdf specification documenting the correct behavior.
Production packet captures are required for protocol verification. If your organization has the rights to packet captures, and you wish to make the world a better place, please post captures to this project.
Open Markets Initiative
The Open Markets Initiative (Omi) is a group of technologists dedicated to enhancing the stability of electronic financial markets using modern development methods.
Other generated code can be found at Omi Projects; for Omi rules and regulations, see Omi Directory.
Organizations
24X · A2X · Aquis · Asx · B3 · Bist · Biva · BlueOceanAts · Bse · CixAts · Cme · Coinbase · Eurex · Euronext · Ice · Iex · Imperative · Jnx · Jpx · Memx · Nasdaq · Nse · Nyse · OtcMarkets · Sgx
Exchanges
24XEquities · A2XEquities · AmexEquities · AmexOptions · AquisEquities · ArcaEquities · ArcaOptions · AsxDerivatives · AsxSecurities · B3Derivatives · BivaEquities · BorsaIstanbul · BseIndia · CoinbaseDerivatives · Deribit · FseEquities · GemxOptions · IceFutures · IexEquities · IexOptions · IseOptions · JnxBonds · JnxEquities · MemxEquities · MemxOptions · MrxOptions · NationalEquities · NomOptions · NordicEquities · NseCd · NseCm · NseCom · NseEquities · NseFo · NsmEquities · NtxEquities · NtxOptions · NyseEquities · NyseOptions · OseDerivatives · PhlxOptions · PsxEquities · SseEquities · TexasEquities · TseEquities · BlueEquities · IntelligentCross · LinkAts · LinkNqb · MoonAts · Overnight
Platforms
CixAts CixAspen · Cme Globex · Euronext Optiq · Eurex T7 · Sgx TitanDt
Consolidators
NyseConsolidated · Uqdf · Utdf · Utp
Related Definitions
The Open Markets Initiative provides protocol definitions in several formats:
- Kaitai Struct Definitions — cross language binary parsers with the kaitai struct compiler
- DFDL Definitions — declarative DFDL schemas for cross language parsing
- Spicy Definitions — declarative Spicy grammars for the spicy toolchain and the zeek network security monitor
- Lean Definitions — Lean 4 definitions with machine checked encode and decode proofs
- TLA+ Definitions — TLA+ modules whose encode and decode are model checked with TLC
- FIX Dictionaries — QuickFIX format xml data dictionaries, one per FIX version
- Xml Specifications — the exchange protocol specification xmls, matching the original files
Disclaimer
Any similarities between existing people, places and/or protocols is purely incidental.
Enjoy.
