Giter Site home page Giter Site logo

order-management-engine's Introduction

Order-Management-Engine

Order Management Engine in Trade Life Cycle

A Simple REST API

The API currently accepts JSON from client. On receiving true JSON, it prints the content of JSON at server side and then sends a JSON acknowledgement 'ack' to client with {'success':'true'}.

In recent commits, code for order/fill insertion and updation is added. Now, whenever JSON order/fill is sent, it is added/updated in the MongoDB database which is set up on an AWS machine.

Following functionalities have been implemented :- From Order entry gateway :- Add new order, Update price of order, Update quantity of order, Cancel an order; From Execution links :- Add new fill

Functionalities like storing user subscriptions to particular orders in cache and handling notifications are yet to be implemented.

You need to install Flask and requests:

$ pip install flask gevent requests

Starting the Flask server

$ python run_flask_server.py 
...
 * Running on http://127.0.0.1:5000

You can now access the REST API via http://127.0.0.1:5000.

Submitting requests to the server

Requests can be submitted via cURL from another terminal instance:

$ curl  -X POST  -H "Content-Type: application/json"  -d '{"key1":"value1", "key2":"value2"}' 'http://localhost:5000/order_endpoint'  
{
  "success": false
}

OR programmatically using python/PHP/any other language

A Python Driver program - Endpoint to be called by Order entry gateway

$ python order_request.py

A Python Driver program - Endpoint to be called by Execution links

$ python execution_request.py

Installing MongoDB on Ubuntu :-

Follow the steps on https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ It requires 64 bit Ubuntu. This is not required, since MongoDB database is created and running on AWS server

Installing Flask-PyMongo on Ubuntu :-

$ pip install Flask-PyMongo

https://flask-pymongo.readthedocs.io/en/latest/ https://pypi.python.org/pypi/Flask-PyMongo

About the project files :-

run_flask_server.py :- It is the main file containing code for web service which has the REST API created and has two endpoints - "/order_endpoint" and "/execution_endpoint"

new_order_request.py :- It is a driver program that emulates sending POST request from Order Entry for adding new order

update_order_price_qty.py :- It is a driver program that emulates sending POST request from Order Entry for updating price and quantity of existing order

cancel_order.py - It is a driver program that emulates sending POST request from Order Entry for cancelling an existing order

get_order_details.py :- It is a driver program that emulates sending POST request from Order Entry for getting the orders placed by a user and correspoding fills to those orders

execution_request.py :- It is a driver program that emulates sending POST request from Execution Links for sending new fill coming from Matching Engine

exec_link_dummy_REST.py :- A dummy REST API web service created for Execution Links to test that OME can send new order/update in order coming from Order Entry to Execution Links

trad_post_dummy_REST.py :- A dummy REST API web service created for Trade Post Management to test that OME can send new fill coming from Execution Links to Trade Post Management

check_mongodb_contents_utility_program - A utility program containing python code snippet for checking the MongoDB collection contents to test the working

redis-cache-notifs :- It is directory containing code files for Pub Sub Notifications (Not integrated with the project)

order-management-engine's People

Contributors

ioctls avatar mayurbatwal avatar sahasradude avatar ypk4 avatar

Watchers

 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.