decred / dcrticketbuyer

An automated smart ticket purchaser.
0 stars 7 forks source link

dynamic max fee #56

Open raedah opened 8 years ago

raedah commented 8 years ago

Set the fee dynamically. The dynamic fee is based on profitability and is calculated as follows.

20 (cur price) / 28 (avg price) = 0.714 (percent reduced price)

1.6944 (reward) * 0.714 = 1.2098 DCR (equivalent reward per cost)

1.6944 - 1.2098 = 0.4846 DCR (extra profit that can be used for the fee)

0.4846 DCR is the max fee spend for profitability that is equivalent to buying at the avg price.

When there is a rush on cheap tickets, the fee would get bid up until it becomes the equivalent profit as just buying tickets at the average price.

When the current price is equal to or greater then the average price, the fee would stay set to the minimum required.