Git Product home page Git Product logo

cubical.systems's People

Contributors

5ht avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cubical.systems's Issues

Trader Supervisor

Trader should have access to same incoming streams and interoperate with Execution.

Book Consistency Checking

Books consistency are being checked by sequence numbers assigned to messages and Order Book snapshots. Replay is a part of both consistency checking and snapshot initialisation.

Store trade data from GDAX and Bitmex

(for GDAX, trades are available as 'match' events from WS API; for BitMEX, there is 'trade' channel)

All trades should be recorded like this (one file per symbol per 24h day):

timestamp price amount

e.g.

2017-02-27T13:20:33.486Z 1124.54 -5600

(positive amounts are BUY trades, negative are SELL trades).

Snapshot Request

Extend trade protocol with snapshot requests on stream initialization.
Applicable only for GDAX.

IDs are always incrementing

Soon, we'll get out of IDs :)

Instead, internal order book IDs need to be reused.

If an order is removed from the book, its ID can be reused again.

(E.g. by keeping a sorted set of recycled IDs for each side of each book, and getting the first one from here each time we need a new ID)

Write full book into dump files episodically

E.g. every 10 minutes, or once per 1000 updates, dump current full book status to the data file.

[* 0] [+1 1.1134.05 0.56] [+2 1.1134.07 2.5] [+3 1134.08 0.8] ...

This is necessary to be able to build the book from file in memory, or to recover from errors (losing only the data between the "keyframes").

Map more instruments for Bitmex

Add the following instruments for Bitmex (all of them are futures or swaps, so currency pair naming conventions do not apply).

COIN_BH17
DASH7D
ETH7D
XBTUSD

(futures have changing symbols, so they are to be handled separately)

In our storage, they are to be mapped as is with '@BitMEX' added as exchange designator, e.g.

COIN_BH17@BitMEX
DASH7D@BitMEX
ETH7D@BitMEX
XBTUSD@BitMEX

JSON subscription API

While I design FIX API, let's do something simple with JSON:

{"type": "subscribe", "channel": ["trade", "orderBookL2"], "sources": ["gdax", "bitmex"]}

Order book update ("market data"):

< {"type": "book", "source": "gdax", "symbol": "BTC/USD", "updates": [[232, 1134.23, 0.5], [-23, 0], [-322, 1132.1, 7.5]]}

(full book is encoded with "remove all" update, then list of add commands for all entries in the book)

< {"type": "trade", "source": "gdax", "symbol": "BTC/USD", "price": 1183.12, "amount": -2354.5}

etc.

Alko API

  • Book API — done
  • Trader/Execution API — awaiting
  • Alko API — awaiting

New record format for storage files

Let's change BID order ids in the book to be negative, and OFFER to be positive. This will get rid of the ugly "+0/-0" shit.

E.g.

[+435 1134.0 0.43] -- add/replace offers with id 435, price 1134.0 amount 0.43
[-245 0] -- remove bid order with id 245 from the book

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.