| Crates.io | brk_grouper |
| lib.rs | brk_grouper |
| version | 0.1.0-alpha.1 |
| created_at | 2025-12-18 22:31:40.799883+00 |
| updated_at | 2025-12-21 12:27:42.65885+00 |
| description | Groups used throughout BRK |
| homepage | https://bitcoinresearchkit.org |
| repository | https://github.com/bitcoinresearchkit/brk |
| max_upload_size | |
| id | 1993689 |
| size | 125,836 |
UTXO and address cohort filtering for on-chain analytics.
Slice the UTXO set and address population by age, amount, output type, halving epoch, or holder classification (STH/LTH). Build complex cohorts by combining filters for metrics like "realized cap of 1+ BTC UTXOs older than 155 days."
TimeFilter::GreaterOrEqual(155), TimeFilter::Range(30..90), TimeFilter::LowerThan(7)AmountFilter::GreaterOrEqual(Sats::_1BTC), AmountFilter::Range(Sats::_100K..Sats::_1M)Term::Sth (short-term holders, <155 days), Term::Lth (long-term holders)utxos_, addrs_) based on cohort contextFilter::includes)pub enum Filter {
All,
Term(Term), // STH/LTH
Time(TimeFilter), // Age-based
Amount(AmountFilter), // Value-based
Epoch(HalvingEpoch), // Halving epoch
Type(OutputType), // P2PKH, P2TR, etc.
}
let filter = Filter::Time(TimeFilter::GreaterOrEqual(155));
// Check membership
filter.contains_time(200); // true
filter.contains_amount(sats);
// Generate metric names
filter.to_full_name(CohortContext::Utxo); // "utxos_min_age_155d"
brk_error for error handlingbrk_types for Sats, HalvingEpoch, OutputTypebrk_traversable for data structure traversal