1 of 10

TradeML

A taste of the cryptocurrency market

Jiaxuan Zhang, Chuheng Hu

2 of 10

What’s happening?

3 of 10

TradeML – BitCoin trading simulation

TradeML is a full-stack web app with a full-fledged Rescript React frontend and OCaml Dream backend. We created a simulation game where the user gets to hypothetically trade Bitcoin from a wallet, together with frontend interface including trading functionalities and visualization of recent transactions, e.g., changes in total assets and Bitcoin prices.

With the latest historical data of Bitcoin prices and related financial signals (e.g. volume), we built a deep neural time series forecasting model for Bitcoin price using stacked stateless Long-Short Term Memory (LSTM). Using the predicted near-future price to facilitate the decision and trade with real-time price.

4 of 10

Design & Architecture

  • Backend : OCaml
  • Frontend : ReScript (“JavaScript in OCaml”)
  • Forecasting : Python training -> Torch Script -> Load & Inference in OCaml
  • Database : PostgreSQL

5 of 10

Bitcoin price forecaster

Dashboard

6 of 10

Analytics (visualization)

7 of 10

Lines of Code

Frontend:

  • .res files ~ 1250 lines of code

Backend:

  • .ml files ~ 850 lines of code
  • .mli files ~ 180 lines of code

Model Training:

  • Python ~ 130 lines of code

Total ~ 2400 lines of code

8 of 10

Demo

9 of 10

Summary

Current work:

  • Backend server in OCaml (Dream server), including Game, DB, Forecasting, Visualization modules and data processing functions.

  • Frontend in Rescript, powered by Rescript React, a visually stunning, fully custom UI written from scratch. Works by calling endpoints exposed on the backend server.

  • Decoupled the forecasting model training and inference, giving the user the flexibility of plugging in their own model

10 of 10

Summary

Future work:

  • Improve the forecasting model with better factors (feature engineering) and fine tuning
  • Support multiple cryptocurrencies besides BTC-USDT
  • Add a real-time streaming feature to frontend
  • Provide inference for customized automated algorithmic trading