tumbler.estimator
tumbler.estimator
Cost and time estimates for a tumble plan.
Surfaced by the CLI plan command (and reusable from the API) so users
can sanity-check the schedule before committing the wallet to it. None of
the figures here are guarantees: counterparty fees are bounded only by the
local max_cj_fee (the actual maker fee may be lower), miner-fee
estimates assume a typical sw0 CoinJoin tx size, and the duration estimate
is the sum of the persisted wait_seconds plus a per-phase budget.
Classes
PhaseCostEstimate
dataclass
Per-phase breakdown -- useful for tabular display.
Source code in tumbler/src/tumbler/estimator.py
65 66 67 68 69 70 71 72 73 74 75 76 | |
Attributes
description: str
instance-attribute
duration_seconds_expected: float
instance-attribute
duration_seconds_max: float
instance-attribute
duration_seconds_min: float
instance-attribute
index: int
instance-attribute
kind: str
instance-attribute
max_cj_fee_sats: int
instance-attribute
miner_fee_sats: int
instance-attribute
PlanEstimate
dataclass
Aggregate plan-level cost and time estimates.
Source code in tumbler/src/tumbler/estimator.py
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 126 127 | |
Attributes
confirmation_block_count: int = 0
class-attribute
instance-attribute
fee_rate_sat_vb: float = 0.0
class-attribute
instance-attribute
fee_rate_source: str = 'fallback'
class-attribute
instance-attribute
One of configured (settings.taker.fee_rate set), estimated
(settings.taker.fee_block_target set; rate inferred at plan time), or
fallback (neither set; using a conservative built-in default).
maker_phase_count: int
instance-attribute
mixdepth_balances: dict[int, int] = field(default_factory=dict)
class-attribute
instance-attribute
Snapshot of per-mixdepth balances used for sizing phases.
phases: list[PhaseCostEstimate] = field(default_factory=list)
class-attribute
instance-attribute
taker_phase_count: int
instance-attribute
total_balance_sats: int
instance-attribute
Sum of mixdepth_balances at plan time, in sats.
total_duration_seconds_expected: float = 0.0
class-attribute
instance-attribute
total_duration_seconds_max: float = 0.0
class-attribute
instance-attribute
total_duration_seconds_min: float = 0.0
class-attribute
instance-attribute
total_max_cj_fee_pct: float
property
CJ fee upper bound as a percentage of total balance.
total_max_cj_fee_sats: int = 0
class-attribute
instance-attribute
total_max_fee_pct: float
property
Total upper-bound fees as a percentage of total balance.
total_max_fee_sats: int
property
Upper bound on total fees (CJ counterparty fees + miner fees).
total_miner_fee_pct: float
property
Miner fee estimate as a percentage of total balance.
total_miner_fee_sats: int = 0
class-attribute
instance-attribute
total_wait_seconds: float = 0.0
class-attribute
instance-attribute
Functions:
estimate_plan_costs(plan: Plan, *, mixdepth_balances: Mapping[int, int] | None = None, max_cj_fee_abs_sats: int, max_cj_fee_rel: str | float, fee_rate_sat_vb: float | None = None, fee_rate_source: str | None = None, confirmation_block_count: int = 6, block_time_seconds: float = 600.0) -> PlanEstimate
Compute upper-bound CJ fees and miner-fee/time estimates for plan.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plan
|
Plan
|
The tumble plan to inspect. |
required |
mixdepth_balances
|
Mapping[int, int] | None
|
Current confirmed balance per mixdepth in sats. Used to size sweep
and fractional phases (which carry |
None
|
max_cj_fee_abs_sats
|
int
|
Local fee bounds taken from |
required |
max_cj_fee_rel
|
int
|
Local fee bounds taken from |
required |
fee_rate_sat_vb
|
float | None
|
Miner-fee rate used per CJ tx. When |
None
|
fee_rate_source
|
str | None
|
Optional label overriding the default classification of the fee
rate ( |
None
|
confirmation_block_count
|
int
|
|
6
|
block_time_seconds
|
float
|
Average inter-block time used for the confirmation wait. Defaults to mainnet's 600s; tests/regtest can pass a smaller value. |
600.0
|
Source code in tumbler/src/tumbler/estimator.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | |