Git Product home page Git Product logo

shabbirhasan1 / trading_engine_rust Goto Github PK

View Code? Open in Web Editor NEW

This project forked from omerhalid/trading_engine_rust

0.0 0.0 0.0 830 KB

Developed a high-performance trading engine using Rust, leveraging its powerful features for low-level systems programming. Engineered to handle real-time data processing and complex algorithmic trading strategies, the project demonstrates proficiency in Rust's strong memory safety guarantees and concurrency model.

Rust 100.00%

trading_engine_rust's Introduction

Rust Trading Engine

This is a simple order-matching trading engine built in Rust programming language. The engine supports the creation of multiple markets (trading pairs) and allows for the placement of buy and sell orders. Overview

The trading engine consists of the following main components:

OrderBook: Contains all the buy (Bid) and sell (Ask) orders in a market. Orders are divided into 'Bid' and 'Ask' orders, and are stored in separate HashMap collections, each associated with a specific price level.

Order: Represents a buy (Bid) or sell (Ask) order with a specific size (amount).

Limit: Groups all orders at a particular price level. Includes functions to fill orders and compute the total volume of orders at that limit level.

MatchingEngine: The core engine that executes trading operations. It maintains a collection of OrderBooks, one for each trading pair. Supports functions like adding a new market (a new trading pair), and placing limit orders.

TradingPair: Represents a pair of currencies that can be traded. The 'base' is the currency being bought or sold, and the 'quote' is the currency used as a reference for price.

The engine operates by constantly checking for matchable orders (i.e., a sell order and a buy order at the same price). When a match is found, the orders are "filled" and removed from the OrderBook. The engine uses Limit Orders to ensure trades are only executed at the limit price or better. Usage

To run the trading engine, clone the repository and use Rust's cargo run command:

bash

$ git clone https://github.com/yourusername/rust-trading-engine.git $ cd rust-trading-engine $ cargo run

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

trading_engine_rust's People

Contributors

omerhalid avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.