Skip to content

About

Deterministically code generated LEAN proofs for common exchange protocols

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

60 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Omi Lean Definitions

Omi Lean definitions describe common binary exchange protocols as Lean 4 modules that carry their own proofs.

Lean

These definitions are checked with the Lean toolchain: lake

Usage

Each .lean file is a self contained module for one protocol version: a structure per message, an inductive per coded field, a sum type dispatching on the message type, and the theorems relating each decoder to its encoder. The shared Wire.lean holds the field kinds (big and little endian integers, fixed width text, counted repetition) and their lemmas. Check every proof with lake:

lake build

A definition is used as an ordinary Lean library: decode reads a List UInt8 and returns the message with the bytes that follow, encode writes one, and the theorems are available to anything built on top.

For toolchain information: Lean Toolchain

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
928 3555205

Testing

Build

The build checks every proof. The tests under .github/tests/ decode captured packets from omi-data-packets and require each to be consumed exactly; each is a theorem decided at build time, so a failing test fails the build.

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.

Open Markets Initiative

Omi 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 Repositories; for Omi rules and regulations, see Omi Directory.

Organizations

24X · A2X · Aquis · Asx · B3 · Binance · Bist · Biva · BlueOceanAts · Box · BruceAts · Bse · CixAts · Cme · Coinbase · Eurex · Euronext · Iex · Imperative · Jpx · Lme · Lseg · Ltse · Memx · Miax · Nasdaq · Nextrade · Nse · NsxAustralia · Nyse · Odx · OtcMarkets · Sgx · Siac · SmallX · Szse · Taifex · Tmx · Tradelogiq · Txse

Exchanges

24XEquities · A2XEquities · AmexEquities · AmexOptions · AquisEquities · ArcaEquities · ArcaOptions · AsxDerivatives · AsxSecurities · B3Derivatives · BinanceSpot · BivaEquities · BlueEquities · BorsaIstanbul · BoxOptions · BruceEquities · BseIndia · BxEquities · CoinbaseDerivatives · Deribit · EmeraldOptions · FseEquities · GemxOptions · IexEquities · IntelligentCross · IseOptions · LinkAts · LinkNqb · LmeSelect · Lse · LtseEquities · LynxAts · MemxEquities · MemxOptions · MiaxOptions · MoonAts · MrxOptions · Mx · NasdaqCanada · NationalEquities · Nextrade · NfxFutures · NomOptions · NordicDerivatives · NordicEquities · NseCd · NseCm · NseCom · NseEquities · NseFo · NsmEquities · NtxEquities · NtxOptions · NyseBonds · NyseEquities · NyseOptions · OdxEquities · OdxSecurityToken · OmegaAts · OnyxFutures · OseDerivatives · Overnight · PearlEquities · PearlOptions · PhlxOptions · PsxEquities · SapphireOptions · SmallFutures · SseEquities · SzseSecurities · TaifexDerivatives · TexasEquities · TradeEcho · TseEquities · Tsx · TsxAlpha · Turquoise · TxseEquities

Platforms

CixAts CixAspen · Cme Globex · Lseg Millennium · NsxAustralia Nets · Euronext Optiq · Eurex T7 · Sgx TitanDt

Consolidators

Cqs · Cts · Opra · Uqdf · Utdf · Utp

Related Definitions

The Open Markets Initiative provides protocol definitions in several formats:

Disclaimer

Any similarities between existing people, places and/or protocols is purely incidental.

Enjoy.

About

Deterministically code generated LEAN proofs for common exchange protocols

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Contributors

Languages