Giter Club home page Giter Club logo

spreadget's Introduction

spreadget: Get the spread from two exchanges and publish as gRPC

  • connect to two exchanges' websocket feeds simultaneously
  • pull the current order books over those streaming connections for a given traded market, from each exchange
  • merge and sort the order books to create a combined order book
  • from the combined book, publish the spread (top 10 bids and asks) as gRPC stream

CLI Interface

spreadget 0.1.0

USAGE:
    spreadget [FLAGS] [OPTIONS] [symbol]

FLAGS:
    -h, --help       Prints help information
        --tui        Run a TUI dashboard instead of showing log output
    -V, --version    Prints version information

OPTIONS:
    -a, --address <address>    Address on which to serve gRPC streams of order books [default: 0.0.0.0:54321]

ARGS:
    <symbol>    Market symbol to examine [default: ethbtc]

Logging

This program logs events of interest, as configured by env_logger. See that documentation for examples of how to configure the log filters. For basic use sufficient to see incoming order books, use

$ RUST_LOG=info cargo run --
...
[2022-03-24T20:40:56Z INFO  spreadget] aggregator received new order book data from binance
[2022-03-24T20:40:57Z INFO  spreadget] aggregator received new order book data from binance
[2022-03-24T20:40:57Z INFO  spreadget] aggregator received new order book data from binance
[2022-03-24T20:40:57Z INFO  spreadget] aggregator received new order book data from binance
[2022-03-24T20:40:57Z INFO  spreadget] aggregator received new order book data from bitstamp
[2022-03-24T20:40:57Z INFO  spreadget] aggregator received new order book data from binance
[2022-03-24T20:40:57Z INFO  spreadget] aggregator received new order book data from bitstamp

Testing

The simplest way to observe the full system behavior is to use two terminals. In the first, we run spreadget:

RUST_LOG=info cargo run -- --address '0.0.0.0:54321'

In the second, we can use the grpcurl tool to observe the output:

grpcurl -plaintext -import-path src -proto orderbook.proto 127.0.0.1:54321 orderbook.OrderbookAggregator/BookSummary

Note that grpcurl requires access to the .proto definition in order to function properly. If not running from within the spreadget root directory, adjust the -import-path argument appropriately.

TUI

When built with feature ticker (enabled by default), the executable gains a --tui flag. This flag, when set, enables a dashboard which streams the most current summaries via gRPC.

image

spreadget's People

Contributors

coriolinus avatar

Watchers

James Cloos avatar  avatar  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.