Skip to content

tredfern0/suave-lobdex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Suave-LOBDEX

Proof of concept for a central limit order book (CLOB) style DEX built on Suave.

Due to Suave's unique features it's possible to build a limit order book that runs in real time, with built in privacy features.

DEX Design

Bids and asks are stored in a heap and matched up in real time.

Although events are emitted on callbacks, all the core logic runs in a kettle. As a result, data could be emitted via an API call precompile in order to provide a real time view of the book, or alternatively nothing could be emitted and you'd have a fully private dark pool.

The current implementation is only a bare bones proof of concept, it only contains basic logic for storing and matching orders. There are glaring security holes with regard to accessing the orders, and no checks that ensure orders are valid. Additional features would be needed to ensure that users had funds available to place the orders, and an L1 settlement mechanism is needed as well.

Dependencies

  1. Foundry

  2. Suave

Usage

Build

$ forge build

Test

Use the ffi flag with Forge.

$ forge test --ffi

About

Limit order book on Suave

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published