HackMD
    • 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
    • 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
    • Engagement control
    • 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 Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control 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
  • 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
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Storehouse and Wheat Sif's flowing golden hair symbolizes the endless fields of wheat, embodying a vision of post-scarcity abundance where nature's generosity sustains all. ## Why Storehouse and Wheat Storehouse and Wheat is an extension of the [LPD](https://hackmd.io/ZE2JzXkURYCoXiuHojh2rA?view) monetary policy that induces a substantial permanent burn on Rowan tokens. Problem Statement: - Premise: For a fixed liquid market cap and an increasing circulating supply, the value of each token decreases alongside inflation. Deflationary burn mechanisms can induce the opposite effect, increasing the value of each token that isn't burned assuming a fixed liquid market cap - Problem: Traditional burn models induce minimal deflation. For example, Ethereum's EIP 1559 led to a supply change of -0.07% for Ether between June 2023 and June 2024. BNBChain's burn mechanisms led to a supply change of -25% for BNB between Oct 2017 and June 2024 - Solution: Storehouse and Wheat takes Rowan out of circulation and increases Rowan's purchasing power in a manner similar to LPD but permanently burns a percentage of the total Rowan taken out, allowing it to go hyper-deflationary and burn up to 90% of circulating supply in 1-2 years or more, depending on what monetary policies are used and when. ## How Does Storehouse and Wheat Work? ### Variable Definitions #### Chain State The chain state is the set of information from the consensus protocol. This is exogenous to the model of the liquidity pool in that blocks are validated without feedback loop that prevents the operation of the protocol. The variables specified below are the state of the chain necessary to be read by the Storehouse and Wheat monetary policy. | Variable Name | Descriptive Name | Description | Symbol | |----|----|----|----| | start_block_height | Start Block Height| First block of a given policy period| $h_S$ | | final_block_height| Final Block Height | Last block of a given policy period| $h_F$ | | current_block | Current Block | Current block | $h$ | #### Governance Decision The governance decision is a policy input message that broadcaqrsts a specified $r_{gov}$ for a specified length of time $l_{policy}$, with a computable $r_{final}$ as the intentional end-state of the policy at the end of its effective life at $h_f$. | Variable Name | Descriptive Name | Description | Symbol | Domain| |----|----|----|----|----| | epoch_length | Epoch Length | Number of blocks in an epoch | $l_{epoch}$ | $\mathcal{I} \geq 0$ | | policy_length_in_epochs | Policy Length in Epochs | Number of epochs in the policy; the specific governance policy period resulting from one particular vote | $l_{policy}$ |$\mathcal{I} \geq 0$ | | gov_rate | Governance Rate | Per-epoch (approximately daily) rate of purchasing power increase voted in by governance | $r_{gov}$ | [0,1]| | final_compounded_rate | Final Compounded Rate | Overall rate of increase over the policy length| $r_{final}$|[0,1]| **Assumption: epoch_length is a governance design, where there is the need for the consensus protocol to execute an epoch module.** **final_compounded_rate is a metric of gov_rate and policy_length_in_epochs** #### Liquidity Pool Module State Receives Storehouse and Wheat policy through governance decision, updating its parameters for $r_{gov}$ and $l_{policy}$. Combining this policy with the production of blocks from the protocol, allows for the computation of $r_{block}$ and $r_{running}$. | Variable Name | Descriptive Name | Description | Symbol | |----|----|----|----| | block_rate | Block Rate| Incremental increase on a per block basis to reach ${final\_compounded\_rate}$ | $r_{block}$| | running_rate | Running Rate| The purchasing power multiplier rate at a given block | $r_{running}$ | #### Additional Details on these Variables: The total duration of a policy is the span of blocks between $h_S$ and $h_F$ The duration of the policy can be divided into epochs which are sections of blocks of equal length. An obvious option for epochs would be one epoch per day. Of course, this would need to be measured against an average block duration as not all blocks have equal duration. For example, if blocks were approximately 5 seconds long then an epoch would be 17280 blocks, but because the blocks were not exactly 5 seconds long the epochs would not be exactly 1 day long. The epochs are a user experience affordance to put governance reasoning about the effects of Storehouse and Wheat in intuitive units. ### Use $r_{gov}$ to Derive $r_{block}$ Let $r_{gov}$ be the per-epoch rate increase voted in by governance. Each epoch, the purchasing power of Rowan (treated as the $y$ token in Variable Definitions above) should increase by this percentage. Let the final compounded rate, ${r_{final}}$, be defined as follows: $${r_{final}} = (1 + r_{gov}) ^ {l_{policy}} - 1$$ Rowan should increase by this percentage between $h$ and $h_F$ (ie. across all epochs). Now we compute $r_{block}$, which is the incremental increase on a per block basis (to reach $final\_compounded\_rate$): $$r_{block} = (1 + r_{gov}) ^ {l_{policy}/({h_F-h_S})} - 1$$ $r_{block}$ function derivation can be found in Appendix 1 at the end of this document **From this point onward we only focus on blocks.** Given a block rate calculated at the initial governance decision, there is no further role for the epoch rate or to keep track of epochs. The block rate is not recalculated again after the initial goverance decision. ### Use $r_{block}$ to Derive $r_{running}$ Let $r_{running}$ be the running rate that is compounded over time (at any particular block). Similarly $$r_{running} = (1+r_{block})^i-1$$ where $$ i = h - h_S $$ **Note:** $r_{running}$ in Storehouse and Wheat is an interesting stat but is not necessary for calculations in this feature ## Computational and Financial Effect of Storehouse and Wheat On a per-block basis, Storehouse and Wheat removes $r_{block}$ Rowan from all LP positions and places it in a separate Storehouse address. Consider the image below: ![Screenshot 2024-06-11 at 12.04.02 AM](https://hackmd.io/_uploads/HkhgwOrrA.png) For each Rowan token removed and placed in the storehouse, the feature distributes one Wheat token to each pooler. ### Calculating the Burn Amount ##### For each subsequent block h: 1. Calculate the value of the added Rowan ($V_{R_h}$) by multiplying the amount of Rowan added in that block ($R_h$) with the current Rowan price ($P_{Rh}$): $V_{R_h}$ = $R_h$ * $P_{Rh}$ 2. Update the running average price ($P_{R_{avg}h}$) using a weighted average formula: $$P_{R_{avg}} = (P_{R_{avg}{h-1}} * S_{h - 1} + V_{R_h}) / (R_h+S_{h - 1})$$ Example below: Block 1: $S_0 = 0$, $R_1 = 10$, $P_{R1}$ = $10, $P_{R_{avg}}$ = $10 Block 2: $S_1 = 10$, $R_2$ = 10, $P_{R2}$ = $12, $P_{R_{avg}}$ = $11 Block 3: $S_2 = 20$, $R_3$ = 10, $P_{R3}$ = $15, $P_{R_{avg}}$ = $12.33 ##### Calculate the Burn Amount: Take the current price of Rowan at the end of the policy period ($P_{h_f}$) and subtract the final average price of Rowan added to the storehouse $P_{R_{avg}}$ and divide by the final price again. This returns a percentage of Rowan in the storehouse that can be burned. For example, if the price of Rowan at the end is $15 and the average price of Rowan added to the storehouse is $12.33, then you can burn ($15-$12.33) / $15 = 17.8% of all Rowan in the storehouse (with the rest being distributed back at auction). ## Sifchain Storehouse & Wheat: Dual Auction Mechanism To optimize Rowan distribution and Wheat value, the Storehouse employs a dual auction system that switches between two mechanisms based on the Rowan-Wheat price ratio: #### Highest-Bidder Auction: - Trigger: Activated when the Rowan-Wheat price ratio ($P_R$ / $P_W$) is below a pre-defined threshold ($RW\_delta$). Process: - Bidders submit a single bid in Wheat, representing the amount they are willing to pay for the entire lot of Rowan in the Storehouse. - The highest bidder wins the entire lot of Rowan. - The Wheat used for the winning bid is burned. - All other bidders retain their Wheat. #### Lottery-Based Auction: - Trigger: Activated when the Rowan-Wheat price ratio ($P_R$ / $P_W$) is above $RW\_delta$. Process: - Bidders submit a single bid in Wheat, representing their entry into a lottery. - Each Wheat bid acts as a "lottery ticket." - Any bidder can win, regardless of bid size, but the probability of winning is proportional to the amount of Wheat bid. - All Wheat submitted in the lottery is burned. ### About $RW\_delta$ Threshold Governance Parameter: The $RW\_delta$ threshold represents the critical Rowan-Wheat price ratio that determines which auction mechanism is activated. Value Setting: The specific value of $RW\_delta$ requires careful analysis and consideration of market dynamics, desired price stability, and community input. ### Example: Let's say $RW\_delta$ is set to 0.05 (meaning Rowan must be worth at least 5% more than Wheat for the Lottery-Based Auction to be activated). Scenario 1: ($P_R$ / $P_W$) = 0.06 (Rowan is 6% more valuable than Wheat): The Lottery-Based Auction is triggered. Scenario 2: ($P_R$ / $P_W$) = 0.03 (Rowan is 3% more valuable than Wheat): The Highest-Bidder Auction is triggered. ### Motivations: Flexibility: Adapts to changing market conditions and token valuations. Wheat Price Support: The Lottery-Based Auction can potentially boost Wheat demand and mitigate price decline when its value is low. Efficient Allocation: The Highest-Bidder Auction ensures the most efficient allocation of Rowan when Wheat is valued highly. --- ## Extending DLP to Manage Wheat Sale **Summary:** Currently, DLP (DEX Liquidity Protection) only manages the sale rate of Rowan. We propose extending DLP to also manage the sale rate of Wheat, bundling the sale of both assets to protect the liquidity of non-Rowan assets on Sifchain. **Motivation:** - **Protecting Non-Rowan Liquidity:** DLP is designed to ensure sufficient liquidity remains available for users to buy Rowan. However, excessive sales of Wheat could drain non-Rowan liquidity, impacting DEX usability for other assets. - **Preventing Panic Sales:** Bundling Wheat and Rowan sales during potential panic selling events prevents a cascade effect where the sale of one asset triggers the sale of the other, exacerbating the situation. - **Maintaining Market Stability:** By managing the sales rate of both Wheat and Rowan, DLP helps stabilize the DEX during periods of volatility, ensuring a healthy and balanced ecosystem. **Proposed Solution:** - **Bundled Sales Threshold:** Introduce a new governance parameter for the maximum percentage of the total USD value of Wheat and Rowan that can be sold within an epoch (typically a day). - **Dynamic Adjustment:** Similar to the existing DLP mechanism, the daily threshold for bundled sales is dynamically adjusted based on the USD value of Wheat and Rowan sold. - **Circuit Breaker Action:** If a combined sale of Wheat and Rowan exceeds the current daily threshold, the swap is rejected. - **Individual Asset Thresholds:** Alternatively, we could introduce separate daily thresholds for Wheat and Rowan, providing more granular control over individual asset sales. **Implementation:** - **Extend Existing DLP Logic:** The existing DLP mechanism can be extended to include Wheat sales within the bundled threshold calculation. - **Oracle Integration:** An oracle will be required to provide real-time USD values for both Wheat and Rowan. - **User Interface Updates:** The user interface should clearly display the current bundled sales threshold and any potential restrictions on selling Wheat or Rowan. **Benefits:** - **Enhanced Liquidity Protection:** Protects the liquidity of all assets on the DEX, not just Rowan. - **Improved Market Stability:** Helps to prevent cascading sell-offs and maintain a more balanced trading environment. - **Increased User Confidence:** Provides a more stable and predictable trading experience for all participants. **Challenges:** - **Parameter Optimization:** Carefully determining the bundled sales threshold and potential individual thresholds requires analysis and community input. - **User Experience:** Implementing bundled sales restrictions may require adjustments to user interfaces and trading workflows. - **Potential for Manipulation:** Large holders could try to manipulate the system by timing their trades strategically. **Conclusion:** Extending DLP to manage the sale rate of Wheat, bundled with Rowan, offers a significant step towards a more robust and resilient DEX ecosystem. By ensuring sufficient liquidity for all assets, DLP helps maintain market stability and promotes confidence for all participants. Careful implementation, community engagement, and continuous monitoring are crucial to maximize the benefits of this enhanced DLP feature. ## Implementation Detail If Storehouse and Wheat is too computational to run every block, it can be optimized. For example, it can be run every n blocks on all pools or once every block on only a subset of pools such that after n blocks all pools have been adjusted.

    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