1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
crateix!;
/**
| Track confirm delays up to 12 blocks
| for short horizon
|
*/
pub const SHORT_BLOCK_PERIODS: u32 = 12;
pub const SHORT_SCALE: u32 = 1;
/**
| Track confirm delays up to 48 blocks
| for medium horizon
|
*/
pub const MED_BLOCK_PERIODS: u32 = 24;
pub const MED_SCALE: u32 = 2;
/**
| Track confirm delays up to 1008 blocks
| for long horizon
|
*/
pub const LONG_BLOCK_PERIODS: u32 = 42;
pub const LONG_SCALE: u32 = 24;
/**
| Historical estimates that are older
| than this aren't valid
|
*/
pub const OLDEST_ESTIMATE_HISTORY: u32 = 6 * 1008;
/**
| Decay of .962 is a half-life of 18 blocks
| or about 3 hours
|
*/
pub const SHORT_DECAY: f64 = 0.962;
/**
| Decay of .9952 is a half-life of 144 blocks
| or about 1 day
|
*/
pub const MED_DECAY: f64 = 0.9952;
/**
| Decay of .99931 is a half-life of 1008
| blocks or about 1 week
|
*/
pub const LONG_DECAY: f64 = 0.99931;
/**
| Require greater than 60% of X feerate
| transactions to be confirmed within
| Y/2 blocks
|
*/
pub const HALF_SUCCESS_PCT: f64 = 0.6;
/**
| Require greater than 85% of X feerate
| transactions to be confirmed within
| Y blocks
|
*/
pub const SUCCESS_PCT: f64 = 0.85;
/**
| Require greater than 95% of X feerate
| transactions to be confirmed within
| 2 * Y blocks
|
*/
pub const DOUBLE_SUCCESS_PCT: f64 = 0.95;
/**
| Require an avg of 0.1 tx in the combined
| feerate bucket per block to have stat
| significance
|
*/
pub const SUFFICIENT_FEETXS: f64 = 0.1;
/**
| Require an avg of 0.5 tx when using short
| decay since there are fewer blocks considered
|
*/
pub const SUFFICIENT_TXS_SHORT: f64 = 0.5;
/**
| Minimum and Maximum values for tracking
| feerates
|
| The MIN_BUCKET_FEERATE should just
| be set to the lowest reasonable feerate
| we might ever want to track. Historically
| this has been 1000 since it was inheriting
| DEFAULT_MIN_RELAY_TX_FEE and changing
| it is disruptive as it invalidates old
| estimates files. So leave it at 1000
| unless it becomes necessary to lower
| it, and then lower it substantially.
|
*/
pub const MIN_BUCKET_FEERATE: f64 = 1000.0;
pub const MAX_BUCKET_FEERATE: f64 = 1.0e7;
/**
| Spacing of FeeRate buckets
|
| We have to lump transactions into buckets
| based on feerate, but we want to be able
| to give accurate estimates over a large
| range of potential feerates
|
| Therefore it makes sense to exponentially
| space the buckets
|
*/
pub const FEE_SPACING: f64 = 1.05;