Cash DeLeon
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Hyperdrive Borrow 🔒 ## Preface Fixed borrowing for lending markets is one of the leading applications for Hyperdrive. This document intends to formalize this application and come to a better understanding of the mechanism and risks. ## What is fixed borrowing? Borrowing in DeFi involves creating a CDP (collateralized debt position) with an interest rate owed by a borrower over time to pay a supplier. Most loans in DeFi have a variable interest rate, where borrowers take on variable debt and suppliers earn variable interest, both of which are dynamic and difficult to predict. Fixed borrowing simply describes taking out a fixed-rate loan, where the interest rate owed to the supplier is static and the amount of interest owed over the duration of the loan is predictable. ## Mechanism Hyperdrive wraps yield sources to create yield markets, giving users access to fixed and variable yield positions. These yield markets allow users to hedge their variable debt positions and turn them into fixed borrowing positions. There are two sides to every lending market: the suppliers and the borrowers. Suppliers deposit assets and earn the interest paid by borrowers, minus fees. Hyperdrive will wrap the supply side of this market, creating fixed and variable yield supply positions. So if a borrower has a variable debt position, they can use Hyperdrive to transform it to a fixed debt position by doing the following: - Deposit collateral into a variable rate lending market - Take out a loan as a variable debt position - Purchase a short in Hyperdrive to hedge the variable interest they’ll owe on the loan. (The short earns them a variable interest to match the variable interest they’ll eventually owe to settle their debt) - When ready to pay the debt, sell the short back to Hyperdrive to earn the yield to pay it off In this scenario, effectively all they owe is the short’s fixed payment upfront to settle a loan debt which otherwise would require an unpredictable payment at the time of close. This upfront cost can be interpreted as the fixed rate. When a user purchases a short in Hyperdrive, they pay an upfront cost, also known as the max loss, in exchange for variable yield exposure. At the end of some predefined time length, in a balanced market, the amount of interest accrued from the loan and the Hyperdrive short is the same. Thus the only cost to the user was the upfront cost for the variable yield exposure. Let's run through an example: The market is currently at a 5% variable APY. - Alice takes a loan on Aave of 100 USDC at 5% variable APY. - The Hyperdrive market is priced at 5%. - Alice needs to hedge 100 USDC variable APY. - Alice shorts 100 bonds for 5 USDC. - Alice now earns variable yield for 100 USDC. - After the short expiry, Alice closes her short in exchange for the amount of variable interest accrued on her loan. ## Interest Rates Let's delv into a primer on how interest rates work in popular lending protocols. Remember, there are two sides to the market. Interest rates in lending protocols are calculated using a formula. This formula varies slightly by protocol. ![Screenshot 2024-02-21 at 3.46.07 PM](https://hackmd.io/_uploads/B1IGegVha.png) The borrow rate (red) is a linear piecewise function, and the x-axis represents utilization. This formula is used to manage liquidity risk and optimise utilization in the lending market. Rates rise slightly as utilization increases. When the current utilization exceeds the target, in this case $90\%$ the rate increases faster to attract more suppliers. Let's define some initial constants: $U = 0.90$, target utilization $k = 4$, constant for curve steepness $u_t$ = utilization at a specific time The borrow rate can then be described as. $R_B(u_t) = \left\{ \begin{array}{cl} (1-\frac{1}{k}) \cdot \frac{u_t - U}{U} + 1 & : \ u_t \leq U \\ (k - 1) \cdot \frac{u_t - U}{1 - U} + 1 & : \ u_t > U \end{array} \right.$ Let's evaluate the supply function (green). The supply rate is proportional to the borrow rate with one difference: it's multiplied by the utilization rate. This means a spread will always exist in this interest rate model. In the graph, you can see the supply function is not linear like the borrow function; this is due to the utilization modifier. $R_S(u_t) = R_{B}(u_t)\cdot u_t$ This spread poses a significant problem when trying to achieve a true *fixed rate* using Hyperdrive since interest generate from the supply side would not be enough to cover borrowing cost. Let's define a new function called the gap function (blue). This function represents the interest rate spread between borrow and supply rates at a given uitlization. $G(u_t) = R_{B} - R_{S}$ ![image](https://hackmd.io/_uploads/Sk0yJuq36.png) Ultimately the true borrowing cost would be the cost to open a short and the remaining uncovered interest. ## Proposed Solution The hedged position works by offsetting the borrow-side costs with the supply-side earnings. However, the borrow and supply curves don't share the same slope, so there must be a point where the gap between the two rates is widest, that is, there must be a specific utilization rate that maximizes the hedged position's total cost. Let's visualize both rates and the gap between them in an amplified graph: ![image](https://hackmd.io/_uploads/r1cWEO5hp.png) The gap between the borrow and supply rates can be defined as the borrow rate minus the supply rate: $$G(x) = R_B(x) - R_S(x)$$ The gap is maximized when its derivative is 0, which gives us the following equations: $G'(x) = R'_B(x) - R'_S(x)$ $G'(x) = 0$ We find the derivatives of the supply and borrow rates: $R'_B(x) = \dfrac{k - 1}{k \cdot U}$ $R'_S(x) = \dfrac{2 \cdot (k - 1) \cdot x + U}{k \cdot U}$ Which gives us: $G'(x) = \dfrac{k - 1}{k \cdot U} - \dfrac{2 \cdot (k - 1) \cdot x + U}{k \cdot U} = 0$ Let's simplify: $x = \dfrac{k - 1 - U}{2 \cdot (k - 1)}$ We can see that the hedged position's worst case scenario is calculated by two properties: the slope and the target utilization rate. If we plug in the constants from the earlier example we can find our worst-case rate, which can be advertised as a fixed rate: $U = 0.90$, target utilization $k = 4$, constant for curve steepness $x_0 = \dfrac{4 - 1 - 0.90}{2 \cdot (4 - 1)} = 0.35 = 35\%$ We can then define the hedged position's fixed rate (i.e., its worst-case rate) as follows: $R_{max}(u_t) = R_S(u_t) + G(x_0)$ ## Market Analysis It's important to highlight that certain markets and protocols favor fixed-rate borrowing over others. There are a couple of properties to look for in these lending markets that will significantly decrease risk for fixed-rate borrowers: - Active market - The market should be active, and market opportunities should be capitalized on in a reasonable amount of time. - High target utilization rates: - When a market has a high target utilization rate, the borrow-supply rate spread would be near its lowest if the market is efficient, making it cheaper to hedge properly. - Examples include the Aave USDC market. - Isolated lending pools: - Isolated lending protocols such as MorphoBlue provide higher utilization rates and smaller spreads than a pooled lending market. - Pooled markets can have very imbalanced pools due to incongruent demand. - For example, the stETH market on Aave. The borrow-supply rate spread is high because many users deposit stETH as collateral and then borrow another asset. The demand to borrow stETH is low while the supplied amount is high. In an isolated lending market, there is only one asset that can be supplied and borrowed. - Avoid new markets - New markets should be avoided so the above properties can be evaluated. ## Open Questions - How should the risk involved be accurately portrayed in the brand of this product? - Do we want to include any fees in this product? - If so, do fees accrue to DELV or a DAO? ## Resources - https://www.desmos.com/calculator/kiectcgwlx - https://www.desmos.com/calculator/osm9npc3bc - https://docs.google.com/spreadsheets/d/1w_tn1QQeDxUEBwg2u5wsA6XWcEj6OKxgNLVt9AiL90U/edit#gid=778991337 ## OLD - overhedging Given that Hyperdrive will wrap the supply side of this market, this spread will need to be included in our calculation in how many shorts a user needs to properly hedge a variable debt position. Let's define a new function called the multiplier function. This function, $M$, is the amount that the supply function will need to be multiplied by to equal the borrow rate at a specific utilization. $M(u_t) = \frac{R_B(u_t)}{R_S(u_t)}$ <img src="https://hackmd.io/_uploads/rJYv14rna.png" style="height:400px;width:300px" /> - An asymtotic function similiar to $\frac{1}{x}$ - Approaches $\infty$ as utilization decreases This function reveals some interesting properties. The interest rate spread is proportionally different across utilization rates. This spread widens as utilization approaches 0. This makes sense intuitively given that the only revenue in this system is the interest paid by borrowers, and not all supplied assets are being utilized. This poses a problem for achieving a true fixed-rate debt position using Hyperdrive, particularly in the situation where the market utilization falls from the point at which the borrower hedged their position. Luckily, market dynamics are on our side. Each lending market defines a target utilization depending on the risk classification of the tokens involved. For any actively liquid market, we can reasonably assume that the utilization will oscillate around the target utilization. - If utilization falls, rates fall, leading to a market opportunity for borrowers. - If utilization rises, rates rise, leading to market opportunities for suppliers. In conclusion, it's still possible to offer fixed-rate debt positions using Hyperdrive, although a more formal definition would be a **hedge**. Providing transparent tools and data for fixed-rate borrowers would ensure that in the event a short accrues interest less than the variable debt loan, the borrower is aware and can take action.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully