Giter VIP home page Giter VIP logo

reactivetradercloud's Introduction

GitHub Workflow Status GitHub release (latest by date) GitHub

image

Reactive Trader®

Reactive Trader® is a real-time FX trading platform designed to showcase reactive programming principles across the full application stack.

Written in React and RxJs / React-RxJs and running on Hydra, the platform will continue to evolve and use the latest technologies.

Please see our Showcase page for a full list of the latest features.

image

Demo

Development

To run the web UI

  1. Fork and clone the ReactiveTraderCloud repo (see Contributing page)

  2. See client README

Manually update contracts for Trading Gateway API
  1. Open hydra-reactive-trader project in IntelliJ IDEA and run:

    ./gradlew
    
  2. Copy file component/gateway/trading/api/build/generated-sources/codecs/main/resources/trading-gateway.hyer to UI project src/client/trading-gateway.hyer

  3. Back in src/client, run:

    npm run generateCod
    

    This will regenerate TradingGateway.ts (file://./src/client/src/generated/TradingGateway.ts)

Run against local Backend Services
  1. Follow instructions to start Backend Services

  2. Run:

    VITE_HYDRA_URL=ws://localhost:8929 npm start
    

CI/CD

We practice continuous integration and deployment. Every branch and pull request triggers a build and deployment to an ephemeral environment. Merging to master causes a build and deployment to our development environment.

Contributing

Please see our contribution guidelines.

Who are we?

Reactive Trader was written by the team at Adaptive, a consultancy that specialises in building real-time trading systems.

Please contact us if you'd like to learn more, or follow us via our blog, Twitter, or LinkedIn.

License

This application is made available under the Apache license v2.0.

reactivetradercloud's People

Contributors

algreasley avatar audreyf1 avatar bhavesh-desai-scratch avatar dimitarchristoff avatar evanrs avatar fdore avatar fsarda avatar garyadaptive avatar ianbossman8 avatar jonclare avatar josepot avatar jpwatson avatar keithwoods avatar keshaldesai avatar mozmorris avatar pdeleastar avatar pmilla1606 avatar qooroo avatar rafgarciaa avatar rikoe avatar sholleworth avatar sizov avatar snonyedx avatar spcfran avatar stephan-thibodeau avatar taylor-adaptive avatar tdeheurles avatar tobyli96 avatar vasipuica avatar zhouyuhe 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  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  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  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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar

reactivetradercloud's Issues

Pricing tile states

Executing

  • tile should go in executing state when the user clicks trade and until it either get a response from the server or it times out (hardcode to 2sec)
    • while executing it should not be possible to trade again on this tile

image

Execution timeout

  • if we don't receive an execution (or rejection) after 2sec from the server the tile should go in this state
  • if the trade finally comes through, the tile should switch back to trade executed or trade rejected state

image

trade done & trade rejected

looks fine (styling discussed in another task)

Blotter issues

  • For some reason the new blotter is not scrollable
  • Also the styling should match the visual design https://drive.google.com/open?id=0B91PUsbMlc6iX3lCc3ZKNmgzRDA
  • when you tear off the blotter, the tiles and the analytics panels should use the space previously used by the blotter, this is not the case
  • the blotter does not use all the space available in the popup window, when it is in tear-off state
  • the 'Trader' column is not populated

image

Improve environment creation time

Test

  • when using docker hub
  • when using a docker repo in the same gcloud datacenter

2 levels of nginx might be a better setup than using the google load balancer stuff (slow to setup)

Tearoff windows

Either implement tearoff with an icon (like in current implementation) or with drag and drop (if it's simple enough).

Tear off windows should:

  • be chromeless
  • be draggable around easily
  • remember their position (in current solution we name the windows with the currency pair symbol and openfin automatically re-open them)
  • each tile should remember if it was 'in the container' or in tearoff mode: if you tear out some tiles and close the app it should re-open as it was before closing the app. I believe we used the local storage to implement that (ie. for each ccy pair we remember locally if it was 'in' or 'out')
  • be easy to bring back in the main container (ie. via an icon or drag and drop)
  • be topmost (always in front of the container otherwise it's too easy to 'loose' them)
  • should of course work exactly as if they were in the container (same behavior for tradable, stale, etc)

image

If the session expires, those tiles need to go to "pricing unavailable mode" and come back to life when you click Reconnect

image

Test crossbar.io websocket fallback

We need to test this and also display in the UI some indicator of the current connection type (for instance on mouse over of the connection status, or something like that).

Open chartIQ app

Icon in tile
image

Spinner while opening
image

Chart IQ app opened to the corresponding CCY pair
image

Remove 'Sales' and 'Admin tool'

We want a separate url for the admin tool and it's really just for us, we don't really want to advertise that it is there (and it will be password protected).

Sales does not exist so we should remove that for now.

Polish blotter style / format

  • Rows are too high (on Chrome on Mac at least)
  • separator does not goes to the end of the row

image

We need also to decide if we should use the same style as previous design (which was best implemented in the WPF version)

image

OpenFin notifications

When a trade is done or rejected we show a notification

Features

  • clicking on the notification restores the application (if minimized) and bring it to front (if behind another app)
  • highlight the corresponding trade in the blotter (animate or flash)

Trade done

image

Rejected

image

Pricing tile styling

Just a few notes that we should discuss and agree on (that's all minor to be honest, it's already it a pretty good state)

  • there is a gap at the bottom of the tile for the scatter chart, I think we should decide if we want it always visible
  • Currency pair symbol should be formatted (EUR / USD instead of EURUSD)
  • vertically center prices (currently bottom aligned)
  • notional formatting is better in your version I think (formatted)
  • we should remove the line bellow the notional but show some visual feedback when we mouse over (see WPF version for that, I've put a screenshot bellow)
  • we might want to review the gradients for price mouse over, trade done and trade rejected states

New Reactivbe trader
image

Previous design (WPF)
image

Mouse over notional box
image

Setup SSL on nginx

SSL should be enabled on all environments and terminated at the nginx level

http 80
ws 8080 redirects to ws 8080

https 443
wss 443 redirects to ws 8080

Binary serialisation

  • evaluate the different options (I'd suggest looking at MsgPack and Google Protocol buffers probably first). There might be other options in JavaScript browser..?
  • we want to know how much smaller the messages are (vs JSON)
  • we want to know the performance impacts (write or find some micro benchmarks)
  • consider also available platforms (it needs to support at least JavaScript, JVM, .NET)
  • once the solution is decided, implement the preferred options in reactive trader

OpenFin needs to be abstracted away

There is a lot of code that does things like this:

    this.fin && this.fin.close();

We should abstract Openfin away and just talk to some interface.

Backend folder cleanup

  • remove any dead code / unused folders, files
  • cleanup project.json files
  • used fixed version for dependencies

Analytics panel does not look finished

Compared to the previous version:

  • no legend on the chat (x axis should show the time)
  • the chart was green when > 0 and red when <= 0
  • please keep the style as close as possible to the old one (no black line / panel delimiter, same section titles, etc)
  • the bars at the bottom look huge when there are only a few positions
  • previously the bars where looking red / green following the same pattern (red < 0, green > 0)
  • positions notional (in black) overlays with the labels. The notional are normally displayed when you mouse over the corresponding bars (see link to previous version).
    --> it looks like the control used to display positions does not work for our use case, could we just implement it in html/css like it was before (it works fine and looks a lot better)
  • Format 'Profit & Loss' total with thousand separators (or even shorten to "1.3m"/"555k"

image

the old verion looks a lot better, could we try to replicate the styles?

image

Notify user when the system is not behaving normally

nginx failure / Broker failure

  • connection indicator goes red
  • same logic as if all service went down (see bellow: reference data + pricer + execution + blotter + analytics)

reference data service failure

  • the indicator for the corresponding service goes red
  • nothing else changes

pricer failure

  • the indicator for the corresponding service goes red
  • all pricing tiles go to disconnected mode
  • prices are cleared (no price at all or just a '-')

execution service failure

  • the indicator for the corresponding service goes red
  • pricing tiles stay the same visually but on mouse over there is an indication that you can't trade

blotter

  • the indicator for the corresponding service goes red
  • in the header of the blotter indicates that the blotter is disconnected

analytics

  • the indicator for the corresponding service goes red
  • in the header of the analytics pannel indicates that the analytics are disconnected

event store

  • execution will become unavailable (the UI should have nothing to do, it's exactly like if execution service was down)
  • in the header of the blotter indicates that the blotter is disconnected
  • in the header of the analytics pannel indicates that the analytics are disconnected

Disconnect the client after 15 minutes

We need to automatically disconnect the client after 15min to make sure we don't have users leaving a tab open for 6 months, which can significantly increase the hosting bill.

Also provide a link to reconnect (reload the page is fine)

This is what RT1 looks like when this happens:

image

Multi broker deployment

Manage muliple brokers:

  • client to select a broker a startup
  • handle failover after several connection retries

Implement analytics panel

Before starting

  • agree DTOs with backend implementer (should be the same as previous reactive trader)
  • agree chart component to use (currently ChartIQ, I'll check if we want to use that in this version)

PnL view

image

Positions view
image

Port the client side transport to .NET (PCL)

This is the first step to get the WPF and Xamarin (iOS, Android, iWatch) versions ported across.

You should probably port the WPF client across when you do that, to make sure this is working. We don't expect the WPF client to support all the failure scenarios (it should just work with happy paths).

Frontend support for WSS

When running under https, the client should connect to /wws, not /ws

http 80
ws 8080

https 443
wws 443

Improve Launcher parameters to be more consistent and readable

Current we have the launcher parameters of:

dnx run a b exec p ref es mb init-es

This currently corresponds to:

a: analytics service
b: blotter service
exec: execution service
p: pricing service
ref: reference data service (read)
es: embedded event store
mb: embedded message broker
init-es: populates the event store with dummy data

We need to make them more consistent and descriptive.

Reduce Build times

Current build times for the client are > 6 minutes.

Some thoughts:

  1. This is very long
  2. Do we need the entire container infrastructure just to build, run unit tests?
  3. Can we split out another build that is just the day to day dev builds so we get quick feedback?
  4. Surely CircleCI allows us to build on pre-ready machines (ones with npm and node already installed)

Overall application style vs old reactive trader

I think the app looks too dark and David (the designer who did the initial visual design) had the good idea to put the blotter in white. Also David's design did not use any gradient and everything was flat. If you open both apps side by side you will see that the new app looks A LOT more noisy that it used to be (it looks like a lot more stuff is being displayed, which is not the case).

Here is the link to the previous version: http://adaptiveconsulting.github.io/ReactiveTraderJS/

The design was not correctly implement (the WPF is the closest one from the design), I

Overall I would be in favour of bringing the design closer to what it was before in a few aspects:

  • the layout of the tile is fine I think (better than in the previous reactive trader web version), but the spark line adds too much noise, I would go crazy if I had to look at this all day. I would suggest to remove them
  • the mouse over should not use gradients, let's use the same style as before
  • remove the animation on trade done and remove the gradients on the trade done tile
  • when the tile is in error state use the same style as before (orange tile), see EURJPY trade on old version
  • I think we also should style the blotter as it was before (white instead of dark)

Implement Analytics backend

The analytics backend needs to

  • read all trades from event store
  • read prices from crossbar (maybe we just want the pricing service to publish all prices on a well known topic that the analytics service can subscribe to? design to be discussed)
  • compute positions and PnL for the past X minutes (should be configurable in the service, just apply the same as in the old backend) - the logic should be identical to the old service
  • publish a state of the world on each tick (I believe we were publishing that every 10sec)

DTOs should be discussed and agreed with Dimitar first to facilitate integration (btw they should be the same as previous reactive trader).

Review the linux installation docs

Please review the Linux install docs, I think it could be simplified:

  • do we really need to install EventStore and Crossbar on Linux?
  • could we just run the launcher with dnx run dev instead?

adding @qooroo and @JPWatson since they were also working on linux.

UI folder cleanup

  • UI folders cleanup (remove any dead code, dead resources, etc)
  • package.json cleanup
  • use fixed version dependencies

Blotter formatting

ID - OK
Date - change format (see picture)
Dir - should be in bold
CCY - format (EUR / USD), should be in bold
Notional - OK, should be in bold
Rate - should be in bold
Status - OK
Value Date - update format (see picture)
Trader - OK

image

Improve readme

Proposed structure

  • overview of the project, the architecture and the different components
  • how to setup a dev environment (without docker)
  • how to run everything locally with docker
  • how to create a Kubernetes cluster and deploy the app

Would be good if you can:

  • validate that the procedures actually work (windows and ubuntu)
  • try to minimise the number of steps
  • I believe @tdeheurles put together quite a few scripts in the /deploy folder, check with him what is available please

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.