Jord Jord
    • 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
      • 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 Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync 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
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
# Parametric Swap Fees and Dynamic Swap Fees Potential updates not currently in scope: - Variable length epochs - Varying max swap fee based on TVL ## Parametric Swap Fees Premise: Swappers are currently charged a static swap fee for every single swap (and charged that fee twice when they execute a TKN1:Rowan:TKN2 double swap) Problem: Currently, it's not possible to update this fee without a formal on-chain governance proposal Solution: Enabling a parametric swap fee would let the variable be updated more quickly to address the market's rapid updates ### Applying the parametric swap fee This parametric swap fee will be used to facilitate the dynamic swap fee below, which is a response to the rate at which Rowan is sold. Thus, we should charge this fee based on when Rowan is sold. It is not necessary to implement the parametric swap fee on the sale of non-Rowan tokens at this time. ### Examples Consider `default_swap_fee` which is applied whenever a swap occurs at present. Consider `rowan_swap_fee` to be a new fee that is charged whenever Rowan is sold in a single swap. We would NOT want the fee to be applied when Rowan was sold in the middle of a double swap. We likewise would NOT want the fee to be applied when Rowan was purchased in a single swap. Examples below: Rowan -> TKN Single Swap: `rowan_swap_fee` TKN -> Rowan -> TKN Double Swap: `default_swap_fee` x 2 TKN -> Rowan Sale Single Swap: `default_swap_fee` ## Dynamic Swap Fees Premise: Dex Liquidity Protection and Liquidity Provider Distribution enable a purchasing power increase for Rowan on Sifchain Problem: Excessive sales of Rowan on other exchanges can lead to price discrepancies that may confuddle arbitrageurs Solution: Dynamic swap fees empower the arbitrageur community to keep a more constant price of Rowan across exchanges and share arbitrage profits with poolers, giving poolers additional yield from swap fees ### Swap Fee Changing Over Time This feature is simply about varying `rowan_swap_fee` over time such that it starts at a high value and drops over time. We can use an "epoch" structure similar to LPD and Ratio Shifting to decide how frequently a cycle of fee dropping occurs. Note that `default_swap_fee` does not vary over time here. Consider the following psuedocode: ``` while (true){ rowan_swap_fee = max_swap_fee while (epoch_not_over?(epoch)){ intra_epoch_timer.reset(n.minutes) while (timer_not_over?(intra_epoch_timer)){ if (swap_occured_in_last_n_minutes?(ROWAN)){ intra_epoch_timer.reset(n.minutes) } } reduce_swap_fee(rowan_swap_fee, sf_increment) } } ``` Within an epoch, we wait for the duration of the`timer` to see if swappers are willing to swap Rowan at `rowan_swap_fee`. If so, we reset the timer to wait here longer and let other swaps occur. If the timer expires with no swaps occuring, we reduce the swap fee and then wait out again for the duration of the timer to see again if swappers want to swap. At the end of an epoch, we reset `rowan_swap_fee` to `max_swap_fee` and try again. ## Scrap Section The following content was in a previous version of this document and is kept here merely for historical reference but not intended to be implemented for this feature: #### Min Swap Fee and Swap Fee Our current (not yet released) implementation of the min-swap fee feature parameterizes a flat minimum swap fee (ex: $0.3) on a per-token basis but has a global percentage swap fee rate (ex: 0.03%) across all pools. The swap fee charged per swap is `(max(amount_swapped * swap_fee, min_swap_fee))` This document assumes `swap_fee` itself is parameterized on per-token basis and modifies it over time. An early implementation of this feature could instead use `min_swap_fee` as a variable being modified over time and be fine. Future version of this doc may explore options for modifying both variables over time.

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