Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Live Order Board

Playing around with Kotlin - building an in-memory order management system for cryptocurrency trading. Handles order placement, cancellation, and real-time summary views across multiple price levels.

Features

  • Multi-coin support - BITCOIN, ETHEREUM, LITECOIN, XPX
  • Two-sided order book - Separate BUY/SELL books with proper price ordering (highest bids first, lowest offers first)
  • Price level aggregation - Orders at same price consolidated into single summary entry
  • Top-of-book view - Summary limited to top 10 price levels per side

API

interface LiveOrderBoardAPI {
    fun placeOrder(userId: String, coinType: CoinType, quantity: Double, price: Double, direction: Direction): String
    fun deleteOrder(orderId: String)
    fun getSummary(coinType: CoinType): Collection<OrderSummary>
}

Data Structures

  • TreeMap for price-ordered levels (descending for bids, ascending for offers)
  • LinkedHashMap for orders at each price level (maintains insertion order)
  • Per-coin Market objects isolate order books by instrument

Running Tests

mvn test

Known Limitations

  • Not thread-safe (single-threaded use only)
  • No persistence (in-memory only)
  • Basic validation via require statements
  • Could optimize quantity tracking at price level

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages