Do you have questions
about my project?

Contact me😊
Coding Project

Synthetix Debt Pool Hedging Math

This code aggregates the data from the synthetix pool and backtests returns to calculate the optimal weights for sUSD, sETH, and sBTC to capture that highest r^2 possible. This optimal portfolio would allow the user to stay neutral to the debt-pool, accumulating pure yield on staked snx.

from sys import excepthook
import yfinance as yf
from datetime import datetime
import numpy as np
import matplotlib.pyplot as plt

indices = (yf.download(tickers="EURUSD=X", period="3mo", interval="1d").index)
eth = yf.download(tickers="ETH-USD", period="3mo", interval="1d")
eth = eth.filter(items = indices, axis=0)['Close'].to_numpy()

btc = yf.download(tickers="BTC-USD", period="3mo", interval="1d")
btc = btc.filter(items = indices, axis=0)['Close'].to_numpy()

jpy = yf.download(tickers="JPYUSD=X", period="3mo", interval="1d")['Close'].to_numpy()
chf = yf.download(tickers="CHFUSD=X", period="3mo", interval="1d")['Close'].to_numpy()
aud = yf.download(tickers="AUDUSD=X", period="3mo", interval="1d")['Close'].to_numpy()

matic = yf.download(tickers="MATIC-USD", period="3mo", interval="1d")
matic = matic.filter(items = indices, axis=0)['Close'].to_numpy()

eur = yf.download(tickers="EURUSD=X", period="3mo", interval="1d")['Close'].to_numpy()
usd = np.ones(eur.shape)

assets = [usd, eth, btc, eur, jpy, chf, aud, matic]
assets = np.array(assets)
returns = assets[:, 1:] / assets[:, :-1]
weights = np.array([.6338, .1662, .1014, .0487, .0283, .0153, .0051, .0012])
pool_returns = weights @ returns
sim_returns = returns[:3]
m = np.linalg.lstsq(sim_returns.T, pool_returns.T, rcond=None)[0]
print(m, "weights")
yhat = m @ sim_returns
plt.plot(pool_returns, color="red")
plt.plot(yhat, color="blue")
r2 = np.corrcoef(yhat, pool_returns)[0,1]
plt.title("debt pool returns vs hedge returns " + str(r2) + " r^2")
plt.show()
plt.scatter(np.arange(len(pool_returns)), (pool_returns - yhat))
plt.title("residual scatter plot")
plt.show()

‍

‍

‍

Arjun Hard drive
About Me
Research Projects
Coding Projects
Resume
πŸ‘‹About Arjun

Hi πŸ‘‹ I’m Arjun!

I’m a student at Georgia Tech and I am passionate about web3 tech, investing, and crypto.

I am a final-year student at Georgia Institute of Technology, concentrating on Finance with a minor in Computer Science. Besides my coursework, I have also completed prior internships at a digital asset hedge fund, pure crypto-vc.

Check out my latest Research!

Get to see more Research >

About

Just kidding. Nothing was actually shutdown. It wouldn't have been a good idea. Do it again?

Just kidding. Nothing was actually shutdown. It wouldn't have been a good idea. Do it again?

Contact Form

Contact Form

Thank you! Your submission has been received.
Oops! Something went wrong while submitting the form. Please check all of the fields and try again.
New Project Form

Project Submission

Thanks for you interest in working together on a project built in Webflow. In order to best understand your new website's needs, please fill out the information below to the best of your ability.

Check any of the options below that apply to your needs. If you don't understand what they mean, don't worry we can figure it out later.

If you've gotten this far, thank you. Go ahead and submit your info and I'll get back with you as possible with and informed response.

Thank you! Your project submission has been received!
Oops! Something went wrong while submitting the form. Please check all of the fields and try again.
Webflow
7 items
2013K in folder
unlimited
My Profile
Signup
Forum
Webflow Weekly
My Videos
My Tutorials
My Articles
Contact me
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Trash
6 items
Empty
Dreamweaver
Shopify
Squarespace
Weebly
Wordpress
Wix
Trash
0 items
Empty
Arjun's Resume
Coding Projects
Arjun HD
About me
Research Projects
Coding Projects
Trash

Maybe it's not a good idea to shut my website down without a hardware reset button. Proceed?

Just kidding. Nothing was actually shutdown. It wouldn't have been a good idea. Do it again?

Permission denied. Please reconsider your actions.