project screenshot 1
project screenshot 2
project screenshot 3

PortfolioOptimiser

An app to balance risk and return of your crypto portfolio, with a UI to configure your preferences

PortfolioOptimiser

Created At

ETHGlobal London

Project Description

This project using convex optimisation (a technique which underpins a lot of machine learning) to recommend a crypto portfolio allocation that maximises return, while meeting the user's inputted constraints in relation to risk tolerance and preferred asset categories (based on ecosystem and use-case).

The UI has a sidebar with some high level options, users can just select these and quickly generate a portfolio recommendation. The user can also set detailed allocation constraints on the main panel of options - if they want to make sure the optimiser includes certain assets that the user already holds they can set minimum allocations, or if there are particular assets of ecosystems they do not want to invest in they can set the maximum allocation to zero.

This app is aimed at low frequency traders who want to develop their own portfolio and re-allocate at most once a week, or who want to play around with creating a custom index fund that tracks the ecosystems and use-cases that they care about.

How it's Made

The app is entirely built in Python. Streamlit is the framework for building the app, and also how it is hosted. The backend uses pandas for data processing, and cvxpy to run the optimisation and generate the final portfolio recommendation.

Price data from Coingecko is used to estimate risk and return, as well as group each crypto asset into categories to allow the user to tailor the allocation to their interests. I was initially going to have the data be live updating, however due to time constraints I decided to focus on shipping a workable MVP with static data for now, which is a bit hacky. Having a live update would be future work and a fairly easy extension.

In terms of data source I had initially looked at both powerloom.io and gizatech.xyz. Ideally this app would be on-chain.

I had initially planned to use the dataset from powerloom.io or gizatech.xyz for price info, but the data wasn't quite what I needed, and also didn't much metadata on assets, so I went with Coingecko instead since it had everything I need. I would like to extend this app to also use other data sources, especially the yields from pools. It would also be cool to experiment with zkml as well if there was a more complex proprietary model being run in the backend.

background image mobile

Join the mailing list

Get the latest news and updates