# Element V2 Research Direction ## Background on Element V1 The Element V1 Protocol works by enabling users to split a yield generating position, such as a Yearn vault, into two separate, fungible tokens: the Principal Token (PT), and the Yield Token (YT). The PT represents principal repayment after a fixed term, and the YT represents the variable interest gained from the yield generating position. ![](https://i.imgur.com/BJ7015s.png) PTs are traded at a discount in our ConvergentCurvePool which guarantees that the PT converges to a 1:1 value with the underlying asset at maturity. The PT purchase price determines the fixed rate of return that the buyer locks-in when it is purchased. ![](https://i.imgur.com/QV08wBn.png) Discounted assets allow users who are risk-averse to take on a safe guaranteed investment strategy without having to worry about the fluctuations of the variable interest market. For more detailed information on the Element V1 Protocol, checkout these links: - [Element V1 Presentation](https://hackmd.io/@vJTdwcwQSByvMaZGfTX_oQ/BkyM9mQD_) -- has some nice interactive plots to help understand our modifications to the Yield Space invariant. - [Element V1 Construction Paper](https://paper.element.fi/) -- has a lot of words and diagrams, but if you prefer math and plots, then skip to the [appendix](https://paper.element.fi/#8-appendix). ## Hyperdrive Hyperdrive is the next iteration of the Element Fixed Rate Protocol. It explores the following: - **Fixed Rate Terms on Demand** - In contrast to V1 and the traditional finance space around fixed rate instruments, Hyperdrive, allows for minting to be a part of the AMM, where the AMM essentially underwrites a new term for the user. The user is not constrained to purchasing, selling or minting into exististing terms that are partially completed, each with its own fragmented liquidity. In traditional finance, fixed rate instruments follow terms to a set length with set expiries that everyone has to follow. - **Longs and Shorts** - The AMM allows for matching longs and shorts on the fixed rate. This allows for spread trades between the fixed and variable rates, effectively on margin, creating a natural convergence mechanism between the fixed and variable rates, without the need for a funding rate. - **Margin Trading** - Due to the natural convergence mechanism described above, margin trading can be introduced on longs and shorts without a funding rate as well. This introduces more predictable and leveraged Interest Rate Arbitrage in DeFi. - **Consolidated Liquidity** - LPs provide liquidity to a single pool, which underwrites a variety of fixed terms with differing maturity dates. This removes fragmented liquidity and gives LPs an everlasting exposure to the fixed rate markets. - **Arbitrage and Volatility Harvesting on Interest Rates** - This long/short mechanism allows for arbitrageurs to reap the benefit of volatility, both across time, as well as across yield sources. In contrast to how perps offer attractive arbitrage trading on top of spot markets, this allows arbitrage trading on the very high volatility variable rates in DeFi (remember: no funding rate 😉). - **LP profitability and Fee Markets** - LP profitability increases: 1) when longs and shorts are matched on margin 2) due to consolidated liquidity 3) undewriting a basket of terms 4) idle capital is constantly earning yield in the underlying source. Hyperdrive does this using three main primitives: 1) Long PT price 2) Short PT price 3) Provide liquidity Refer to [Hyperdrive AMM math](https://hackmd.io/@delve-labs-research/r1wpkCFSi) for more detailed information on the accounting logic and AMM math. :::warning **Note**: Hyperdrive is still in early development and the accounting logic and AMM math is subject to change. ::: ### Fixed Rate Terms on Demand In Element V1, fixed rate buyers were limited to purchasing fixed rates in whatever term is currently deployed. This resulted in a subpar experience for many users that want fixed rate exposure, but there were no fresh terms available with long enough expiries to make it worth the time, effort, and gas. Another side effect of this mode is declining fee revenue over the course of a term. Obviously, lower volume means lower fees. However, due to the nature of the YieldSpace invariant, as a PT nears maturity, LPs make less in fees on individual purchases. This topic will be revisited again in the **LP profitability and Fee Markets** section. Hyperdrive aims to address these issues, in part, with a feature called *Mint on Trade*. With this feature, when a user wants to purchase a PT (long the price), the AMM will mint it on demand with a maturity date that is, for example, six months into the future. This is beneficial for the users because they are no longer limited to the existing term's schedule when purchasing PTs. This flexibility will incentivize a more active PT purchasing market volume. ### Consolidated Liquidity In Element V1, we tried to stagger deployments of 6 month terms every 3 months to provide more options for the user when purchasing PTs; however, much of that TVL never made it to the next term. Users were consistently late to redeem their maturities (5.6 days late on average), and some never withdrew at all ($124k representing $11k foregone interest). ![](https://i.imgur.com/NV9Ntrr.png) This demonstrates staggered liquidity and a lack of LP drive to rollover. As a result, we saw declining liquidity in successive terms, which lead to higher slippage on PT buys. Furtheremore, the need to rollover liquidity every 3 to 6 months made Element V1 a difficult integration for projects with one-click save features like DefiSaver's SmartSave. Manual effort, gas fees, and people just forgetting all contribute to something we call *Zombie TVL* 🧟‍♂️. The chart below shows just how prevalent it is: ![](https://i.imgur.com/cgiFURl.png) Hyperdrive fixes this by consolidating the liquidity into a single pool where users can purchase PTs. The best part is that the platform actually benefits from user's laziness -- they can park their liquidity in a pool indefinitely and Hyperdrive will make use of it. LPs also have an added benefit of continuing to collect variable interest on PTs until they are finally redeemed. This is a nice benefit when you consider how common it is for users to forget to redeem. For example, the following plot shows that only 40% of PTs were redeemed 100+ days after maturity on a particular term: ![](https://i.imgur.com/bDaPfGu.png) Consolidated liquidity should also encourage projects that are interested in using fixed rates to hedge exposure because they will only have a single contract to interact with and more consistent liquidity provisioning. ### Arbitrage and Volatility Harvesting V1 did have volatility harvesting and arbitrage opportunities if the fixed rate dropped. This allowed for spread trades, where users could leverage exposure to the variable rates by selling the fixed rate. We originally coined this as ["Yield Token Compounding"](https://paper.element.fi/#52-leveraging-and-yield-token-compounding), which is essentially a recursive method to take a fixed rate loan in order to purchase exposure to variable rates. If fixed rates go for 2% and variable rates at 10%, one can make a spread trade by repeatedly minting, selling their fixed rate and gaining an 8% spread. This table gives an example of yield compounding: ![](https://i.imgur.com/ymhG7Md.png) This Yield Token Compounding pressure allowed for the market to bring fixed rates higher to reduce the spread in an efficient market. However, if the variable rate decreased, there existed no countervailing market force to put on the opposite trade. This resulted in a one sided, imbalanced market. In hyperdrive, the ability to long the fixed rate on margin creates a reverse yield token compounding market, allowing the fixed rate to drop in response to drops in the variable rate. For example, if the variable rate drops, it can be expected that shorts will be closed, causing the fixed rate to drop further. This gives a better arbitrage and volatility harvesting mechanism on shifting variable rates in the market in contrast to our prior V1. The "Yield Token Compounding" aspect can cause this movement without the need of a funding rate. ### LP profitability and Fee Markets The YieldSpace invariant fee model is terrible for LPs. It is common for PT buy volume to drop significantly after the first half of the term. The plot below demonstrates this: ![](https://i.imgur.com/VzqEkry.png) On the other hand, PT sell volume starts to pick up towards the end of the term. This happens because users realized that it was cheaper to sell their PTs as the price converged rather than spend the gas to redeem. The following plot shows the volume of PT sells increasing as the term nears maturity: ![](https://i.imgur.com/cIFO98f.png) Recall that early in the term the YieldSpace invariant behaves like the constant product invariant and as it approaches maturity, it converges to the constant sum invariant. What this means is that the PT buys that are early in the term provide most of the revenue. Due to the nature of the YieldSpace invariant and fee model, LPs don't profit from users selling their PTs late in the term. Here's an example: ![](https://i.imgur.com/UYT9cbY.png) The chart above shows the Element V1 fee structure varying across market direction as well as time. Hyperdrive aims to create stability in the fee structure and therefore LP's profitability, by making fees symmetric between buys and sells, and flat across time. Hyperdrive improves on the fee model in a few ways. * Longs and shorts are matched on margin, making LP capital more efficient * Liquidity provision is not fragmented across pools * Ongoing term creation means liquidity is provided across a basket of terms * Idle capital is asset delegated to the underlying yield source, constantly earning yield ## Open Research As part of our current research, we are building a simulation framework to test fee models, invariant changes, LP max profitability and loss, security vulnerabilities and more. **Paths for further profitability?** We're investigating active strategies on top of existing positions. Active trading on top of these primitives can reap rewards by acting like a traditional market-maker that profits from mean-reversion, unlike existing AMMs. This would earn some of the Rebalancing profit-and-loss of a traditional market-maker, reducing Loss Versus Rebalancing (LVR). This can be implemented in strategy vaults or in-protocol limit orders, further dampening volatility while increasing depth and user profitability. Batch auctions are another promising direction. A block already batches demand, but executes in an ordered fashion. Taking advantage of batched demand, across one or multiple blocks, would increase the ability to match longs and shorts, improving pricing and liquidity. **Prove Hyperdrive is safe** Currently, we are using the Yield Space invariant to price PTs from reserves at issuance; however, we also use these same reserves to calculate the redemption/sale price of the PTs later in the term. We recognize that this creates an issue where we are essentially trading on multiple curves simultaniously (similar to the infamous [Curve Amplification Coefficient Vulnerability](https://medium.com/@peter_4205/curve-vulnerability-report-a1d7630140ec)) and that it can be exploited by sandwiching a PT redemption between an open and close short. We have a few options on how this can be mitigated, but we ultimately want to ship Hyperdrive with a proof of convexity to ensure that it is safe. **How do we configure the time stretch parameter for a pool that never expires?** In Element V1 we added a time-stretch parameter to the YieldSpace invariant to improve capital efficiency (see the [Construction Paper Appendix](https://paper.element.fi/#b-convergent-curve-parameter-configuration) for more details). This parameter may need to be adjusted to improve pricing for higher interest rates. Typically, when configuring a pool the time-stretch parameter is set using a target APR close to that of the variable yield source. This worked fine in Element V1 because pools only lasted the length of one term. With Hyperdrive, there is no limit to how long these pools can last so it is important that the parameterization of the pool is flexible. There are a few solutions to consider to ensure that the time-stretch parameter is flexible enough for the pool. *Option 1: One Size Fits All* We could configure a time-stretch that targets a mid level APR (e.g. 10%) per yield source and use that. If the actual APR is less than the configured APR, this would just mean that there is a little more slippage (and more fees) on trades. If the actual APR is greater than the configured APR, then we would have less slippage (and less fees) on trades. *Option 2: Dynamic Time-Stretch* Changes to the time-stretch parameter could result in dangerous levels of arbitrage, so it's important to find a mechanism that modifies the time-stretch safely. This presents a dynamic optimization problem with an unknown solution. Curve has a dynamic A parameter which has some analogues to this discussion and had a number of vulnerability reports as described in the Curve Amplitude Coefficient attack. **Independent lending market** Integrating margin lending, underwritten by LPs in the AMM seems to allow for significantly better capital efficiency since shorts and longs can cancel and trade each other out. This requires less available capital. However, we need to evaluate how this affects the max profit or max loss for an LP under different market conditions. An alternative aproach, if this creates too much volatility for the LP, is to introduce a seperate lending market. ## Additional Reading Materials - [Element V1 Construction Paper](https://paper.element.fi/) - [Element V1 Presentation](https://hackmd.io/@vJTdwcwQSByvMaZGfTX_oQ/BkyM9mQD_) - [Hyperdrive AMM Math](https://hackmd.io/@delve-labs-research/r1wpkCFSi) - [Yield Space](https://yield.is/Yield.pdf) - [Modified Yield Space](https://hackmd.io/lRZ4mgdrRgOpxZQXqKYlFw) - [Flat + Curve](https://hackmd.io/bIr784weTbOrJakb0EU3-Q?view)