Skip to content

Latest commit

 

History

History
159 lines (135 loc) · 12.2 KB

README.md

File metadata and controls

159 lines (135 loc) · 12.2 KB

Trading simultor app

Table of contents

  1. About this app.
  2. Main concepts of the app.
  3. Features to be implemented
  4. Technologies used
  5. How to install

1. About this app

This is a trading app which allows you to simulate crypto trading with fake money. The main idea of the app is to permit customer to learn trading crypto. Crypto trading is extremely dangerous for new retail investors and most of them come to this area with lack of knowledge how volatile this market is. Therefore, this trading app provides functionality to simulate trading(deposit USD, buying/sell crypto) and gain a sense of how volatile crypto market is.

This version of the app consists of the main and most valuable functionalities/features. New features are being developed and the app is being improved utilizing the cutting-edge technologies.

2. Main parts of the app

It is single activity and multiple fragment app consisting of three main screens: watch list, profile and crypto details screen.

2.1. Watch list screen

Watchlist is the main launching screen comprised of top 30 crypto list elements and each of the element consists of slug, symbol, price, and 24h precent and price change.
Main functionality points:

  • Crypto list is represented in a recyclerView
  • Prices are fetched from binance api(only 1 request is performed), while icons are loaded from cryptologos.cc.
  • Loader is shown while prices are being fetched
  • The prices are being updated utilizing websocket connection to binance server.
  • Pull-to-refresh is implemented. It refetches all crypto list.
  • There are 2 sorting options: by name, by price change.
  • One filter option - extract favourite list
  • Sort and filter preferences are stored in datastore and retreived when app is relaunched.

List sort and filtration Pull to refresh Loader
allList pullToRefresh loader

2.2. Single crypto screen

Single crypto screen represents 3 tabs: crypto chart, price statistics(last 24h data, ROI etc) and project description. There is a favourite toggle button on the top which saves crypto to room or removes it.


2.2.1.Chart screen tab

This tab is the main single crypto screen which shows the recent crypto price info, candle chart and buy,sell buttons.
Main functionality points:

  • Header info(latest price, and price change) is collected from websocket.
  • Price chart is a custom view where crypto chart data is transfered to candle chart(no libraries used).
  • Candle chart listens to long presses and show price, date, prace change of that candle if pressed for at least 0.25s.
  • Price chart data is fetched from messari.io api and passed to this view. It contains 4 options of date range(last 1/3/6/12 months).
  • Buy buttom opens dialog in order to execute crypto purchase. This dialog shows the current crypto price, USD balance, input field
  • Sell buttom opens dialog in order to execute crypto sell.
  • Input price is validated and customer is notified if input is invalid by showing message below input field.
  • Transaction is executed only when confirmed clicked on confirmation dialog.

1 month(daily candle) 3 months(daily candle) 6 months(weekly candle) 12 months(weekly candle)

Buy dialog Sell dialog

Empty message Insufficient balance message Price too low message Valid input(no message)

2.2.2.Price statistics tab

Price statistics tab represents essential statistics points such as market dominance, 1h/24h volume, ATH data, ROI and others.
Main functionality points:

  • Header of this screen comprises of immutable data. Icon, latest price stats(latest price, 24h/change), market dominance, market cap, 1h/24h volume.
  • Content area consists of 4 expandable cards: last 1h/24h data(high, low, open, close, volume), ATH data(price, date, days since, perecent down), ROI data(return on investment).

    .

2.2.3.Project description tab

Description tab simply shows Project info and pre-history of the coin. Data comes from messari api.

2.3. Profile screen

Profile screen contains 2 tabs portfolio and transaction history tabs.

2.3.1.Portfolio tab

Portfolio tab comprises of 3 parts: total balance and chart, button area(), crypto list.
Main functionality points:

  • Crypto portfolio the data comes from room local databse and prices from binance api.
  • On viewModel init chart data is calculated by making requests from binance to get live prices and calculates crypto balances in usd.
  • Maximum crypto elements in chart are 6. If exceeded, 5 are shown and the rest is labelled as others.
  • If no crypto is present, chart is empty and message of "Deposit to begin trading" insead of recycler view.
  • Deposit button opens dialog where customer is allowed to deposit US dollars.
  • Reset balance button simply resets all data by erasing all portfolio data.
  • Cryto list below button area is created using recyclerView. It contains couple viewHolders: header and crypto element.
  • Confrimation dialog are shown on deposit or reset balance click.
  • Transaction is executed only dialogs are confirmed.



Whole screen Empty crypto list Deposit&reset balance usecase



Chart different cases

Empty chart Item count <= 5 Item count > 5

2.3.2.Transaction tab

This tab shows a list of executed transactions stored in room database.
Main functionality points:

  • Whole screen is a single recyclerView consisting 3 different viewHolders: header, deposit and purchase/sell holders.
  • On init the list is fetched from local database and inserted into recyclerView.
  • Message of "No transactions yet" is displayed if list is empty.
  • Header contains title and erase button which erases all list. It contains confirmation dialog in case of missclick.
  • Each element contains symbol, slug, icon, date, amount, amount in usd, last price.

Whole transaction page OnEraseAllTransactions

3. Future features

  • ✔️ Main watchlist sorting by name, by price change.
  • Registration with google account.
  • ✔️ Implementing favourites list.
  • ✔️ Confirmation dialgos such as confirm purchase, confirm deposit etc.
  • ✔️ Sort portfolio list
  • Balance change over time screen to track how your crypto list changed over time.

4. Technologies used

  • IDE's, app debuggers
    • Android Studio - it was chosen as development environment since it is the official integrated development environment (IDE) for Google's Android operating system. Kotlin was chosen as a language(google preferred langugage is kotlin instead of java since 2019).
    • Flipper - it has been used as a platform for debugging Android app, check network requests, observe room database, shared-preferences etc.
  • Android specific
    • Hilt DI - a technique widely used in OOP for better reusability, ease of refactoring and ease of testing has been utilized with hilt.
    • Glide - fast and efficient open source media management and image loading framework for Android has been applied for icon fetching and catching.
    • RecyclerView - effiecient way of displaying large sets of data. Single and multi-type viewHolder recycler views has been utilized in the project.
    • Navigation - bottom multistack navigation was accomplished in this app by creating couple graphs and implementing in a parent nav_graph.
    • MVVM architecture - a pattern that suggests separating the data presentation logic(Views or UI) from the core business logic part of the application.
    • Shared preferences - key-value pairs has been used in the early version of the app but now they are removed and replaced with room.
    • Room - a local database designated to store data on your phone has been used for saving crypto porftolio and transaction history.
    • Retrofit with OKHTTP
    • Websocket - a persistent connection between a client and server which provides full-duplex communication channels over a single TCP connection. It was uesd for live crypto data fetching.
    • Data store was utilized to store filter and sort preferences.

5. How to install?

The app has not been released to google play yet, but it will be released in near future.

The only way to to launch this app is to clone this repo and build project using Android studio or from CMD.