Skip to content

ND-HFTT: Mirella Wunderlich - Final Project#1

Open
mdinizwu wants to merge 5 commits intomatthewbelcher:mainfrom
mdinizwu:special_orders
Open

ND-HFTT: Mirella Wunderlich - Final Project#1
mdinizwu wants to merge 5 commits intomatthewbelcher:mainfrom
mdinizwu:special_orders

Conversation

@mdinizwu
Copy link
Copy Markdown

@mdinizwu mdinizwu commented May 6, 2025

NDFEX: Advanced Order Types Implementation - Final Report

Project Overview
This project extended the existing Notre Dame Fake Exchange (NDFEX) with advanced order types (specifically Iceberg and All or None (AON) orders). The goal was to expand the exchange offerings and, in the future, allow students to develop a more robust understanding of trading and complex strategies

Implementation Approach

  • Extended the order entry protocol to include new flags and parameters (display quantity vs. total quantity)
  • Modified the order ladder to accommodate new order types
  • Implemented new controls appropriate for each order type in validator
  • Modified the matching engine logic to handle the specialized behaviors of each order type
  • Updated the market data publisher to properly reflect visible order information

Iceberg Orders Implementation
Iceberg orders were implemented with the following requirements:

  • Display quantity must be at least 5% of the total order quantity
  • Total quantity must be at least 10x the minimum lot size
  • Only the display quantity is published to market data feeds
  • When partially filled, the order "refreshes" by replenishing the display quantity and losing priority

All-or-None Orders Implementation
AON orders were implemented with the following requirements:

  • Total quantity must be at least 5x minimum lot size and at most 0.5x maximum lot size
  • Orders must be executed in their entirety or not at all
  • Before matching, the system checks if sufficient liquidity exists
  • When combined with IOC flags, orders are deleted if they cannot be fully executed

Challenges Overcome

  • Integrating new order types without disrupting existing functionality
  • Ensuring consistent behavior across edge cases (orders with multiple flags, partial versus complete fills, multiple orders filled at once, etc)
  • Managing the visibility of order quantities while ensuring the matching engine correctly tracked the full order size internally
  • Balancing system performance with the additional complexity
  • Developing comprehensive test cases to verify correct behavior

Testing Framework

  • Unit tests verified individual components using mock subscribers
  • Integration tests were run with trading system built as a part of class homework
  • Multiple test scenarios were considered and covered the entire lifecycle of advanced orders

Updates Since Final Project Presentation

  • Expanded tests with order priority validation and complex fill scenario testing
  • Resolved multiple edge cases that weren't accounted, for example price levels that include a singular iceberg order being wiped out
  • Strengthened validation rules in order entry and matching pipeline, including modifying order ladder to correctly enforce priority loss when iceberg orders refresh

Learning Experience
The project provided valuable insights into:

  • Order book mechanics and market structure
  • The challenges of creating/maintaining an exchange
  • The importance of intense testing when modifying financial systems

Copy link
Copy Markdown
Owner

@matthewbelcher matthewbelcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks this is a nice contribution to NDFEX. Also, your group had the hardest project - working with my code! I will merge these once I fix the conflicts with the local changes I made for the trading competition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants