Closed prayagd closed 3 months ago
Hello @prayagd Can I Take this?
This ticket is lacking a bit of the details. @pendulum-chain/product can you please change the description to something that looks similar to https://github.com/pendulum-chain/pendulum/issues/423.
@pendulum-chain/devs can you provide same calculation for the sell fee as here
We charge the same raw gas fee values on Amplitude and Pendulum so we can assume that the gas cost for the buyout()
extrinsic on Pendulum is the same as the value as on Amplitude. Thus, we will assume that the cost in the native token is the same as the extrapolated value derived here, ie. calling the buyout()
extrinsic on Pendulum has a theoretic cost of 0.004216736845
PEN.
With the current PEN price of $0.080, we arrive at a cost of 0.004216736845 * 0.080
= $0.0003373389476 for the extrinsic. Assuming a DOT price of $9.8, the resulting sell fee has to be at least 0.0003373389476 / 9.8
= 0.0000344223415918 DOT. So we know that we need to choose a combination of MinAmountToBuyout
and SellFee
so that the user pays at least 0.0000344223415918 DOT as fee.
For a buyout of 0.1 PEN with a resulting absolute fee of at least 0.0000344223415918 DOT, we need to have a SellFee
of >=4% because with the current exchange rate of 1 PEN = 0.00852107 DOT, we can see that 0.1 PEN 0.04 = 0.004 PEN and 0.004 PEN 0.00852107 DOT/PEN = 0.00003408428 DOT.
@pendulum-chain/product I think we should go ahead with the same values as we use on Amplitude, ie. minimum buyout amount of 0.1 PEN and a SellFee
of 5%.
We should use 0.1 PEN here right @ebma?.
Yes, exactly 👍 I made a typo but changed my comment.
Also, I see in the code that right now the minimum is defined as 0.01 AMPE instead.
Oh you are right, we must have forgotten about changing that after we decided to go with a different value. I think it's okay if we just change it to the correct value, ie. 0.1 AMPE in the same PR (https://github.com/pendulum-chain/pendulum/pull/441) and roll it out in the next Amplitude release.
Context
Follow-up ticket on Implement pallet that extends our current treasury pallet with buyout feature #396.
Requirement
Add this pallet to the Pendulum Runtime and use the following parameters.
Parameters
SellFee
- 5%MinAmountToBuyout
- 0.1 PENBuyoutPeriod
- 7200 blocks (24 hours where average block time is 12 seconds)MaxAllowedBuyoutCurrencies
- 20