← BACK TO PROJECTS
Project · Python

Crypto as an investment: how much, if any?

/02
Balanced split, risk vs return, Monte Carlo outcomes and correlation map
Data
Kaggle · Yahoo Finance · Reddit
Scope
5 coins vs 4 benchmarks
Stack
Python · pandas · NumPy · SciPy · scikit-learn · yfinance · BeautifulSoup · VADER · Matplotlib
Methods
Event study · Monte Carlo · VaR · Sentiment analysis

The brief

The assignment was to set our own business problem and solve it in Python, using data pulled from several different sources. We framed it around a New Zealand wealth-advisory desk that needs evidence before advising retail clients on cryptocurrency, broken into four questions a client might actually ask:

  1. Do major news events move the crypto market, and does the direction of the news predict the direction of the price?
  2. Held for the long run, does crypto settle into something that behaves like a traditional asset?
  3. On a fixed budget, how much crypto should a sensible investor hold, and how should it be split?
  4. What is the retail community's mood toward crypto right now?

Building the dataset

Five coins run through the whole study: Bitcoin, Ethereum, Cardano, BNB and Polkadot, the largest, longest-listed coins common to both price sources.

  • Two sources, one timeline. A Kaggle archive (one CSV per coin) supplies the history from 2013 to mid-2021; the Yahoo Finance feed, pulled through the yfinance API, extends it to 2026 with split-adjusted closing prices.
  • Cleaning. Each coin file was trimmed to date, close, volume and market cap, stacked into one long table, and the dates converted and normalised so the same day lines up across coins.
  • Audit. Checks for duplicate coin-date rows and zero or negative prices both came back clean. The coins list at different times, so the gaps before a coin launched were left empty rather than filled with invented numbers; each question only uses dates where its coins actually trade.
  • Joining. Both sources were pivoted to a wide table and joined at a single hand-over date, 1 July 2021, to avoid double-counting days or carrying two prices for the same day.
  • Returns and regimes. Prices were converted to daily returns, and each day tagged by market cycle (2017–18, 2020–21, 2024–26) so the cycles can be compared.

1. Do headlines move the market?

Method. An event study of 43 dated events from 2017 to 2026, across four types: celebrity, market, policy and geopolitical. Each event was tagged bullish, bearish or neutral from the news itself, before any prices were looked at, so the outcome couldn't be read back into the headline. For every event and coin we measured the five-day return, then tested whether the price moved the way the news implied more often than a coin flip (binomial test), and whether bullish news out-earned bearish news (Welch t-test).

Result. Events move prices a lot (the 2024 US election was followed by +16% for Bitcoin and +77% for Cardano in five days), but direction is close to unpredictable. No coin beat a coin flip at the 5% level:

CoinHit ratep-value
Bitcoin59%0.17
Ethereum59%0.17
Cardano52%0.44
BNB56%0.35
Polkadot39%0.92

By type, market news (59%) and celebrity news (59%) did best, policy news worst (45%), none significant. Bullish events averaged +2.35% and bearish −2.70%, but the gap wasn't significant (Welch t = 1.37, p = 0.18). Headlines aren't a trading signal a retail client can act on.

2. Is crypto maturing into a traditional asset?

Method. Bitcoin and Ethereum against the S&P 500, gold, long-dated bonds (TLT) and the Nasdaq-100 (QQQ) on a shared trading calendar from 2017 to 2026, comparing annualised return, volatility, Sharpe ratio and maximum drawdown, plus 90-day rolling volatility and correlation.

AssetReturnVolatilitySharpeMax drawdown
Bitcoin94.5%67.6%1.37−83.0%
Ethereum164.9%93.8%1.74−93.5%
Tech (QQQ)25.0%22.8%1.01−35.1%
Gold16.4%16.7%0.86−23.1%
S&P 50015.4%18.4%0.73−33.9%
Long bonds0.4%15.0%−0.11−48.4%

Result. Not yet. Bitcoin went from 7.6× as volatile as the S&P 500 in 2017–19 to 3.7× in 2024–26, so it is calming down. But its correlation with shares rose from 0.00 to 0.38 while staying near zero with gold. Crypto has paid well for its risk, but it behaves less like digital gold and more like leveraged tech, and offers little shelter when shares fall.

Risk vs return, rolling volatility, rolling correlation and Sharpe ratios

3. How much should a client hold?

Method. The five coins and four benchmarks form a nine-asset menu, sized by inverse-volatility weighting: the riskier the asset, the smaller its slice. That lets risk do the sizing instead of relying on unstable return forecasts. At base weights, crypto naturally lands at 24.9% of the portfolio. We then built three client profiles, splitting both the crypto and traditional slices by inverse volatility, and calculated portfolio volatility from the covariance matrix so co-movement is accounted for. A 10,000-path Monte Carlo on a $100 balance gave a one-year range of outcomes, with 95% Value-at-Risk and CVaR (the average loss in the worst 5% of cases).

ProfileCryptoReturnVolatilitySharpe95% VaRCVaR
Conservative5%10.1%12.7%0.64$10.06$14.69
Balanced15%10.6%15.9%0.54$14.30$19.70
Aggressive30%11.2%22.6%0.41$22.93$29.80

Result. Going from 5% to 30% crypto adds about one percentage point of return but nearly doubles volatility, and more than doubles the worst-case loss. Median outcomes barely differ ($110.78 to $111.72 after a year). The case is for a small, deliberately sized crypto slice.

Machine-learning check. To test whether the coins really move as one, we standardised daily returns and ran K-Means clustering (k chosen by silhouette score) and PCA. K-Means split the menu cleanly into two groups, all five coins in one and the four traditional assets in the other. The first principal component explains 75.9% of daily variation, and four components explain over 90%, so a nine-asset menu holds only about four independent bets. Spreading a crypto slice across many coins isn't real diversification.

4. What's the community mood?

Method. Price data holds no opinions, so this question used web data, kept separate from the price table. We wrote scrapers from scratch with requests and BeautifulSoup to collect top posts from r/CryptoCurrency. Reddit's JSON feed blocked the requests (HTTP 403), so the scraper fell back to parsing the HTML page directly. Each headline was scored with VADER sentiment analysis and bucketed as bullish, bearish or neutral, with an upvote-weighted average for overall mood.

Result. Of the week's top 25 posts, 14 were neutral, 6 bearish and 5 bullish. Mood was flat unweighted (+0.004) and leaned mildly bullish once weighted by upvotes (+0.068). Across a wider pull of 50 posts from r/CryptoCurrency and r/CryptoMarkets, Bitcoin dominated the conversation: 18 posts and about 111,000 upvotes, against one post for Ethereum.

What it means for the desk

Treat crypto as a long-horizon, high-risk, stock-correlated holding: don't trade it around headlines, keep the allocation small and deliberately sized, and don't mistake holding several coins for diversification.

My role

This was a group project for BUSINFO 701 at the University of Auckland. Together with one teammate, I created the research questions and built the entire model.