Potential updates not currently in scope:
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
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.
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
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
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 thetimer
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.
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:
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.
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
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.
Do you want to remove this version name and description?
Syncing