Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the fee statistics function required to provide optimal fees. #437

Open
MichaelKim20 opened this issue Sep 10, 2021 · 2 comments
Open
Assignees

Comments

@MichaelKim20
Copy link
Member

MichaelKim20 commented Sep 10, 2021

If the number of transactions is small, it is difficult to filter out noise.
We've already used the cutting average to remove noise, but this is not perfect either.
In the process of developing Wallet, we found that high fees entered incorrectly could keep subsequent fees high.
Therefore, we need logic that is handled in a different way.

We have come to pay attention to the number of transactions that are currently being processed or have to be processed.
If the number of transactions that have not been processed during the recent N block and remain in the transaction pool is Np,
It can be seen that the load of the network is directly proportional to the value of Np.
Therefore, transaction fees are directly proportional to the network, which is also directly proportional to Np+Nb.
Therefore, the formula is summarized as follows.

fee = 0.01 + 0.00002 * Transaction Size
if fee < 0.01 then fee= 0.01
Transaction Fee = a * log(Np+1) + fee
When a = 0.01
Np = 100 => Transaction Fee : about 0.03
Np = 1000 => Transaction Fee : about 0.04
Np = 10000 => Transaction Fee : about 0.05

Because it changes too sensitively depending on the number of transactions, it is recommended to apply it when the value of Np exceeds a certain quantity.
And Np should be measured at least in the previous six blocks.

@MichaelKim20
Copy link
Member Author

MichaelKim20 commented Sep 13, 2021

Introduce a new way.
It is a method of using the conversion ratio of fee and transaction size.

Fee = Rate * size of transaction
Minimum Rate = 0.0007

Tx Size : 300 => Fee : 0.021
Tx Size : 600 => Fee : 0.042

Modified Rate = 0.00007 + (0.00007 / 3) * log(Np + 1)
Tx Size : 300
Np : 100 => Fee = (0.00007 + (0.00007 / 3) * log(100 + 1)) * 300 = 0.035
Np : 1000 => Fee = (0.00007 + (0.00007 / 3) * log(1000 + 1)) * 300 = 0.042
Np : 10000 => Fee = (0.00007 + (0.00007 / 3) * log(10000 + 1)) * 300 = 0.049
Therefore, depending on the load of the network, the fee fluctuates within the range of about 0.02 to about 0.05.

@TrustHenry
Copy link
Member

Introduce a new way.
It is a method of using the conversion ratio of fee and transaction size.

Fee = Rate * size of transaction
Minimum Rate = 0.0007

Tx Size : 300 => Fee : 0.021
Tx Size : 600 => Fee : 0.042

Modified Rate = 0.00007 + (0.00007 / 3) * log(Np + 1)
Tx Size : 300
Np : 100 => Fee = (0.00007 + (0.00007 / 3) * log(100 + 1)) * 300 = 0.035
Np : 1000 => Fee = (0.00007 + (0.00007 / 3) * log(1000 + 1)) * 300 = 0.042
Np : 10000 => Fee = (0.00007 + (0.00007 / 3) * log(10000 + 1)) * 300 = 0.049
Therefore, depending on the load of the network, the fee fluctuates within the range of about 0.02 to about 0.05.

Minimum Rate = 0.0007 This value is strange.
Minimum Rate = 0.00007 This is the rate, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants