<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Ambrose Ikpele</title>
    <description>The latest articles on Forem by Ambrose Ikpele (@ambroseikpele).</description>
    <link>https://forem.com/ambroseikpele</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F690473%2Fc9a2ea25-b2c6-4724-95b1-426fdda6cb5c.jpeg</url>
      <title>Forem: Ambrose Ikpele</title>
      <link>https://forem.com/ambroseikpele</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ambroseikpele"/>
    <language>en</language>
    <item>
      <title>How Risky Is Binance CMC Cryptocurrency Top 10 Equal-Weighted index? A Comparison with Modern Portfolio Theory</title>
      <dc:creator>Ambrose Ikpele</dc:creator>
      <pubDate>Fri, 01 Dec 2023 05:54:29 +0000</pubDate>
      <link>https://forem.com/ambroseikpele/how-risky-is-binance-cmc-cryptocurrency-top-10-equal-weighted-index-a-comparison-with-modern-portfolio-theory-337j</link>
      <guid>https://forem.com/ambroseikpele/how-risky-is-binance-cmc-cryptocurrency-top-10-equal-weighted-index-a-comparison-with-modern-portfolio-theory-337j</guid>
      <description>&lt;p&gt;Cryptocurrencies have taken the financial world by storm, offering a new asset class that promises high returns but also comes with high volatility. Binance , one of the world’s leading cryptocurrency exchanges, introduced the CoinMarketCap Cryptocurrency Top 10 Equal-Weighted Index(about a year ago). But how risky is this index? Let’s delve into it and compare its risk level with the results from Modern Portfolio Theory (MPT).&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the Binance CMC Cryptocurrency Top 10 Equal-Weighted index?
&lt;/h2&gt;

&lt;p&gt;According to the &lt;a href="https://www.binance.com/en/ew-index" rel="noopener noreferrer"&gt;Binance Website&lt;/a&gt;, Binance CoinMarketCap (CMC) Top 10 Equal-Weighted Index aims to track the performance of the top 10 eligible digital assets by market capitalization. The index assigns a 10% weight to every asset in it. The index is maintained and rebalanced monthly. For a detailed explanation about the index visit the &lt;a href="https://www.binance.com/en/index-methodology" rel="noopener noreferrer"&gt;official website&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Modern Portfolio Theory (MPT) at a glance
&lt;/h2&gt;

&lt;p&gt;Introduced by Harry Markowitz in 1952, the Modern Portfolio Theory (MPT) is a framework for constructing portfolios that maximize expected return for a given level of risk. MPT emphasizes the benefits of diversification, suggesting that an investor can reduce portfolio risk by combining assets that are not perfectly correlated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Risk Level of Binance CMC Cryptocurrency Top 10 Equal-Weighted Index
&lt;/h2&gt;

&lt;p&gt;Portfolio Risk is measured by the standard deviation/variance of portfolio return over time and is also referred to as portfolio volatility, this method of standard deviation/variance takes into account the relationship between assets in the portfolio and is given by the equation;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc9vvvcrp2j6g3tvn5plt.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc9vvvcrp2j6g3tvn5plt.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
where;&lt;br&gt;
𝜎² = portfolio variance&lt;br&gt;
𝜎= portfolio standard deviation&lt;br&gt;
w= the weights of the assets in the portfolio&lt;br&gt;
w^T = Tranpose of the weights of the assets in the portfolio.&lt;br&gt;
Cov= the covariance of the returns of the assets in the portfolio, this tells us how the assets in the portfolio are related to each other.&lt;/p&gt;

&lt;h3&gt;
  
  
  Calculating The Risk Level Of Binance CMC Cryptocurrency Top 10 Equal-Weighted index
&lt;/h3&gt;

&lt;p&gt;For us to quantify the risk of the equally weighted index we need to consider the fact that Binance rebalances the index monthly, there by removing and adding some cryptocurrencies. But there are some coins that have stayed in the index far longer than others since the index was created, as we can see&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fomhxu993h6powkfugqwc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fomhxu993h6powkfugqwc.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
we select the top 10 most occurring currencies; since they have constituted the index most of the time.&lt;br&gt;
Next, in order to calculate the risk level of the index, we get daily data starting from when Binance published the index to the beginning of the present month i.e 2022/09/22 to 2023/09/01 using the yahoo finance api in python&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

import yfinance as yf
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

top_crypto= ['ADA-USD', 'BNB-USD', 'BTC', 'DOT-USD', 'ETH-USD', 'LTC-USD','MATIC-USD', 'SOL-USD', 'TRX-USD', 'XRP-USD']
data=yf.download(top_crypto, start='2022-09-22', end='2023-09-01', interval='1d')
data.head()


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmfa4fzno8djj70rtu1ny.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmfa4fzno8djj70rtu1ny.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
We have seen that in order to calculate the risk of a portfolio, we need the weights (w) of the currencies and covariance (cov) of returns; since the index is equally weighted the weights (w) = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]. The code below allows us to get the covariance of returns&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

### calculate the daily returns on each asset
portfolio_daily_returns= data.Close.pct_change().dropna()

##### calculate the annualized covariance of the daily returns
covariance = portfolio_daily_returns.cov()*365
covariance


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmn668qvagj4txcf8q4lq.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmn668qvagj4txcf8q4lq.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
we have all we need to calculate the risk of the portfolio (weights and covariance). we implement this calculation in the code below&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

### calculate the volatility of the portfolio 
weights_equal = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1] # from binance equal weight
weights_equal= np.array(weights_equal)

equal_weight_portfolio_variance = np.transpose(weights_equal) @ covariance @ weights_equal

equal_weight_portfolio_volatility = np.sqrt(equal_weight_portfolio_variance)
equal_weight_portfolio_volatility= round(equal_weight_portfolio_volatility*100, 2)
print('Risk Level: ', equal_weight_portfolio_volatility, '%')


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F74d092wwtqa5h8y0sx2n.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F74d092wwtqa5h8y0sx2n.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
Now we know the risk level of the index, you may be wondering what amount of reward does this level of risk brings? In order to answer that, let’s look at the expected annual return&lt;/p&gt;

&lt;h5&gt;
  
  
  Calculating The Expected Return Of Binance CMC Cryptocurrency Top 10 Equal-Weighted index.
&lt;/h5&gt;

&lt;p&gt;The returns of the portfolio is calculated using the below formula (each r represents the daily return of the portfolio)&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fex7d7jnhof56qh6tdk1y.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fex7d7jnhof56qh6tdk1y.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
In order to get the daily return (r) of the portfolio we multiply each asset’s daily return by it weight in the index and sum it up as shown in the code&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

### each asset's daily return
assets_daily_returns= data.Close.pct_change().dropna()

### multiply each asset's daily return by it weight in the index
r =assets_daily_returns.mul(weights_equal, axis=1).sum(axis=1) # dot product
r


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;we have the daily return of the portfolio saved in variable r, next we implement expected annual return formula&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

annual_return= r.mean()*365*100
annual_return= round(annual_return, 2)
print('Expected Reward:', annual_return, '%')


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0xp8u7mw6oiv9n7hk9tq.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0xp8u7mw6oiv9n7hk9tq.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
We have seen that the index has a risk level of 54.82% and an annual expected return of 10.8%. Are there ways we can adjust the weights of the index to give a minimal risk level and how efficient is this portfolio?&lt;/p&gt;

&lt;h2&gt;
  
  
  Deriving A Minimal Variance Portfolio Using Modern Portfolio Theory
&lt;/h2&gt;

&lt;p&gt;Applying MPT, we get different weights of the cryptocurrencies and the respective risk and expected reward of these weights. These respective risk and reward gotten from these different weights is graphed to give rise to what is called the Efficient Frontier&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

from pypfopt import EfficientFrontier
from pypfopt import CovarianceShrinkage, CLA, expected_returns

prices= data.Close
portfolio_expected_returns=  expected_returns.mean_historical_return(prices, frequency=365, compounding=False)
eff_covariance= CovarianceShrinkage(prices).ledoit_wolf()
cla= CLA(portfolio_expected_returns, eff_covariance)
minimum_variance= cla.min_volatility()
(returns, volatility, weights) = cla.efficient_frontier()

plt.figure(figsize=(10,5))
plt.scatter(volatility, returns, label='Portfolios on efficient frontier')
plt.plot(equal_weight_portfolio_volatility/100, annual_return/100,'ro', label='Binance CMC Equal Weight Index')
plt.legend()
plt.ylabel('Expected Reward')
plt.xlabel('Volatiity')
plt.show()


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fss9wag8x7ovfyoepp199.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fss9wag8x7ovfyoepp199.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
From the efficient frontier, we choose the weights with the lowest volatility(variance), we also note that the Binance CMC equal weight index seems to be a sub-optimal portfolio because it doesn’t provide the best possible return for its level of risk or, conversely, it has a higher level of risk for its level of return.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

# Get the weights with lowest risk
optimized_weight=weights[volatility.index(min(volatility))]
pie_df=pd.DataFrame(optimized_weight*100, index=prices.columns, columns=['weights'])
pie_df= pie_df.sort_values(by=['weights'], ascending=False)
pie_df


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvjvjgthvoy9pkcdzxxod.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvjvjgthvoy9pkcdzxxod.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

### Showing Pie Chart of this weight

pie_df= pie_df.query('weights != 0.000000')

fig, ax = plt.subplots()
ax.pie(pie_df.weights, labels=pie_df.index.values.tolist(), autopct='%1.1f%%', radius=2)
plt.show()


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp4gkyn8m25tz6czfkvtx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp4gkyn8m25tz6czfkvtx.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
The weights with lowest volatility suggests 79.64% of Bitcoin, 13.31% of TRX, 6.4% of BNB, 0.43% of Polkadot and 0.22% of Ethereum, we get the risk level and expected reward from the efficient frontier.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&lt;p&gt;lowest_volatility= min(volatility)&lt;br&gt;
reward_level= returns[volatility.index(min(volatility))]&lt;br&gt;
print('Risk Level: ', round(lowest_volatility*100, 2), '%')&lt;br&gt;
print('Expected Reward: ', round(reward_level*100, 2), '%')&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Conclusion&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;In this article, we delved deep into understanding the risk and potential rewards associated with the Binance CMC Cryptocurrency Top 10 Equal-Weighted Index. By applying the principles of Modern Portfolio Theory, we were able to visualize the Efficient Frontier and compare the index’s performance against it. Our analysis revealed that the Binance CMC index, while promising, does not lie on the Efficient Frontier, indicating that there might be more optimal combinations of cryptocurrency weights that could offer better risk-adjusted returns.&lt;br&gt;
Furthermore, our exploration into optimizing the portfolio showed that certain cryptocurrencies, like Bitcoin, might play a more dominant role in minimizing risk. However, it’s crucial to note that the world of cryptocurrencies is highly volatile and ever-changing. While our analysis provides insights based on historical data, future performance can be unpredictable and the result of our analysis would change as more data is collected.&lt;br&gt;
Lastly, it’s essential to emphasize that this article is intended for educational purposes only. It does not serve as financial advice, and readers should always conduct their own research and consult with financial professionals before making investment decisions.&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
      <category>programming</category>
      <category>web3</category>
    </item>
  </channel>
</rss>
