Code Monkey home page Code Monkey logo

crypto-index-fund's Introduction

Crypto Index Fund API

Crypto Indexing is a passive investing strategy, and this is my attempt to hack an investing system together. This very basic system lists the top 5 cryptocurrencies to include in the portfolio according to an equi-weighted strategy.

I have attempted to avoid the market-cap bias by using data provided by the amazing CoinGecko.com. The idea is to achieve a Value Investing-styled strategy by trying to assess the overall quality of a coin.

CoinGecko.com does an outstanding job of ranking a cryptocurrency in a wholistic fashion by taking into account metrics like Development, Community Interactions, and a Publicity Score.

Output

{
  "0": {
    "coinSymbol": "BTC",
    "averageVolatility": -1.6326956521739127
  },
  "1": {
    "coinSymbol": "ETH",
    "averageVolatility": -3.1893043478260865
  },
  "2": {
    "coinSymbol": "EOS",
    "averageVolatility": -2.628086956521738
  },
  "3": {
    "coinSymbol": "XRP",
    "averageVolatility": -1.9188695652173906
  },
  "4": {
    "coinSymbol": "LTC",
    "averageVolatility": -2.220526315789474
  }
}

Why build something like this?

This is a simple experiment that I find interesting, and is by no means the best or the most scientific investing strategy available. I built this since I did not find any sufficiently open, self-service passive investing system.

Disclaimer

I developed this for my personal use, and have been using the API to invest a very minor amount in cryptocurrencies. While I have been using it personally, I am no financial expert! Please use with caution.

Architecture

The system consists of 2 micro-services:

  • crypto-scrapers : This is a Python-based scrapy project that crawls [CoinGecko.com] and persists the data through SQLAlchemy
  • crypto-indexing: This is a Kotlin-based Spring Boot microservice that serves as the API for the crypto-fund

Installation

  • Build and run the cryto-scrapers, and run the docker command in crontab with an hourly frequency
  • Run the crypto-indexing API, and hit /api/index on the exposed port to fetch the fund after the scraper has run.

Docker

Crypto-scrapers:

docker pull chnsh/crypto-scrapers [Hourly cron]
docker run -e "DB_USER=USER" -e "DB_PASS=PASS "DB_HOST=HOST" crypto-scrapers scrapy crawl coin_gecko

Crypto-indexing:

docker pull chnsh/crypto-indexing-api
docker run -e "SPRING_DATASOURCE_URL=JDBC_URL" -e "SPRING_DATASOURCE_USERNAME=USER" -e "SPRING_DATASOURCE_PASSWORD=PASS" -p 8080:8080 -d crypto-indexing-api

Development

Want to contribute? Great! Feel free to send a request

Todos

  • Use the coingecko API instead of scraping
  • Improve build and deployment workflow
  • Write MORE Tests
  • Price prediction models that helps to decide the exact time to invest
  • Automated order placing service that takes the output of the crypto-indexing API and places an order with any exchange of choice

License

MIT

crypto-index-fund's People

Contributors

chnsh avatar

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.