owned this note
owned this note
Published
Linked with GitHub
# Hyperdrive (Original)
Hyperdrive is the next research leap from the Element Finance team on variable and fixed rate primitives. *No preset expiration dates, no fragmented liquidity, and no LP rollovers, aka everlasting liquidity.*
## A New Way To Trade Rates
The Hyperdrive AMM introduces a market sentiment indicator (MSI) for DeFi interest rates. Almost all DeFi interest rates are constantly changing ([sometimes by the block](https://github.com/element-fi/robrox/pull/6)). In order to gauge market sentiment, a balanced system of longs and shorts must exist between fixed and variable rates, in order to capture the wisdom of the crowd. Hyperdrive provides this. The fixed rate represented in Hyperdrive is the market sentiment indicator.
Hyperdrive lets users short or long the sentiment indicator. If a user thinks the sentiment indicator is too high, they'll go long because they like the fixed rate. If they think it is too low, they go short because they like the variable rate.
Which side are you on?
| ![](https://i.imgur.com/Bz1Ug6R.png) |
| :--------------------------------------------: |
| **Economists, they've made total fools out of us** |
## Overview
In the sections below, we describe what Hyperdrive brings to the DeFi space:
1. Terms on Demand
2. Consolidated and Everlasting liquidity
3. Longs and Shorts to Determine Market Sentiment
4. Trading Strategies
- LPs Benefit From Volatility Harvesting Interest Rates
- Traders Benefit From Volatility Harvesting Interest Rates
- Fixed Rate Borrow
- Multiplied Variable Rate Exposure
- Spread Borrow
5. Technical Teaser
6. Simulation
### 1. Terms On Demand
Hyperdrive removes the concept of preset start and end dates. Rates are traded for a fixed period of time, known as the [term](https://en.wikipedia.org/wiki/Bond_(finance)#The_term_of_the_bond). When a user chooses to trade on variable or fixed rates, the user starts their term, e.g. 6 months, on demand.
The fixed rate in these terms is the market sentiment indicator reflecting the market's expected average variable rates over the term length on an underlying yield source, like stEth.
Previously, a user would be forced to pick a variable or fixed rate market with a term set to a preset maturity date. This trends towards suboptimal LP fees and user experience. For example, users likely do not have a lot of demand to trade on terms that have only 1 week remaining, because gains are lower. LPs tend to be incentivized to be in new terms, since fees are higher.
### 2. Consolidated and Everlasting Liquidity
Previously, 6 month terms were deployed in a staggered manner. These staggered deployments lead to fragmented liquidity and required LPs to actively manage their position, such as rolling over their capital between different terms.
In Hyperdrive, terms are created on demand using the liquidity from a single pool. As a result, liquidity provision is no longer tied to a specific term. When a user provides liquidity, they do so for all future terms created from the pool. Their liquidity has no expiration. It is everlasting. The LP continues to collect fees on each trade as well as variable interest on unallocated capital, for as long as they wish.
### 3. Longs and Shorts to Determine Market Sentiment
The Hyperdrive AMM gives users the ability to open both long and short positions on the market sentiment indicator, aka fixed rate.
- When a user believes the market sentiment for variable rates is **too high**, they'd want to **long** the fixed rate, as they believe it is **higher** than their expectation of the variable rate for the term. This drives the fixed rate down.
- When a user believes the market sentiment for variable rates is **too low**, they'd want to to **short** the fixed rate, as they believe it is **lower** than their expectation of the variable rate for the term. This drives the fixed rate up.
Since Hyperdrive facilitates both longs and shorts, it fully captures market sentiment, letting the fixed rate reflect the market's beliefs.
Hyperdrive's approach doesn't require the use of funding rates or liquidation engines to remain solvent through volatile market conditions. Instead, all of the accounting and mathematics required to keep the system safe are baked into the AMM itself.
This creates a symmetrical market where users can drive the rates up and down as market sentiment changes, just like the hyperdrive game above illustrates.
### 4. Trading Strategies
#### A. LPs Benefit From Volatility Harvesting Interest Rates
> Every user trade is met with an equal and opposite LP trade
> - Sir Isaac Newton
For every trade that happens on the AMM, the LP takes on the other side. This means the LP will generally hold a position that is opposite to the market sentiment indicator. Whether the market is right or wrong, all trades pay fees to the LP holders.
Rates volatility attracts more trading, more fees, and more speculative activity from traders.
No matter the volatility, at the end of a term, the average variable rate for that term is a single number. Any trading that moves the fixed rate away from this number represents an inaccurate market prediction, which the LP takes the other side of, thereby profiting.
#### B. Traders Benefit From Volatility Harvesting Interest Rates
Hyperdrive's long/short mechanism allows for arbitrageurs to reap the benefit of volatile changes in interest rates.
| LOG(DSR_RATE) |
| :-----------: |
| ![](https://i.imgur.com/rCmFheb.png) |
| `chifra state --call "0x197E90f9FAD81970bA7976f33CbD77088E5D7cf7 \| dsr()(uint)" --file blocks.txt --no_header \| awk '$5 ~ /^[1-9]/ { printf "%.0f,%f\n", $1, ((($5 / 10^27 )^(60*60*24*365)-1) * 100)}' > dsr_rates.txt`|
|`jp < /code/trueblocks-sdk/python/dsr_rates_log.txt -input csv -xy '[*][1,3]'`|
As can be seen in this graph generated by [trueblocks](https://trueblocks.io/), MakerDAO's [DSR](https://blog.makerdao.com/dai-savings-rate/) follows a stepwise function. As the Stability Fee is changed, this allows for traders to quickly arbitrage the market sentiment to converge on the new rate.
#### C. Fixed Rate Borrow
On lending protocols, borrowers pay a variable rate to lenders, representing a significant source of uncertainty in DeFi trading strategies. The trader suffers from having to pay more interest cost when rates rise.
To manage this risk, they can open a short position on Hyperdrive, which inherently gives them exposure to the variable rate for a fixed cost.
Users historically have a significantly higher threshold on the borrow rate they are willing to pay if they can secure a fixed vs. variable position. This is seen on the AAVE fixed rate market. This creates a larger spread between fixed and variable rates, introducing arbitrage opportunities.
#### D. Multiplied Variable Rate Exposure
Hyperdrive allows users to get multiplied variable exposure by letting them borrow additional capital from the AMM at the current fixed rate and use it to open a short position.
By opening a short position, the user is buying the variable yield from the market's deployed assets. Users can buy interest on a higher amount of capital than they provide. There are no liquidations, they just provide a maximum loss to ensure protocol safety. Unlike other markets, a Hyperdrive short does not face the possibility of unlimited loss.
Because this position earns multiplied variable interest, it provides a stabilizing force encouraging the fixed rate to converge upon changes in the variable rate.
#### E. Spread Borrow
Hyperdrive users can get multiplied fixed rate exposure and profit from the spread between an asset's borrow rate and the current market sentiment or fixed rate.
Long positions on Hyperdrive have a guaranteed fixed rate, which makes them powerful collateral assets, as they allow high loan-to-value borrowing.
If a lending platform like MakerDAO charges a 1% rate to borrow DAI against this collateral and market sentiment on Hyperdrive reflects a 3% rate, users can profit from this spread by opening a long position on Hyperdrive, collateralizing this position, borrowing DAI against it, and repeating this process recursively until the rates converge.
## Technical Teaser
| ![](https://i.imgur.com/aphOgTj.png) |
| :----------------------------------: |
| *Shut up and Hyperdrive* |
Hyperdrive is a natural extension of the concepts introduced in the first iteration of the [Element Protocol](https://paper.element.fi/) which implemented a customised version of the constant power sum curve invariant from the foundational [YieldSpace](https://yield.is/YieldSpace.pdf) paper. Optimised for fixed rate trading, this curve's main benefit is curvature that adjusts with the passage of time.
Changing curvature of trading curves can be dangerous for protocol safety, as evidenced by the [Curve hack](https://medium.com/@peter_4205/curve-vulnerability-report-a1d7630140ec). Similar attacks are possible in a multi-curvature multi-term universe. The Hyperdrive solution does away with multiple curves, instead reflecting the passage of time in each position, an approach we're deeming "flat + curve". Each position is the sum of matured and unmatured portions.
## Simulation
[At each step](https://twitter.com/PaitonDylan/status/1585647541118304259/), building Hyperdrive has been assisted by thorough simulations.
The notebook below is one such sample simulation. Explore parameterisation and profitability in a hypothetical market environment.
Initial numbers look positive and we encourage you to explore on your own, just hit [Open in Colab](https://colab.research.google.com/github/element-fi/elf-simulations/blob/main/examples/notebooks/hyperdrive.ipynb) and run it yourself.
Our research is constantly updating, so stay tuned!
<sub>*The research described below is subject to further review, clarification, and revision. The end design of any software is subject to modification.*</sub>