project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

CryptoMPT

CryptoMPT - A Solidity Implementation of Modern Portfolio Theory (MPT)

CryptoMPT

Created At

ETHGlobal Bangkok

Winner of

Blockscout - Blockscout Explorer Big Pool Prize

Prize Pool

Flare Network - Best Usecase of Flare's enshrined Data Protocols 2nd place

Bitkub - Best KUB Coin Utilization 2nd place

Project Description

Modern Portfolio Theory (MPT) is a mathematical framework used to optimize investments by balancing risk and return. MPT suggests how to allocate assets in a portfolio to achieve maximum returns for a given level of risk or minimize risk for a desired level of return. The Sharpe ratio is often used as a metric for performance in this context, representing the return-to-risk efficiency of a portfolio.

This smart contract enables storing and retrieving weekly portfolio data for multiple crypto assets, allowing for a structured record of allocations and their associated metrics like yield, volatility, and Sharpe ratio. The contract ensures only the owner can update the data, making it suitable for decentralized financial (DeFi) applications.

How it's Made

The project comprises of 3 mains parts:

The first uses an on-chain oracle (ChainLink) to extract historical pricing data. This step is not super trivial since this step required a couple of binary searches to find the round_ids for a certain time frame. This data then needed to be standardized and holes filled in.

Once we have enough data to calculate variance and correlations between assets, we can model how they should interact together and create portfolios that provide certain trade-offs between risk and reward.

We then select the portfolio with the best Sharpe Ratio (i.e. highest risk adjusted return) and make it available on a variety of chains so that this information can be used as building block for other DeFi operations.

background image mobile

Join the mailing list

Get the latest news and updates