w-i-l / WealthWave

A full stack app for stock market developed at a hackathon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WealthWave

Our product for Smarthack2023 x Veridion

Screenshot 2023-11-14 at 14 28 19-min

About it

This product was made for the Veridion challenge hosted in the Smarthack 2023 edition - ASMI's 24h hackathon.

The main request for this project was to use the base Veridion APIs:

And build on top of them an app that utilises the big data resources received.

Our team decided to build a product that helps people manage their finances and make better decisions regarding their money, by presenting the best companies to invest in, based on economic, geographic and stock history data.

The final product is an IOS app that uses the Veridion APIs, got from a Flask RestAPI server, to get the data and a custom layered algorithm to process it and present it in a user-friendly way.

The roles distribution will be presented in the Roles section of this document.

Team members:



How to use it

Note! The API keys for OpenAI and Veridion are not provided in this bundle.

The code has 3 major parts:

For each one you must check for some requirements before running the code.

IOS app

For the IOS app you must have Xcode installed on your machine and a minium IOS 16.4. All other dependencies are provided with Swift Package Manager.

RestAPI server

For the RestAPI server you must have Python 3.9 installed on your machine and the following dependencies:

  • Flask
  • Flask-Cors
  • requests
  • bs4
  • pyppeteer
  • pyppeteer_stealth
  • pycountry
  • json
  • multiprocessing
  • concurrent.futures
  • openAI
  • googlesearch

For simplicity just run the following command in your terminal:

pip3 install Flask Flask-Cors requests beautifulsoup4 pyppeteer pyppeteer_stealth pycountry openai googlesearch-python

ARMA & Dense models

Just like above you need at least Python 3.9 version and the following dependencies:

  • keras
  • numpy
  • requests
  • sympy
  • yfinance
  • statsmodels
  • scikit-learn

The following command will install all the dependencies:

pip3 install keras numpy requests sympy yfinance statsmodels scikit-learn

After installing all the dependencies, just start the server and then the app. All should work just fine. Just note that the app is configured so you can use it from the simulator, as long as the server is run from the same pc. To change this you will need to modify the URL from the API files from here.



How it works

  1. Classifying the countries
  2. Using the pycountry module we get all the countries around the world. Then we search for the economic indicators for each one founded on S&P website. We multiply the indicators with custom weights and rank each one. A lower number means an unstable market, while a big rank represents a steady one.

  3. Choosing an activity domain
  4. Calling the OpenAI API with a chosen country will return the top 5 activity domain, best suited for investment.

  5. Showing companies
  6. For those companies that are publicly listed on the stock market, we get a sustainability score that ranks them and help us filter the best one.



Tech specs

For the country selection we chose to save the crawled data, for faster response. Also because of the time limit we couldn't parse the reactive context of the S&P website, so we chose to go for the cached version from the CachedView.

We tried to optimize the server processing by using a multiprocessing technique, but couldn't integrate with the Flask environment in time.

The simplified scheme for data flow is better illustrated below:

Screenshot 2023-11-14 at 14 55 54-min

For estimating the behaviour of public and private companies we used public companies stocks graph data to train an ARMA model. Then, we trained a neural network to be able to generate roughly the same ARMA model, but using only data provided by the API. After training this model we are able to generate an ARMA model for private companies by using our neural network and the data provided by the API. Why is this important? Well, remember that the ARMA model is in close relation with the stocks graph, therefore we can say that we "generated a graph" for private companies.



Roles

  • Bodgan Toma
  • Built and trained the ARMA & Dense models for estimating the behavior of both public and private companies

  • Ana-Maria Varban
  • Designed the UI in Figma, OpenAI API calls and integration with Veridion APIs

  • Alexia Aldea
  • Development of the IOS application, using MVVM architecture

  • Ocnaru Mihai
  • Coded a custom web scrapper, a Flask server and integrated it with the IOS app.

About

A full stack app for stock market developed at a hackathon

License:MIT License


Languages

Language:Swift 76.0%Language:Python 24.0%