Coder Social home page Coder Social logo

btc_feed_aggregator's Introduction

Description

This project contains 3 services in seperate folders.

  1. binance_feed : Parses live feeds of orderbook from binance and provide gRPC server for other services to fetch latest orderbook based on size as parameter. To update the token pair update BINANCE_BTC_PAIR = "BTCBUSD" line in the BinanceFeedService.py file.
  2. ftx_feed : Parses live feeds of orderbook from ftx and provide gRPC server for other services to fetch latest orderbook based on size as parameter. To update the token pair update FTX_BTC_PAIR = "BTC/USD" line in the FTXFeedService.py file.
  3. btc_feed_aggregator : Provides REST API for fetching latest aggregated order book & calculate the best buy/sell price based on current aggregated orderbook. APIs are implemented using Flask. This service communicates with above services through gRPC client.

protobufs folder contains .proto files for the gRPC protocol buffer implementation.

Usage

The services are bundled in a docker-compose.yaml so the whole environment can be brought up by following command:

docker-compose up

After all the images are built and up, you will see logs for a Flask server being up at on 5000 port

Do any of the following set of requests to check the API response(you can use curl or browser for the same):

http://localhost:5000/calculate?side=buy&size=10

http://localhost:5000/calculate?side=sell&size=10

http://localhost:5000/order_book?size=50

Note: If you face Internal server error immidiate after the server is up, just wait for few more seconds and try again. The binance service might take tens of seconds to warmup.

That's it!

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.