Skip to content

haroldjcastillo/btc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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)