Git Product home page Git Product logo

btc's Introduction

Bitso cryptocurrency exchange client

This project has as objective shows how to connect to the websocket and web service of Bitso cryptocurrency exchange using rxjava as a implementation of observer pattern and manipulates the data in real time.

The first window that you can see it's of the loading, works as a splash screen, while the app start.

1

After load, the app shows the next window

1

The UI is composed for 5 important parts.

  1. Header, where we can to stop all the connections and close the application

1

  1. Ticks, allows to see the actual upticks and downticks

1

  1. The best orders values (Bids and Asks)

1

  1. The buy and sell of BTC into the application (simulation)

4

  1. Recent trades

5

Configurations

The X best bids, best asks and recent trades

1

Consecutive M upticks and N downticks

1

build it! the project with maven ๐Ÿ‘

git clone https://github.com/haroldjcastillo/btc.git
cd btc
mvn clean install && java -jar btc-ui/target/btc-ui-0.0.1.jar

HTTP Configuration

It's posible to configure the HTTP connection, request and socket timeout in the file /btc/config/pooling.json

{
	"connectTimeout": 15000,
	"connectionRequestTimeout": 30000,
	"defaultMaxPerRoute": 20,
	"httpHost": [
		{
			"hostName": "api.bitso.com",
			"port": 808
		}
	],
	"maxTotal": 100,
	"socketTimeout": 15000
}

Additional notes:

  • The http request for query the trades it's called each 1 second.
  • In each Sell or Buy the ticks counter it's restarted.
  • By default the X value it's 10 and M and N it's 2

Checklist

Feature File name Method name
Schedule the polling of trades over REST. ScheduleHttp start()
Request a book snapshot over REST. OrderController loadCurrentOrders()
Listen for diff-orders over websocket. OrderObserver onNext(java.lang.String)
Replay diff-orders. OrderManager diffOrder(java.lang.String)
Use config option X to request recent trades. TradeManager addRecentTrade(com.github.haroldjcastillo.btc.dao.TradePayloadResponse)
Use config option X to limit number of ASKs displayed in UI. OrderManager toSortBook(javafx.collections.ObservableList, List)
The loop that causes the trading algorithm to reevaluate. OrderManager diffOrder(java.lang.String)

btc's People

Contributors

haroldjcastillo avatar

Watchers

 avatar  avatar  avatar

btc's Issues

FXML LoadException on startup

@haroldjcastillo do you know what is causing this?

16:21:55.221 [JavaFX Application Thread] ERROR com.github.haroldjcastillo.btc.ui.SplashController -
file:/home/marvin/code/lib/programming-challenges/HaroldCastillo/btc/btc-ui/target/btc-ui-0.0.1.jar!/fxml/orders.fxml
file:/home/marvin/code/lib/programming-challenges/HaroldCastillo/btc/btc-ui/target/btc-ui-0.0.1.jar!/fxml/main.fxml:21

javafx.fxml.LoadException:
file:/home/marvin/code/lib/programming-challenges/HaroldCastillo/btc/btc-ui/target/btc-ui-0.0.1.jar!/fxml/orders.fxml
file:/home/marvin/code/lib/programming-challenges/HaroldCastillo/btc/btc-ui/target/btc-ui-0.0.1.jar!/fxml/main.fxml:21

at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601) ~[jfxrt.jar:?]
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2571) ~[jfxrt.jar:?]
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441) ~[jfxrt.jar:?]
at javafx.fxml.FXMLLoader.access$2700(FXMLLoader.java:103) ~[jfxrt.jar:?]
at javafx.fxml.FXMLLoader$IncludeElement.constructValue(FXMLLoader.java:1143) ~[jfxrt.jar:?]
at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:746) ~[jfxrt.jar:?]
at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2707) ~[jfxrt.jar:?]
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527) ~[jfxrt.jar:?]
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441) ~[jfxrt.jar:?]
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3214) ~[jfxrt.jar:?]
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175) ~[jfxrt.jar:?]
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148) ~[jfxrt.jar:?]
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124) ~[jfxrt.jar:?]
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104) ~[jfxrt.jar:?]
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097) ~[jfxrt.jar:?]
at com.github.haroldjcastillo.btc.ui.SplashController$SplashScreen$1.run(SplashController.java:39) ~[btc-ui-0.0.1.jar:?]
at com.sun.javafx.application.PlatformImpl.lambda$null$117(PlatformImpl.java:295) ~[jfxrt.jar:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_151]
at com.sun.javafx.application.PlatformImpl.lambda$runLater$118(PlatformImpl.java:294) ~[jfxrt.jar:?]
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) ~[jfxrt.jar:?]
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) ~[jfxrt.jar:?]
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$450(GtkApplication.java:139) ~[jfxrt.jar:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]

Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) ~[?:1.8.0_151]
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) ~[?:1.8.0_151]
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2566) ~[jfxrt.jar:?]
... 21 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.github.haroldjcastillo.business.http.ExecutorService
at com.github.haroldjcastillo.btc.ui.OrderController.loadCurrentOrders(OrderController.java:90) ~[btc-ui-0.0.1.jar:?]
at com.github.haroldjcastillo.btc.ui.OrderController.access$100(OrderController.java:19) ~[btc-ui-0.0.1.jar:?]
at com.github.haroldjcastillo.btc.ui.OrderController$1.run(OrderController.java:69) ~[btc-ui-0.0.1.jar:?]
at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_151]
at com.github.haroldjcastillo.btc.ui.OrderController.initialize(OrderController.java:61) ~[btc-ui-0.0.1.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) ~[?:1.8.0_151]
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) ~[?:1.8.0_151]
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2566) ~[jfxrt.jar:?]
... 21 more

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.