brk-client 0.3.0-beta.2 → 0.3.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +455 -318
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -314,8 +314,8 @@ Matches mempool.space/bitcoin-cli behavior.
314
314
  */
315
315
  /**
316
316
  * Raw cents squared (u128) - stores cents² × sats without division.
317
- * Used for precise accumulation of investor cap values: Σ(price² × sats).
318
- * investor_price = investor_cap_raw / realized_cap_raw
317
+ * Used for precise accumulation of capitalized cap values: Σ(price² × sats).
318
+ * capitalized_price = capitalized_cap_raw / realized_cap_raw
319
319
  *
320
320
  * @typedef {number} CentsSquaredSats
321
321
  */
@@ -325,9 +325,9 @@ Matches mempool.space/bitcoin-cli behavior.
325
325
  * @typedef {Dollars} Close
326
326
  */
327
327
  /**
328
- * Cohort identifier for cost basis distribution.
328
+ * URPD cohort identifier. Use `GET /api/urpd` to list available cohorts.
329
329
  *
330
- * @typedef {string} Cohort
330
+ * @typedef {("all"|"sth"|"lth"|"utxos_under_1h_old"|"utxos_1h_to_1d_old"|"utxos_1d_to_1w_old"|"utxos_1w_to_1m_old"|"utxos_1m_to_2m_old"|"utxos_2m_to_3m_old"|"utxos_3m_to_4m_old"|"utxos_4m_to_5m_old"|"utxos_5m_to_6m_old"|"utxos_6m_to_1y_old"|"utxos_1y_to_2y_old"|"utxos_2y_to_3y_old"|"utxos_3y_to_4y_old"|"utxos_4y_to_5y_old"|"utxos_5y_to_6y_old"|"utxos_6y_to_7y_old"|"utxos_7y_to_8y_old"|"utxos_8y_to_10y_old"|"utxos_10y_to_12y_old"|"utxos_12y_to_15y_old"|"utxos_over_15y_old")} Cohort
331
331
  */
332
332
  /**
333
333
  * Coinbase scriptSig tag for pool identification.
@@ -341,35 +341,21 @@ Matches mempool.space/bitcoin-cli behavior.
341
341
  * @typedef {string} CoinbaseTag
342
342
  */
343
343
  /**
344
- * Bucket type for cost basis aggregation.
345
- * Options: raw (no aggregation), lin200/lin500/lin1000 (linear $200/$500/$1000),
346
- * log10/log50/log100/log200 (logarithmic with 10/50/100/200 buckets per decade).
347
- *
348
- * @typedef {("raw"|"lin200"|"lin500"|"lin1000"|"log10"|"log50"|"log100"|"log200")} CostBasisBucket
349
- */
350
- /**
351
- * Path parameters for cost basis dates endpoint.
352
- *
353
344
  * @typedef {Object} CostBasisCohortParam
354
345
  * @property {Cohort} cohort
355
346
  */
356
347
  /**
357
- * Path parameters for cost basis distribution endpoint.
358
- *
359
348
  * @typedef {Object} CostBasisParams
360
349
  * @property {Cohort} cohort
361
350
  * @property {string} date
362
351
  */
363
352
  /**
364
- * Query parameters for cost basis distribution endpoint.
365
- *
366
353
  * @typedef {Object} CostBasisQuery
367
- * @property {CostBasisBucket=} bucket - Bucket type for aggregation. Default: raw (no aggregation).
368
- * @property {CostBasisValue=} value - Value type to return. Default: supply.
354
+ * @property {UrpdAggregation=} bucket
355
+ * @property {CostBasisValue=} value
369
356
  */
370
357
  /**
371
- * Value type for cost basis distribution.
372
- * Options: supply (BTC), realized (USD, price × supply), unrealized (USD, spot × supply).
358
+ * Value type for the deprecated cost-basis distribution output.
373
359
  *
374
360
  * @typedef {("supply"|"realized"|"unrealized")} CostBasisValue
375
361
  */
@@ -516,7 +502,7 @@ Matches mempool.space/bitcoin-cli behavior.
516
502
  * @property {Sats} received - Satoshis received by this address
517
503
  * @property {Sats} sent - Satoshis sent by this address
518
504
  * @property {CentsSats} realizedCapRaw - The realized capitalization: Σ(price × sats)
519
- * @property {CentsSquaredSats} investorCapRaw - The investor capitalization: Σ(price² × sats)
505
+ * @property {CentsSquaredSats} capitalizedCapRaw - The capitalized cap: Σ(price² × sats)
520
506
  */
521
507
  /** @typedef {TypeIndex} FundedAddrIndex */
522
508
  /** @typedef {number} Halving */
@@ -626,7 +612,7 @@ Matches mempool.space/bitcoin-cli behavior.
626
612
  * Block info in a mempool.space like format for fee estimation.
627
613
  *
628
614
  * @typedef {Object} MempoolBlock
629
- * @property {number} blockSize - Total block size in weight units
615
+ * @property {number} blockSize - Total serialized block size in bytes (witness + non-witness).
630
616
  * @property {number} blockVSize - Total block virtual size in vbytes
631
617
  * @property {number} nTx - Number of transactions in the projected block
632
618
  * @property {Sats} totalFees - Total fees in satoshis
@@ -1159,6 +1145,58 @@ Matches mempool.space/bitcoin-cli behavior.
1159
1145
  /** @typedef {number[]} U8x33 */
1160
1146
  /** @typedef {number[]} U8x65 */
1161
1147
  /** @typedef {TypeIndex} UnknownOutputIndex */
1148
+ /**
1149
+ * UTXO Realized Price Distribution for a cohort on a specific date.
1150
+ *
1151
+ * Supply is grouped by the close price at which each UTXO was last moved.
1152
+ * Each bucket exposes three values derived from the same `(price_floor, supply)`
1153
+ * pairs: supply in BTC, realized cap contribution in USD (`price_floor * supply`),
1154
+ * and unrealized P&L against that date's close in USD
1155
+ * (`(close - price_floor) * supply`, can be negative).
1156
+ *
1157
+ * @typedef {Object} Urpd
1158
+ * @property {Cohort} cohort
1159
+ * @property {Date} date
1160
+ * @property {UrpdAggregation} aggregation - Aggregation strategy applied to the buckets.
1161
+ * @property {Dollars} close - Close price on `date`, in USD. Anchor for `unrealized_pnl`.
1162
+ * @property {Bitcoin} totalSupply - Sum of `supply` across all buckets, in BTC.
1163
+ * @property {UrpdBucket[]} buckets
1164
+ */
1165
+ /**
1166
+ * Aggregation strategy for URPD buckets.
1167
+ * Options: raw (no aggregation), lin200/lin500/lin1000 (linear $200/$500/$1000),
1168
+ * log10/log50/log100/log200 (logarithmic with 10/50/100/200 buckets per decade).
1169
+ *
1170
+ * @typedef {("raw"|"lin200"|"lin500"|"lin1000"|"log10"|"log50"|"log100"|"log200")} UrpdAggregation
1171
+ */
1172
+ /**
1173
+ * A single bucket in a URPD snapshot.
1174
+ *
1175
+ * @typedef {Object} UrpdBucket
1176
+ * @property {Dollars} priceFloor - Inclusive lower bound of the bucket, in USD.
1177
+ * @property {Bitcoin} supply - Supply held with a last-move price inside this bucket, in BTC.
1178
+ * @property {Dollars} realizedCap - Realized cap contribution in USD: `price_floor * supply`.
1179
+ * @property {Dollars} unrealizedPnl - Unrealized P&L in USD against the close on the snapshot date: `(close - price_floor) * supply`. Can be negative.
1180
+ */
1181
+ /**
1182
+ * Path parameters for per-cohort URPD endpoints.
1183
+ *
1184
+ * @typedef {Object} UrpdCohortParam
1185
+ * @property {Cohort} cohort
1186
+ */
1187
+ /**
1188
+ * Path parameters for `/api/urpd/{cohort}/{date}`.
1189
+ *
1190
+ * @typedef {Object} UrpdParams
1191
+ * @property {Cohort} cohort
1192
+ * @property {string} date
1193
+ */
1194
+ /**
1195
+ * Query parameters for URPD endpoints.
1196
+ *
1197
+ * @typedef {Object} UrpdQuery
1198
+ * @property {UrpdAggregation=} agg - Aggregation strategy. Default: raw (no aggregation). Accepts `bucket` as alias.
1199
+ */
1162
1200
  /**
1163
1201
  * Unspent transaction output
1164
1202
  *
@@ -2098,10 +2136,10 @@ function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern3(client, acc) {
2098
2136
  */
2099
2137
 
2100
2138
  /**
2101
- * @typedef {Object} CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern
2139
+ * @typedef {Object} CapCapitalizedGrossLossMvrvNetPeakPriceProfitSellSoprPattern
2102
2140
  * @property {CentsDeltaToUsdPattern} cap
2141
+ * @property {PricePattern} capitalized
2103
2142
  * @property {BlockCumulativeSumPattern} grossPnl
2104
- * @property {PricePattern} investor
2105
2143
  * @property {BlockCumulativeNegativeSumPattern} loss
2106
2144
  * @property {SeriesPattern1<StoredF32>} mvrv
2107
2145
  * @property {BlockChangeCumulativeDeltaSumPattern} netPnl
@@ -2109,7 +2147,7 @@ function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern3(client, acc) {
2109
2147
  * @property {BpsCentsPercentilesRatioSatsSmaStdUsdPattern} price
2110
2148
  * @property {BlockCumulativeSumPattern} profit
2111
2149
  * @property {_1m1w1y24hPattern<StoredF64>} profitToLossRatio
2112
- * @property {_1m1w1y24hPattern7} sellSideRiskRatio
2150
+ * @property {_1m1w1y24hPattern8} sellSideRiskRatio
2113
2151
  * @property {AdjustedRatioValuePattern} sopr
2114
2152
  */
2115
2153
 
@@ -2301,7 +2339,7 @@ function createIndexPct0Pct1Pct2Pct5Pct95Pct98Pct99ScorePattern(client, acc) {
2301
2339
  }
2302
2340
 
2303
2341
  /**
2304
- * @typedef {Object} AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5
2342
+ * @typedef {Object} AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6
2305
2343
  * @property {AverageBlockCumulativeSumPattern<StoredU64>} all
2306
2344
  * @property {AverageBlockCumulativeSumPattern<StoredU64>} p2a
2307
2345
  * @property {AverageBlockCumulativeSumPattern<StoredU64>} p2pk33
@@ -2314,12 +2352,12 @@ function createIndexPct0Pct1Pct2Pct5Pct95Pct98Pct99ScorePattern(client, acc) {
2314
2352
  */
2315
2353
 
2316
2354
  /**
2317
- * Create a AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5 pattern node
2355
+ * Create a AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6 pattern node
2318
2356
  * @param {BrkClientBase} client
2319
2357
  * @param {string} acc - Accumulated series name
2320
- * @returns {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5}
2358
+ * @returns {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6}
2321
2359
  */
2322
- function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5(client, acc) {
2360
+ function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6(client, acc) {
2323
2361
  return {
2324
2362
  all: createAverageBlockCumulativeSumPattern(client, acc),
2325
2363
  p2a: createAverageBlockCumulativeSumPattern(client, _p('p2a', acc)),
@@ -2334,7 +2372,7 @@ function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5(client, acc) {
2334
2372
  }
2335
2373
 
2336
2374
  /**
2337
- * @typedef {Object} AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3
2375
+ * @typedef {Object} AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4
2338
2376
  * @property {SeriesPattern1<StoredU64>} all
2339
2377
  * @property {SeriesPattern1<StoredU64>} p2a
2340
2378
  * @property {SeriesPattern1<StoredU64>} p2pk33
@@ -2347,12 +2385,12 @@ function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5(client, acc) {
2347
2385
  */
2348
2386
 
2349
2387
  /**
2350
- * Create a AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3 pattern node
2388
+ * Create a AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4 pattern node
2351
2389
  * @param {BrkClientBase} client
2352
2390
  * @param {string} acc - Accumulated series name
2353
- * @returns {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3}
2391
+ * @returns {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4}
2354
2392
  */
2355
- function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3(client, acc) {
2393
+ function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4(client, acc) {
2356
2394
  return {
2357
2395
  all: createSeriesPattern1(client, acc),
2358
2396
  p2a: createSeriesPattern1(client, _p('p2a', acc)),
@@ -2367,7 +2405,7 @@ function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3(client, acc) {
2367
2405
  }
2368
2406
 
2369
2407
  /**
2370
- * @typedef {Object} AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6
2408
+ * @typedef {Object} AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7
2371
2409
  * @property {_1m1w1y24hBpsPercentRatioPattern} all
2372
2410
  * @property {_1m1w1y24hBpsPercentRatioPattern} p2a
2373
2411
  * @property {_1m1w1y24hBpsPercentRatioPattern} p2pk33
@@ -2380,12 +2418,12 @@ function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3(client, acc) {
2380
2418
  */
2381
2419
 
2382
2420
  /**
2383
- * Create a AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6 pattern node
2421
+ * Create a AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7 pattern node
2384
2422
  * @param {BrkClientBase} client
2385
2423
  * @param {string} acc - Accumulated series name
2386
- * @returns {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6}
2424
+ * @returns {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7}
2387
2425
  */
2388
- function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6(client, acc) {
2426
+ function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7(client, acc) {
2389
2427
  return {
2390
2428
  all: create_1m1w1y24hBpsPercentRatioPattern(client, acc),
2391
2429
  p2a: create_1m1w1y24hBpsPercentRatioPattern(client, _p('p2a', acc)),
@@ -2433,11 +2471,11 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc) {
2433
2471
  }
2434
2472
 
2435
2473
  /**
2436
- * @typedef {Object} GrossInvestedInvestorLossNetNuplProfitSentimentPattern2
2474
+ * @typedef {Object} CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2
2475
+ * @property {SeriesPattern18<CentsSquaredSats>} capitalizedCapInLossRaw
2476
+ * @property {SeriesPattern18<CentsSquaredSats>} capitalizedCapInProfitRaw
2437
2477
  * @property {CentsUsdPattern3} grossPnl
2438
- * @property {InPattern} investedCapital
2439
- * @property {SeriesPattern18<CentsSquaredSats>} investorCapInLossRaw
2440
- * @property {SeriesPattern18<CentsSquaredSats>} investorCapInProfitRaw
2478
+ * @property {InPattern2} investedCapital
2441
2479
  * @property {CentsNegativeToUsdPattern2} loss
2442
2480
  * @property {CentsToUsdPattern3} netPnl
2443
2481
  * @property {BpsRatioPattern} nupl
@@ -2446,17 +2484,17 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc) {
2446
2484
  */
2447
2485
 
2448
2486
  /**
2449
- * Create a GrossInvestedInvestorLossNetNuplProfitSentimentPattern2 pattern node
2487
+ * Create a CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2 pattern node
2450
2488
  * @param {BrkClientBase} client
2451
2489
  * @param {string} acc - Accumulated series name
2452
- * @returns {GrossInvestedInvestorLossNetNuplProfitSentimentPattern2}
2490
+ * @returns {CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2}
2453
2491
  */
2454
- function createGrossInvestedInvestorLossNetNuplProfitSentimentPattern2(client, acc) {
2492
+ function createCapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2(client, acc) {
2455
2493
  return {
2494
+ capitalizedCapInLossRaw: createSeriesPattern18(client, _m(acc, 'capitalized_cap_in_loss_raw')),
2495
+ capitalizedCapInProfitRaw: createSeriesPattern18(client, _m(acc, 'capitalized_cap_in_profit_raw')),
2456
2496
  grossPnl: createCentsUsdPattern3(client, _m(acc, 'unrealized_gross_pnl')),
2457
- investedCapital: createInPattern(client, _m(acc, 'invested_capital_in')),
2458
- investorCapInLossRaw: createSeriesPattern18(client, _m(acc, 'investor_cap_in_loss_raw')),
2459
- investorCapInProfitRaw: createSeriesPattern18(client, _m(acc, 'investor_cap_in_profit_raw')),
2497
+ investedCapital: createInPattern2(client, _m(acc, 'invested_capital_in')),
2460
2498
  loss: createCentsNegativeToUsdPattern2(client, _m(acc, 'unrealized_loss')),
2461
2499
  netPnl: createCentsToUsdPattern3(client, _m(acc, 'net_unrealized_pnl')),
2462
2500
  nupl: createBpsRatioPattern(client, _m(acc, 'nupl')),
@@ -2717,7 +2755,7 @@ function create_1m1w1y2y4yAllPattern(client, acc) {
2717
2755
  * @property {BaseDeltaPattern} addrCount
2718
2756
  * @property {SpendingSpentUnspentPattern} outputs
2719
2757
  * @property {CapLossMvrvPriceProfitPattern} realized
2720
- * @property {DeltaTotalPattern} supply
2758
+ * @property {DeltaDominanceTotalPattern} supply
2721
2759
  * @property {NuplPattern} unrealized
2722
2760
  */
2723
2761
 
@@ -2733,7 +2771,7 @@ function createActivityAddrOutputsRealizedSupplyUnrealizedPattern(client, acc) {
2733
2771
  addrCount: createBaseDeltaPattern(client, _m(acc, 'addr_count')),
2734
2772
  outputs: createSpendingSpentUnspentPattern(client, acc),
2735
2773
  realized: createCapLossMvrvPriceProfitPattern(client, acc),
2736
- supply: createDeltaTotalPattern(client, _m(acc, 'supply')),
2774
+ supply: createDeltaDominanceTotalPattern(client, _m(acc, 'supply')),
2737
2775
  unrealized: createNuplPattern(client, _m(acc, 'nupl')),
2738
2776
  };
2739
2777
  }
@@ -2792,33 +2830,6 @@ function createBpsCentsPercentilesRatioSatsUsdPattern(client, acc) {
2792
2830
  };
2793
2831
  }
2794
2832
 
2795
- /**
2796
- * @typedef {Object} BtcCentsSatsToUsdPattern3
2797
- * @property {SeriesPattern1<Bitcoin>} btc
2798
- * @property {SeriesPattern1<Cents>} cents
2799
- * @property {SeriesPattern1<Sats>} sats
2800
- * @property {BpsPercentRatioPattern2} toCirculating
2801
- * @property {BpsPercentRatioPattern2} toOwn
2802
- * @property {SeriesPattern1<Dollars>} usd
2803
- */
2804
-
2805
- /**
2806
- * Create a BtcCentsSatsToUsdPattern3 pattern node
2807
- * @param {BrkClientBase} client
2808
- * @param {string} acc - Accumulated series name
2809
- * @returns {BtcCentsSatsToUsdPattern3}
2810
- */
2811
- function createBtcCentsSatsToUsdPattern3(client, acc) {
2812
- return {
2813
- btc: createSeriesPattern1(client, acc),
2814
- cents: createSeriesPattern1(client, _m(acc, 'cents')),
2815
- sats: createSeriesPattern1(client, _m(acc, 'sats')),
2816
- toCirculating: createBpsPercentRatioPattern2(client, _m(acc, 'to_circulating')),
2817
- toOwn: createBpsPercentRatioPattern2(client, _m(acc, 'to_own')),
2818
- usd: createSeriesPattern1(client, _m(acc, 'usd')),
2819
- };
2820
- }
2821
-
2822
2833
  /**
2823
2834
  * @typedef {Object} CentsNegativeToUsdPattern2
2824
2835
  * @property {SeriesPattern1<Cents>} cents
@@ -2847,55 +2858,55 @@ function createCentsNegativeToUsdPattern2(client, acc) {
2847
2858
  }
2848
2859
 
2849
2860
  /**
2850
- * @typedef {Object} DeltaHalfInToTotalPattern
2851
- * @property {AbsoluteRatePattern} delta
2861
+ * @typedef {Object} DeltaDominanceHalfInTotalPattern2
2862
+ * @property {AbsoluteRatePattern3} delta
2863
+ * @property {BpsPercentRatioPattern2} dominance
2852
2864
  * @property {BtcCentsSatsUsdPattern} half
2853
- * @property {BtcCentsSatsToUsdPattern} inLoss
2854
- * @property {BtcCentsSatsToUsdPattern} inProfit
2855
- * @property {BpsPercentRatioPattern2} toCirculating
2865
+ * @property {BtcCentsSatsShareUsdPattern} inLoss
2866
+ * @property {BtcCentsSatsShareUsdPattern} inProfit
2856
2867
  * @property {BtcCentsSatsUsdPattern} total
2857
2868
  */
2858
2869
 
2859
2870
  /**
2860
- * Create a DeltaHalfInToTotalPattern pattern node
2871
+ * Create a DeltaDominanceHalfInTotalPattern2 pattern node
2861
2872
  * @param {BrkClientBase} client
2862
2873
  * @param {string} acc - Accumulated series name
2863
- * @returns {DeltaHalfInToTotalPattern}
2874
+ * @returns {DeltaDominanceHalfInTotalPattern2}
2864
2875
  */
2865
- function createDeltaHalfInToTotalPattern(client, acc) {
2876
+ function createDeltaDominanceHalfInTotalPattern2(client, acc) {
2866
2877
  return {
2867
- delta: createAbsoluteRatePattern(client, _m(acc, 'delta')),
2878
+ delta: createAbsoluteRatePattern3(client, _m(acc, 'delta')),
2879
+ dominance: createBpsPercentRatioPattern2(client, _m(acc, 'dominance')),
2868
2880
  half: createBtcCentsSatsUsdPattern(client, _m(acc, 'half')),
2869
- inLoss: createBtcCentsSatsToUsdPattern(client, _m(acc, 'in_loss')),
2870
- inProfit: createBtcCentsSatsToUsdPattern(client, _m(acc, 'in_profit')),
2871
- toCirculating: createBpsPercentRatioPattern2(client, _m(acc, 'to_circulating')),
2881
+ inLoss: createBtcCentsSatsShareUsdPattern(client, _m(acc, 'in_loss')),
2882
+ inProfit: createBtcCentsSatsShareUsdPattern(client, _m(acc, 'in_profit')),
2872
2883
  total: createBtcCentsSatsUsdPattern(client, acc),
2873
2884
  };
2874
2885
  }
2875
2886
 
2876
2887
  /**
2877
- * @typedef {Object} DeltaHalfInToTotalPattern2
2878
- * @property {AbsoluteRatePattern} delta
2888
+ * @typedef {Object} DeltaDominanceHalfInTotalPattern
2889
+ * @property {AbsoluteRatePattern3} delta
2890
+ * @property {BpsPercentRatioPattern2} dominance
2879
2891
  * @property {BtcCentsSatsUsdPattern} half
2880
- * @property {BtcCentsSatsToUsdPattern3} inLoss
2881
- * @property {BtcCentsSatsToUsdPattern3} inProfit
2882
- * @property {BpsPercentRatioPattern2} toCirculating
2892
+ * @property {BtcCentsSatsUsdPattern} inLoss
2893
+ * @property {BtcCentsSatsUsdPattern} inProfit
2883
2894
  * @property {BtcCentsSatsUsdPattern} total
2884
2895
  */
2885
2896
 
2886
2897
  /**
2887
- * Create a DeltaHalfInToTotalPattern2 pattern node
2898
+ * Create a DeltaDominanceHalfInTotalPattern pattern node
2888
2899
  * @param {BrkClientBase} client
2889
2900
  * @param {string} acc - Accumulated series name
2890
- * @returns {DeltaHalfInToTotalPattern2}
2901
+ * @returns {DeltaDominanceHalfInTotalPattern}
2891
2902
  */
2892
- function createDeltaHalfInToTotalPattern2(client, acc) {
2903
+ function createDeltaDominanceHalfInTotalPattern(client, acc) {
2893
2904
  return {
2894
- delta: createAbsoluteRatePattern(client, _m(acc, 'delta')),
2905
+ delta: createAbsoluteRatePattern3(client, _m(acc, 'delta')),
2906
+ dominance: createBpsPercentRatioPattern2(client, _m(acc, 'dominance')),
2895
2907
  half: createBtcCentsSatsUsdPattern(client, _m(acc, 'half')),
2896
- inLoss: createBtcCentsSatsToUsdPattern3(client, _m(acc, 'in_loss')),
2897
- inProfit: createBtcCentsSatsToUsdPattern3(client, _m(acc, 'in_profit')),
2898
- toCirculating: createBpsPercentRatioPattern2(client, _m(acc, 'to_circulating')),
2908
+ inLoss: createBtcCentsSatsUsdPattern(client, _m(acc, 'in_loss')),
2909
+ inProfit: createBtcCentsSatsUsdPattern(client, _m(acc, 'in_profit')),
2899
2910
  total: createBtcCentsSatsUsdPattern(client, acc),
2900
2911
  };
2901
2912
  }
@@ -2955,7 +2966,7 @@ function createActiveBidirectionalReactivatedReceivingSendingPattern(client, acc
2955
2966
  * @property {CoindaysTransferPattern} activity
2956
2967
  * @property {SpendingSpentUnspentPattern} outputs
2957
2968
  * @property {CapLossMvrvNetPriceProfitSoprPattern} realized
2958
- * @property {DeltaHalfInToTotalPattern} supply
2969
+ * @property {DeltaDominanceHalfInTotalPattern} supply
2959
2970
  * @property {LossNetNuplProfitPattern} unrealized
2960
2971
  */
2961
2972
 
@@ -2970,7 +2981,7 @@ function createActivityOutputsRealizedSupplyUnrealizedPattern(client, acc) {
2970
2981
  activity: createCoindaysTransferPattern(client, acc),
2971
2982
  outputs: createSpendingSpentUnspentPattern(client, acc),
2972
2983
  realized: createCapLossMvrvNetPriceProfitSoprPattern(client, acc),
2973
- supply: createDeltaHalfInToTotalPattern(client, _m(acc, 'supply')),
2984
+ supply: createDeltaDominanceHalfInTotalPattern(client, _m(acc, 'supply')),
2974
2985
  unrealized: createLossNetNuplProfitPattern(client, acc),
2975
2986
  };
2976
2987
  }
@@ -2980,7 +2991,7 @@ function createActivityOutputsRealizedSupplyUnrealizedPattern(client, acc) {
2980
2991
  * @property {TransferPattern} activity
2981
2992
  * @property {SpendingSpentUnspentPattern} outputs
2982
2993
  * @property {CapLossMvrvPriceProfitPattern} realized
2983
- * @property {DeltaHalfInTotalPattern2} supply
2994
+ * @property {DeltaDominanceHalfInTotalPattern} supply
2984
2995
  * @property {LossNuplProfitPattern} unrealized
2985
2996
  */
2986
2997
 
@@ -2995,7 +3006,7 @@ function createActivityOutputsRealizedSupplyUnrealizedPattern3(client, acc) {
2995
3006
  activity: createTransferPattern(client, _m(acc, 'transfer_volume')),
2996
3007
  outputs: createSpendingSpentUnspentPattern(client, acc),
2997
3008
  realized: createCapLossMvrvPriceProfitPattern(client, acc),
2998
- supply: createDeltaHalfInTotalPattern2(client, _m(acc, 'supply')),
3009
+ supply: createDeltaDominanceHalfInTotalPattern(client, _m(acc, 'supply')),
2999
3010
  unrealized: createLossNuplProfitPattern(client, acc),
3000
3011
  };
3001
3012
  }
@@ -3005,7 +3016,7 @@ function createActivityOutputsRealizedSupplyUnrealizedPattern3(client, acc) {
3005
3016
  * @property {TransferPattern} activity
3006
3017
  * @property {SpendingSpentUnspentPattern} outputs
3007
3018
  * @property {CapLossMvrvPriceProfitPattern} realized
3008
- * @property {DeltaTotalPattern} supply
3019
+ * @property {DeltaDominanceTotalPattern} supply
3009
3020
  * @property {NuplPattern} unrealized
3010
3021
  */
3011
3022
 
@@ -3020,7 +3031,7 @@ function createActivityOutputsRealizedSupplyUnrealizedPattern2(client, acc) {
3020
3031
  activity: createTransferPattern(client, _m(acc, 'transfer_volume')),
3021
3032
  outputs: createSpendingSpentUnspentPattern(client, acc),
3022
3033
  realized: createCapLossMvrvPriceProfitPattern(client, acc),
3023
- supply: createDeltaTotalPattern(client, _m(acc, 'supply')),
3034
+ supply: createDeltaDominanceTotalPattern(client, _m(acc, 'supply')),
3024
3035
  unrealized: createNuplPattern(client, _m(acc, 'nupl')),
3025
3036
  };
3026
3037
  }
@@ -3079,7 +3090,7 @@ function createBpsCentsRatioSatsUsdPattern(client, acc) {
3079
3090
  * @typedef {Object} BtcCentsDeltaSatsUsdPattern
3080
3091
  * @property {SeriesPattern1<Bitcoin>} btc
3081
3092
  * @property {SeriesPattern1<Cents>} cents
3082
- * @property {AbsoluteRatePattern} delta
3093
+ * @property {AbsoluteRatePattern3} delta
3083
3094
  * @property {SeriesPattern1<Sats>} sats
3084
3095
  * @property {SeriesPattern1<Dollars>} usd
3085
3096
  */
@@ -3094,58 +3105,33 @@ function createBtcCentsDeltaSatsUsdPattern(client, acc) {
3094
3105
  return {
3095
3106
  btc: createSeriesPattern1(client, acc),
3096
3107
  cents: createSeriesPattern1(client, _m(acc, 'cents')),
3097
- delta: createAbsoluteRatePattern(client, _m(acc, 'delta')),
3108
+ delta: createAbsoluteRatePattern3(client, _m(acc, 'delta')),
3098
3109
  sats: createSeriesPattern1(client, _m(acc, 'sats')),
3099
3110
  usd: createSeriesPattern1(client, _m(acc, 'usd')),
3100
3111
  };
3101
3112
  }
3102
3113
 
3103
3114
  /**
3104
- * @typedef {Object} BtcCentsSatsToUsdPattern
3115
+ * @typedef {Object} BtcCentsSatsShareUsdPattern
3105
3116
  * @property {SeriesPattern1<Bitcoin>} btc
3106
3117
  * @property {SeriesPattern1<Cents>} cents
3107
3118
  * @property {SeriesPattern1<Sats>} sats
3108
- * @property {BpsPercentRatioPattern2} toCirculating
3119
+ * @property {BpsPercentRatioPattern2} share
3109
3120
  * @property {SeriesPattern1<Dollars>} usd
3110
3121
  */
3111
3122
 
3112
3123
  /**
3113
- * Create a BtcCentsSatsToUsdPattern pattern node
3124
+ * Create a BtcCentsSatsShareUsdPattern pattern node
3114
3125
  * @param {BrkClientBase} client
3115
3126
  * @param {string} acc - Accumulated series name
3116
- * @returns {BtcCentsSatsToUsdPattern}
3127
+ * @returns {BtcCentsSatsShareUsdPattern}
3117
3128
  */
3118
- function createBtcCentsSatsToUsdPattern(client, acc) {
3129
+ function createBtcCentsSatsShareUsdPattern(client, acc) {
3119
3130
  return {
3120
3131
  btc: createSeriesPattern1(client, acc),
3121
3132
  cents: createSeriesPattern1(client, _m(acc, 'cents')),
3122
3133
  sats: createSeriesPattern1(client, _m(acc, 'sats')),
3123
- toCirculating: createBpsPercentRatioPattern2(client, _m(acc, 'to_circulating')),
3124
- usd: createSeriesPattern1(client, _m(acc, 'usd')),
3125
- };
3126
- }
3127
-
3128
- /**
3129
- * @typedef {Object} BtcCentsSatsToUsdPattern2
3130
- * @property {SeriesPattern1<Bitcoin>} btc
3131
- * @property {SeriesPattern1<Cents>} cents
3132
- * @property {SeriesPattern1<Sats>} sats
3133
- * @property {BpsPercentRatioPattern2} toOwn
3134
- * @property {SeriesPattern1<Dollars>} usd
3135
- */
3136
-
3137
- /**
3138
- * Create a BtcCentsSatsToUsdPattern2 pattern node
3139
- * @param {BrkClientBase} client
3140
- * @param {string} acc - Accumulated series name
3141
- * @returns {BtcCentsSatsToUsdPattern2}
3142
- */
3143
- function createBtcCentsSatsToUsdPattern2(client, acc) {
3144
- return {
3145
- btc: createSeriesPattern1(client, acc),
3146
- cents: createSeriesPattern1(client, _m(acc, 'cents')),
3147
- sats: createSeriesPattern1(client, _m(acc, 'sats')),
3148
- toOwn: createBpsPercentRatioPattern2(client, _m(acc, 'to_own')),
3134
+ share: createBpsPercentRatioPattern2(client, _m(acc, 'share')),
3149
3135
  usd: createSeriesPattern1(client, _m(acc, 'usd')),
3150
3136
  };
3151
3137
  }
@@ -3200,31 +3186,6 @@ function createCentsToUsdPattern4(client, acc) {
3200
3186
  };
3201
3187
  }
3202
3188
 
3203
- /**
3204
- * @typedef {Object} DeltaHalfInTotalPattern2
3205
- * @property {AbsoluteRatePattern} delta
3206
- * @property {BtcCentsSatsUsdPattern} half
3207
- * @property {BtcCentsSatsUsdPattern} inLoss
3208
- * @property {BtcCentsSatsUsdPattern} inProfit
3209
- * @property {BtcCentsSatsUsdPattern} total
3210
- */
3211
-
3212
- /**
3213
- * Create a DeltaHalfInTotalPattern2 pattern node
3214
- * @param {BrkClientBase} client
3215
- * @param {string} acc - Accumulated series name
3216
- * @returns {DeltaHalfInTotalPattern2}
3217
- */
3218
- function createDeltaHalfInTotalPattern2(client, acc) {
3219
- return {
3220
- delta: createAbsoluteRatePattern(client, _m(acc, 'delta')),
3221
- half: createBtcCentsSatsUsdPattern(client, _m(acc, 'half')),
3222
- inLoss: createBtcCentsSatsUsdPattern(client, _m(acc, 'in_loss')),
3223
- inProfit: createBtcCentsSatsUsdPattern(client, _m(acc, 'in_profit')),
3224
- total: createBtcCentsSatsUsdPattern(client, acc),
3225
- };
3226
- }
3227
-
3228
3189
  /**
3229
3190
  * @typedef {Object} EmaHistogramLineSignalPattern
3230
3191
  * @property {SeriesPattern1<StoredF32>} emaFast
@@ -3283,7 +3244,7 @@ function create_1m1w1y24hPattern2(client, acc) {
3283
3244
  }
3284
3245
 
3285
3246
  /**
3286
- * @typedef {Object} _1m1w1y24hPattern7
3247
+ * @typedef {Object} _1m1w1y24hPattern8
3287
3248
  * @property {BpsPercentRatioPattern4} _1m
3288
3249
  * @property {BpsPercentRatioPattern4} _1w
3289
3250
  * @property {BpsPercentRatioPattern4} _1y
@@ -3291,12 +3252,12 @@ function create_1m1w1y24hPattern2(client, acc) {
3291
3252
  */
3292
3253
 
3293
3254
  /**
3294
- * Create a _1m1w1y24hPattern7 pattern node
3255
+ * Create a _1m1w1y24hPattern8 pattern node
3295
3256
  * @param {BrkClientBase} client
3296
3257
  * @param {string} acc - Accumulated series name
3297
- * @returns {_1m1w1y24hPattern7}
3258
+ * @returns {_1m1w1y24hPattern8}
3298
3259
  */
3299
- function create_1m1w1y24hPattern7(client, acc) {
3260
+ function create_1m1w1y24hPattern8(client, acc) {
3300
3261
  return {
3301
3262
  _1m: createBpsPercentRatioPattern4(client, _m(acc, '1m')),
3302
3263
  _1w: createBpsPercentRatioPattern4(client, _m(acc, '1w')),
@@ -3351,6 +3312,29 @@ function create_1m1w1y24hPattern3(client, acc) {
3351
3312
  };
3352
3313
  }
3353
3314
 
3315
+ /**
3316
+ * @typedef {Object} _1m1w1y24hPattern7
3317
+ * @property {BtcSatsPattern} _1m
3318
+ * @property {BtcSatsPattern} _1w
3319
+ * @property {BtcSatsPattern} _1y
3320
+ * @property {BtcSatsPattern} _24h
3321
+ */
3322
+
3323
+ /**
3324
+ * Create a _1m1w1y24hPattern7 pattern node
3325
+ * @param {BrkClientBase} client
3326
+ * @param {string} acc - Accumulated series name
3327
+ * @returns {_1m1w1y24hPattern7}
3328
+ */
3329
+ function create_1m1w1y24hPattern7(client, acc) {
3330
+ return {
3331
+ _1m: createBtcSatsPattern(client, _m(acc, '1m')),
3332
+ _1w: createBtcSatsPattern(client, _m(acc, '1w')),
3333
+ _1y: createBtcSatsPattern(client, _m(acc, '1y')),
3334
+ _24h: createBtcSatsPattern(client, _m(acc, '24h')),
3335
+ };
3336
+ }
3337
+
3354
3338
  /**
3355
3339
  * @typedef {Object} _1m1w1y2wPattern
3356
3340
  * @property {CentsSatsUsdPattern} _1m
@@ -4028,6 +4012,27 @@ function createCumulativeRollingSumPattern(client, acc) {
4028
4012
  };
4029
4013
  }
4030
4014
 
4015
+ /**
4016
+ * @typedef {Object} DeltaDominanceTotalPattern
4017
+ * @property {AbsoluteRatePattern3} delta
4018
+ * @property {BpsPercentRatioPattern2} dominance
4019
+ * @property {BtcCentsSatsUsdPattern} total
4020
+ */
4021
+
4022
+ /**
4023
+ * Create a DeltaDominanceTotalPattern pattern node
4024
+ * @param {BrkClientBase} client
4025
+ * @param {string} acc - Accumulated series name
4026
+ * @returns {DeltaDominanceTotalPattern}
4027
+ */
4028
+ function createDeltaDominanceTotalPattern(client, acc) {
4029
+ return {
4030
+ delta: createAbsoluteRatePattern3(client, _m(acc, 'delta')),
4031
+ dominance: createBpsPercentRatioPattern2(client, _m(acc, 'dominance')),
4032
+ total: createBtcCentsSatsUsdPattern(client, acc),
4033
+ };
4034
+ }
4035
+
4031
4036
  /**
4032
4037
  * @typedef {Object} GreedNetPainPattern
4033
4038
  * @property {CentsUsdPattern3} greedIndex
@@ -4195,6 +4200,44 @@ function createAbsoluteRatePattern2(client, acc) {
4195
4200
  };
4196
4201
  }
4197
4202
 
4203
+ /**
4204
+ * @typedef {Object} AbsoluteRatePattern3
4205
+ * @property {_1m1w1y24hPattern7} absolute
4206
+ * @property {_1m1w1y24hPattern2} rate
4207
+ */
4208
+
4209
+ /**
4210
+ * Create a AbsoluteRatePattern3 pattern node
4211
+ * @param {BrkClientBase} client
4212
+ * @param {string} acc - Accumulated series name
4213
+ * @returns {AbsoluteRatePattern3}
4214
+ */
4215
+ function createAbsoluteRatePattern3(client, acc) {
4216
+ return {
4217
+ absolute: create_1m1w1y24hPattern7(client, acc),
4218
+ rate: create_1m1w1y24hPattern2(client, acc),
4219
+ };
4220
+ }
4221
+
4222
+ /**
4223
+ * @typedef {Object} AddrUtxoPattern
4224
+ * @property {BtcCentsSatsUsdPattern} addr
4225
+ * @property {BtcCentsSatsUsdPattern} utxo
4226
+ */
4227
+
4228
+ /**
4229
+ * Create a AddrUtxoPattern pattern node
4230
+ * @param {BrkClientBase} client
4231
+ * @param {string} acc - Accumulated series name
4232
+ * @returns {AddrUtxoPattern}
4233
+ */
4234
+ function createAddrUtxoPattern(client, acc) {
4235
+ return {
4236
+ addr: createBtcCentsSatsUsdPattern(client, _m(acc, 'addr_amount')),
4237
+ utxo: createBtcCentsSatsUsdPattern(client, _m(acc, 'utxo_amount')),
4238
+ };
4239
+ }
4240
+
4198
4241
  /**
4199
4242
  * @typedef {Object} AllSthPattern2
4200
4243
  * @property {BtcCentsDeltaSatsUsdPattern} all
@@ -4348,6 +4391,25 @@ function createBpsRatioPattern(client, acc) {
4348
4391
  };
4349
4392
  }
4350
4393
 
4394
+ /**
4395
+ * @typedef {Object} BtcSatsPattern
4396
+ * @property {SeriesPattern1<Bitcoin>} btc
4397
+ * @property {SeriesPattern1<SatsSigned>} sats
4398
+ */
4399
+
4400
+ /**
4401
+ * Create a BtcSatsPattern pattern node
4402
+ * @param {BrkClientBase} client
4403
+ * @param {string} acc - Accumulated series name
4404
+ * @returns {BtcSatsPattern}
4405
+ */
4406
+ function createBtcSatsPattern(client, acc) {
4407
+ return {
4408
+ btc: createSeriesPattern1(client, acc),
4409
+ sats: createSeriesPattern1(client, _m(acc, 'sats')),
4410
+ };
4411
+ }
4412
+
4351
4413
  /**
4352
4414
  * @typedef {Object} CentsUsdPattern3
4353
4415
  * @property {SeriesPattern1<Cents>} cents
@@ -4444,47 +4506,47 @@ function createCoindaysTransferPattern(client, acc) {
4444
4506
  }
4445
4507
 
4446
4508
  /**
4447
- * @typedef {Object} DeltaTotalPattern
4448
- * @property {AbsoluteRatePattern} delta
4449
- * @property {BtcCentsSatsUsdPattern} total
4509
+ * @typedef {Object} FundedTotalPattern
4510
+ * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4} funded
4511
+ * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4} total
4450
4512
  */
4451
4513
 
4452
4514
  /**
4453
- * Create a DeltaTotalPattern pattern node
4515
+ * Create a FundedTotalPattern pattern node
4454
4516
  * @param {BrkClientBase} client
4455
4517
  * @param {string} acc - Accumulated series name
4456
- * @returns {DeltaTotalPattern}
4518
+ * @returns {FundedTotalPattern}
4457
4519
  */
4458
- function createDeltaTotalPattern(client, acc) {
4520
+ function createFundedTotalPattern(client, acc) {
4459
4521
  return {
4460
- delta: createAbsoluteRatePattern(client, _m(acc, 'delta')),
4461
- total: createBtcCentsSatsUsdPattern(client, acc),
4522
+ funded: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4(client, acc),
4523
+ total: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4(client, _p('total', acc)),
4462
4524
  };
4463
4525
  }
4464
4526
 
4465
4527
  /**
4466
- * @typedef {Object} FundedTotalPattern
4467
- * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3} funded
4468
- * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3} total
4528
+ * @typedef {Object} InPattern2
4529
+ * @property {CentsUsdPattern3} inLoss
4530
+ * @property {CentsUsdPattern3} inProfit
4469
4531
  */
4470
4532
 
4471
4533
  /**
4472
- * Create a FundedTotalPattern pattern node
4534
+ * Create a InPattern2 pattern node
4473
4535
  * @param {BrkClientBase} client
4474
4536
  * @param {string} acc - Accumulated series name
4475
- * @returns {FundedTotalPattern}
4537
+ * @returns {InPattern2}
4476
4538
  */
4477
- function createFundedTotalPattern(client, acc) {
4539
+ function createInPattern2(client, acc) {
4478
4540
  return {
4479
- funded: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3(client, acc),
4480
- total: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3(client, _p('total', acc)),
4541
+ inLoss: createCentsUsdPattern3(client, _m(acc, 'loss')),
4542
+ inProfit: createCentsUsdPattern3(client, _m(acc, 'profit')),
4481
4543
  };
4482
4544
  }
4483
4545
 
4484
4546
  /**
4485
4547
  * @typedef {Object} InPattern
4486
- * @property {CentsUsdPattern3} inLoss
4487
- * @property {CentsUsdPattern3} inProfit
4548
+ * @property {SharePattern} inLoss
4549
+ * @property {SharePattern} inProfit
4488
4550
  */
4489
4551
 
4490
4552
  /**
@@ -4495,8 +4557,8 @@ function createFundedTotalPattern(client, acc) {
4495
4557
  */
4496
4558
  function createInPattern(client, acc) {
4497
4559
  return {
4498
- inLoss: createCentsUsdPattern3(client, _m(acc, 'loss')),
4499
- inProfit: createCentsUsdPattern3(client, _m(acc, 'profit')),
4560
+ inLoss: createSharePattern(client, _m(acc, 'loss_share')),
4561
+ inProfit: createSharePattern(client, _m(acc, 'profit_share')),
4500
4562
  };
4501
4563
  }
4502
4564
 
@@ -4634,6 +4696,23 @@ function createPricePattern(client, acc) {
4634
4696
  };
4635
4697
  }
4636
4698
 
4699
+ /**
4700
+ * @typedef {Object} SharePattern
4701
+ * @property {BpsPercentRatioPattern2} share
4702
+ */
4703
+
4704
+ /**
4705
+ * Create a SharePattern pattern node
4706
+ * @param {BrkClientBase} client
4707
+ * @param {string} acc - Accumulated series name
4708
+ * @returns {SharePattern}
4709
+ */
4710
+ function createSharePattern(client, acc) {
4711
+ return {
4712
+ share: createBpsPercentRatioPattern2(client, acc),
4713
+ };
4714
+ }
4715
+
4637
4716
  /**
4638
4717
  * @typedef {Object} TransferPattern
4639
4718
  * @property {AverageBlockCumulativeSumPattern3} transferVolume
@@ -5028,14 +5107,15 @@ function createTransferPattern(client, acc) {
5028
5107
  * @property {SeriesTree_Addrs_Raw} raw
5029
5108
  * @property {SeriesTree_Addrs_Indexes} indexes
5030
5109
  * @property {SeriesTree_Addrs_Data} data
5031
- * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3} funded
5032
- * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3} empty
5110
+ * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4} funded
5111
+ * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4} empty
5033
5112
  * @property {SeriesTree_Addrs_Activity} activity
5034
- * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3} total
5035
- * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5} new
5113
+ * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4} total
5114
+ * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6} new
5036
5115
  * @property {SeriesTree_Addrs_Reused} reused
5037
5116
  * @property {SeriesTree_Addrs_Exposed} exposed
5038
5117
  * @property {SeriesTree_Addrs_Delta} delta
5118
+ * @property {SeriesTree_Addrs_AvgAmount} avgAmount
5039
5119
  */
5040
5120
 
5041
5121
  /**
@@ -5148,11 +5228,11 @@ function createTransferPattern(client, acc) {
5148
5228
 
5149
5229
  /**
5150
5230
  * @typedef {Object} SeriesTree_Addrs_Reused_Events
5151
- * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5} outputToReusedAddrCount
5152
- * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6} outputToReusedAddrShare
5231
+ * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6} outputToReusedAddrCount
5232
+ * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7} outputToReusedAddrShare
5153
5233
  * @property {_1m1w1y24hBpsPercentRatioPattern} spendableOutputToReusedAddrShare
5154
- * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5} inputFromReusedAddrCount
5155
- * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6} inputFromReusedAddrShare
5234
+ * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6} inputFromReusedAddrCount
5235
+ * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7} inputFromReusedAddrShare
5156
5236
  * @property {_1m1w1y24hBlockPattern} activeReusedAddrCount
5157
5237
  * @property {SeriesTree_Addrs_Reused_Events_ActiveReusedAddrShare} activeReusedAddrShare
5158
5238
  */
@@ -5183,6 +5263,20 @@ function createTransferPattern(client, acc) {
5183
5263
  * @property {BtcCentsSatsUsdPattern} p2wsh
5184
5264
  * @property {BtcCentsSatsUsdPattern} p2tr
5185
5265
  * @property {BtcCentsSatsUsdPattern} p2a
5266
+ * @property {SeriesTree_Addrs_Exposed_Supply_Share} share
5267
+ */
5268
+
5269
+ /**
5270
+ * @typedef {Object} SeriesTree_Addrs_Exposed_Supply_Share
5271
+ * @property {BpsPercentRatioPattern2} all
5272
+ * @property {BpsPercentRatioPattern2} p2pk65
5273
+ * @property {BpsPercentRatioPattern2} p2pk33
5274
+ * @property {BpsPercentRatioPattern2} p2pkh
5275
+ * @property {BpsPercentRatioPattern2} p2sh
5276
+ * @property {BpsPercentRatioPattern2} p2wpkh
5277
+ * @property {BpsPercentRatioPattern2} p2wsh
5278
+ * @property {BpsPercentRatioPattern2} p2tr
5279
+ * @property {BpsPercentRatioPattern2} p2a
5186
5280
  */
5187
5281
 
5188
5282
  /**
@@ -5198,6 +5292,19 @@ function createTransferPattern(client, acc) {
5198
5292
  * @property {AbsoluteRatePattern} p2a
5199
5293
  */
5200
5294
 
5295
+ /**
5296
+ * @typedef {Object} SeriesTree_Addrs_AvgAmount
5297
+ * @property {AddrUtxoPattern} all
5298
+ * @property {AddrUtxoPattern} p2pk65
5299
+ * @property {AddrUtxoPattern} p2pk33
5300
+ * @property {AddrUtxoPattern} p2pkh
5301
+ * @property {AddrUtxoPattern} p2sh
5302
+ * @property {AddrUtxoPattern} p2wpkh
5303
+ * @property {AddrUtxoPattern} p2wsh
5304
+ * @property {AddrUtxoPattern} p2tr
5305
+ * @property {AddrUtxoPattern} p2a
5306
+ */
5307
+
5201
5308
  /**
5202
5309
  * @typedef {Object} SeriesTree_Scripts
5203
5310
  * @property {SeriesTree_Scripts_Raw} raw
@@ -6217,21 +6324,13 @@ function createTransferPattern(client, acc) {
6217
6324
 
6218
6325
  /**
6219
6326
  * @typedef {Object} SeriesTree_Cohorts_Utxo_All
6220
- * @property {SeriesTree_Cohorts_Utxo_All_Supply} supply
6327
+ * @property {DeltaDominanceHalfInTotalPattern2} supply
6221
6328
  * @property {SeriesTree_Cohorts_Utxo_All_Outputs} outputs
6222
6329
  * @property {SeriesTree_Cohorts_Utxo_All_Activity} activity
6223
6330
  * @property {SeriesTree_Cohorts_Utxo_All_Realized} realized
6224
6331
  * @property {SeriesTree_Cohorts_Utxo_All_CostBasis} costBasis
6225
6332
  * @property {SeriesTree_Cohorts_Utxo_All_Unrealized} unrealized
6226
- */
6227
-
6228
- /**
6229
- * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Supply
6230
- * @property {BtcCentsSatsUsdPattern} total
6231
- * @property {AbsoluteRatePattern} delta
6232
- * @property {BtcCentsSatsUsdPattern} half
6233
- * @property {BtcCentsSatsToUsdPattern2} inProfit
6234
- * @property {BtcCentsSatsToUsdPattern2} inLoss
6333
+ * @property {InPattern} investedCapital
6235
6334
  */
6236
6335
 
6237
6336
  /**
@@ -6259,9 +6358,9 @@ function createTransferPattern(client, acc) {
6259
6358
  * @property {BlockChangeCumulativeDeltaSumPattern} netPnl
6260
6359
  * @property {SeriesTree_Cohorts_Utxo_All_Realized_Sopr} sopr
6261
6360
  * @property {BlockCumulativeSumPattern} grossPnl
6262
- * @property {_1m1w1y24hPattern7} sellSideRiskRatio
6361
+ * @property {_1m1w1y24hPattern8} sellSideRiskRatio
6263
6362
  * @property {BlockCumulativeSumPattern} peakRegret
6264
- * @property {PricePattern} investor
6363
+ * @property {PricePattern} capitalized
6265
6364
  * @property {_1m1w1y24hPattern<StoredF64>} profitToLossRatio
6266
6365
  */
6267
6366
 
@@ -6393,9 +6492,9 @@ function createTransferPattern(client, acc) {
6393
6492
  * @property {SeriesTree_Cohorts_Utxo_All_Unrealized_Loss} loss
6394
6493
  * @property {SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl} netPnl
6395
6494
  * @property {CentsUsdPattern3} grossPnl
6396
- * @property {InPattern} investedCapital
6397
- * @property {SeriesPattern18<CentsSquaredSats>} investorCapInProfitRaw
6398
- * @property {SeriesPattern18<CentsSquaredSats>} investorCapInLossRaw
6495
+ * @property {InPattern2} investedCapital
6496
+ * @property {SeriesPattern18<CentsSquaredSats>} capitalizedCapInProfitRaw
6497
+ * @property {SeriesPattern18<CentsSquaredSats>} capitalizedCapInLossRaw
6399
6498
  * @property {SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment} sentiment
6400
6499
  */
6401
6500
 
@@ -6432,12 +6531,13 @@ function createTransferPattern(client, acc) {
6432
6531
 
6433
6532
  /**
6434
6533
  * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth
6435
- * @property {DeltaHalfInToTotalPattern2} supply
6534
+ * @property {DeltaDominanceHalfInTotalPattern2} supply
6436
6535
  * @property {SpendingSpentUnspentPattern} outputs
6437
6536
  * @property {CoindaysCoinyearsDormancyTransferPattern} activity
6438
6537
  * @property {SeriesTree_Cohorts_Utxo_Sth_Realized} realized
6439
6538
  * @property {InMaxMinPerSupplyPattern} costBasis
6440
- * @property {GrossInvestedInvestorLossNetNuplProfitSentimentPattern2} unrealized
6539
+ * @property {CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2} unrealized
6540
+ * @property {InPattern} investedCapital
6441
6541
  */
6442
6542
 
6443
6543
  /**
@@ -6450,9 +6550,9 @@ function createTransferPattern(client, acc) {
6450
6550
  * @property {BlockChangeCumulativeDeltaSumPattern} netPnl
6451
6551
  * @property {AdjustedRatioValuePattern} sopr
6452
6552
  * @property {BlockCumulativeSumPattern} grossPnl
6453
- * @property {_1m1w1y24hPattern7} sellSideRiskRatio
6553
+ * @property {_1m1w1y24hPattern8} sellSideRiskRatio
6454
6554
  * @property {BlockCumulativeSumPattern} peakRegret
6455
- * @property {PricePattern} investor
6555
+ * @property {PricePattern} capitalized
6456
6556
  * @property {_1m1w1y24hPattern<StoredF64>} profitToLossRatio
6457
6557
  */
6458
6558
 
@@ -6554,12 +6654,13 @@ function createTransferPattern(client, acc) {
6554
6654
 
6555
6655
  /**
6556
6656
  * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth
6557
- * @property {DeltaHalfInToTotalPattern2} supply
6657
+ * @property {DeltaDominanceHalfInTotalPattern2} supply
6558
6658
  * @property {SpendingSpentUnspentPattern} outputs
6559
6659
  * @property {CoindaysCoinyearsDormancyTransferPattern} activity
6560
6660
  * @property {SeriesTree_Cohorts_Utxo_Lth_Realized} realized
6561
6661
  * @property {InMaxMinPerSupplyPattern} costBasis
6562
- * @property {GrossInvestedInvestorLossNetNuplProfitSentimentPattern2} unrealized
6662
+ * @property {CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2} unrealized
6663
+ * @property {InPattern} investedCapital
6563
6664
  */
6564
6665
 
6565
6666
  /**
@@ -6572,9 +6673,9 @@ function createTransferPattern(client, acc) {
6572
6673
  * @property {BlockChangeCumulativeDeltaSumPattern} netPnl
6573
6674
  * @property {SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr} sopr
6574
6675
  * @property {BlockCumulativeSumPattern} grossPnl
6575
- * @property {_1m1w1y24hPattern7} sellSideRiskRatio
6676
+ * @property {_1m1w1y24hPattern8} sellSideRiskRatio
6576
6677
  * @property {BlockCumulativeSumPattern} peakRegret
6577
- * @property {PricePattern} investor
6678
+ * @property {PricePattern} capitalized
6578
6679
  * @property {_1m1w1y24hPattern<StoredF64>} profitToLossRatio
6579
6680
  */
6580
6681
 
@@ -7005,7 +7106,7 @@ function createTransferPattern(client, acc) {
7005
7106
  * @extends BrkClientBase
7006
7107
  */
7007
7108
  class BrkClient extends BrkClientBase {
7008
- VERSION = "v0.3.0-beta.2";
7109
+ VERSION = "v0.3.0-beta.4";
7009
7110
 
7010
7111
  INDEXES = /** @type {const} */ ([
7011
7112
  "minute10",
@@ -8186,15 +8287,14 @@ class BrkClient extends BrkClientBase {
8186
8287
  constructor(options) {
8187
8288
  super(options);
8188
8289
  /** @type {SeriesTree} */
8189
- this.series = this._buildTree('');
8290
+ this.series = this._buildTree();
8190
8291
  }
8191
8292
 
8192
8293
  /**
8193
8294
  * @private
8194
- * @param {string} basePath
8195
8295
  * @returns {SeriesTree}
8196
8296
  */
8197
- _buildTree(basePath) {
8297
+ _buildTree() {
8198
8298
  return {
8199
8299
  blocks: {
8200
8300
  blockhash: createSeriesPattern18(this, 'blockhash'),
@@ -8501,8 +8601,8 @@ class BrkClient extends BrkClientBase {
8501
8601
  funded: createSeriesPattern34(this, 'funded_addr_data'),
8502
8602
  empty: createSeriesPattern35(this, 'empty_addr_data'),
8503
8603
  },
8504
- funded: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3(this, 'addr_count'),
8505
- empty: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3(this, 'empty_addr_count'),
8604
+ funded: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4(this, 'addr_count'),
8605
+ empty: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4(this, 'empty_addr_count'),
8506
8606
  activity: {
8507
8607
  all: {
8508
8608
  reactivated: create_1m1w1y24hBlockPattern(this, 'reactivated_addrs'),
@@ -8520,16 +8620,16 @@ class BrkClient extends BrkClientBase {
8520
8620
  p2tr: createActiveBidirectionalReactivatedReceivingSendingPattern(this, 'p2tr'),
8521
8621
  p2a: createActiveBidirectionalReactivatedReceivingSendingPattern(this, 'p2a'),
8522
8622
  },
8523
- total: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3(this, 'total_addr_count'),
8524
- new: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5(this, 'new_addr_count'),
8623
+ total: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4(this, 'total_addr_count'),
8624
+ new: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6(this, 'new_addr_count'),
8525
8625
  reused: {
8526
8626
  count: createFundedTotalPattern(this, 'reused_addr_count'),
8527
8627
  events: {
8528
- outputToReusedAddrCount: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5(this, 'output_to_reused_addr_count'),
8529
- outputToReusedAddrShare: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6(this, 'output_to_reused_addr_share'),
8628
+ outputToReusedAddrCount: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6(this, 'output_to_reused_addr_count'),
8629
+ outputToReusedAddrShare: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7(this, 'output_to_reused_addr_share'),
8530
8630
  spendableOutputToReusedAddrShare: create_1m1w1y24hBpsPercentRatioPattern(this, 'spendable_output_to_reused_addr_share'),
8531
- inputFromReusedAddrCount: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5(this, 'input_from_reused_addr_count'),
8532
- inputFromReusedAddrShare: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6(this, 'input_from_reused_addr_share'),
8631
+ inputFromReusedAddrCount: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6(this, 'input_from_reused_addr_count'),
8632
+ inputFromReusedAddrShare: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7(this, 'input_from_reused_addr_share'),
8533
8633
  activeReusedAddrCount: create_1m1w1y24hBlockPattern(this, 'active_reused_addr_count'),
8534
8634
  activeReusedAddrShare: {
8535
8635
  block: createSeriesPattern18(this, 'active_reused_addr_share'),
@@ -8543,15 +8643,26 @@ class BrkClient extends BrkClientBase {
8543
8643
  exposed: {
8544
8644
  count: createFundedTotalPattern(this, 'exposed_addr_count'),
8545
8645
  supply: {
8546
- all: createBtcCentsSatsUsdPattern(this, 'exposed_addr_supply'),
8547
- p2pk65: createBtcCentsSatsUsdPattern(this, 'p2pk65_exposed_addr_supply'),
8548
- p2pk33: createBtcCentsSatsUsdPattern(this, 'p2pk33_exposed_addr_supply'),
8549
- p2pkh: createBtcCentsSatsUsdPattern(this, 'p2pkh_exposed_addr_supply'),
8550
- p2sh: createBtcCentsSatsUsdPattern(this, 'p2sh_exposed_addr_supply'),
8551
- p2wpkh: createBtcCentsSatsUsdPattern(this, 'p2wpkh_exposed_addr_supply'),
8552
- p2wsh: createBtcCentsSatsUsdPattern(this, 'p2wsh_exposed_addr_supply'),
8553
- p2tr: createBtcCentsSatsUsdPattern(this, 'p2tr_exposed_addr_supply'),
8554
- p2a: createBtcCentsSatsUsdPattern(this, 'p2a_exposed_addr_supply'),
8646
+ all: createBtcCentsSatsUsdPattern(this, 'exposed_supply'),
8647
+ p2pk65: createBtcCentsSatsUsdPattern(this, 'p2pk65_exposed_supply'),
8648
+ p2pk33: createBtcCentsSatsUsdPattern(this, 'p2pk33_exposed_supply'),
8649
+ p2pkh: createBtcCentsSatsUsdPattern(this, 'p2pkh_exposed_supply'),
8650
+ p2sh: createBtcCentsSatsUsdPattern(this, 'p2sh_exposed_supply'),
8651
+ p2wpkh: createBtcCentsSatsUsdPattern(this, 'p2wpkh_exposed_supply'),
8652
+ p2wsh: createBtcCentsSatsUsdPattern(this, 'p2wsh_exposed_supply'),
8653
+ p2tr: createBtcCentsSatsUsdPattern(this, 'p2tr_exposed_supply'),
8654
+ p2a: createBtcCentsSatsUsdPattern(this, 'p2a_exposed_supply'),
8655
+ share: {
8656
+ all: createBpsPercentRatioPattern2(this, 'exposed_supply_share'),
8657
+ p2pk65: createBpsPercentRatioPattern2(this, 'p2pk65_exposed_supply_share'),
8658
+ p2pk33: createBpsPercentRatioPattern2(this, 'p2pk33_exposed_supply_share'),
8659
+ p2pkh: createBpsPercentRatioPattern2(this, 'p2pkh_exposed_supply_share'),
8660
+ p2sh: createBpsPercentRatioPattern2(this, 'p2sh_exposed_supply_share'),
8661
+ p2wpkh: createBpsPercentRatioPattern2(this, 'p2wpkh_exposed_supply_share'),
8662
+ p2wsh: createBpsPercentRatioPattern2(this, 'p2wsh_exposed_supply_share'),
8663
+ p2tr: createBpsPercentRatioPattern2(this, 'p2tr_exposed_supply_share'),
8664
+ p2a: createBpsPercentRatioPattern2(this, 'p2a_exposed_supply_share'),
8665
+ },
8555
8666
  },
8556
8667
  },
8557
8668
  delta: {
@@ -8565,6 +8676,17 @@ class BrkClient extends BrkClientBase {
8565
8676
  p2tr: createAbsoluteRatePattern(this, 'p2tr_addr_count'),
8566
8677
  p2a: createAbsoluteRatePattern(this, 'p2a_addr_count'),
8567
8678
  },
8679
+ avgAmount: {
8680
+ all: createAddrUtxoPattern(this, 'avg'),
8681
+ p2pk65: createAddrUtxoPattern(this, 'p2pk65_avg'),
8682
+ p2pk33: createAddrUtxoPattern(this, 'p2pk33_avg'),
8683
+ p2pkh: createAddrUtxoPattern(this, 'p2pkh_avg'),
8684
+ p2sh: createAddrUtxoPattern(this, 'p2sh_avg'),
8685
+ p2wpkh: createAddrUtxoPattern(this, 'p2wpkh_avg'),
8686
+ p2wsh: createAddrUtxoPattern(this, 'p2wsh_avg'),
8687
+ p2tr: createAddrUtxoPattern(this, 'p2tr_avg'),
8688
+ p2a: createAddrUtxoPattern(this, 'p2a_avg'),
8689
+ },
8568
8690
  },
8569
8691
  scripts: {
8570
8692
  raw: {
@@ -9279,13 +9401,7 @@ class BrkClient extends BrkClientBase {
9279
9401
  cohorts: {
9280
9402
  utxo: {
9281
9403
  all: {
9282
- supply: {
9283
- total: createBtcCentsSatsUsdPattern(this, 'supply'),
9284
- delta: createAbsoluteRatePattern(this, 'supply_delta'),
9285
- half: createBtcCentsSatsUsdPattern(this, 'supply_half'),
9286
- inProfit: createBtcCentsSatsToUsdPattern2(this, 'supply_in_profit'),
9287
- inLoss: createBtcCentsSatsToUsdPattern2(this, 'supply_in_loss'),
9288
- },
9404
+ supply: createDeltaDominanceHalfInTotalPattern2(this, 'supply'),
9289
9405
  outputs: {
9290
9406
  unspentCount: createBaseDeltaPattern(this, 'utxo_count'),
9291
9407
  spentCount: createAverageBlockCumulativeSumPattern2(this, 'spent_utxo_count'),
@@ -9392,9 +9508,9 @@ class BrkClient extends BrkClientBase {
9392
9508
  },
9393
9509
  },
9394
9510
  grossPnl: createBlockCumulativeSumPattern(this, 'realized_gross_pnl'),
9395
- sellSideRiskRatio: create_1m1w1y24hPattern7(this, 'sell_side_risk_ratio'),
9511
+ sellSideRiskRatio: create_1m1w1y24hPattern8(this, 'sell_side_risk_ratio'),
9396
9512
  peakRegret: createBlockCumulativeSumPattern(this, 'realized_peak_regret'),
9397
- investor: createPricePattern(this, 'investor_price'),
9513
+ capitalized: createPricePattern(this, 'capitalized_price'),
9398
9514
  profitToLossRatio: create_1m1w1y24hPattern(this, 'realized_profit_to_loss_ratio'),
9399
9515
  },
9400
9516
  costBasis: {
@@ -9427,18 +9543,19 @@ class BrkClient extends BrkClientBase {
9427
9543
  toOwnGrossPnl: createBpsPercentRatioPattern(this, 'net_unrealized_pnl_to_own_gross_pnl'),
9428
9544
  },
9429
9545
  grossPnl: createCentsUsdPattern3(this, 'unrealized_gross_pnl'),
9430
- investedCapital: createInPattern(this, 'invested_capital_in'),
9431
- investorCapInProfitRaw: createSeriesPattern18(this, 'investor_cap_in_profit_raw'),
9432
- investorCapInLossRaw: createSeriesPattern18(this, 'investor_cap_in_loss_raw'),
9546
+ investedCapital: createInPattern2(this, 'invested_capital_in'),
9547
+ capitalizedCapInProfitRaw: createSeriesPattern18(this, 'capitalized_cap_in_profit_raw'),
9548
+ capitalizedCapInLossRaw: createSeriesPattern18(this, 'capitalized_cap_in_loss_raw'),
9433
9549
  sentiment: {
9434
9550
  painIndex: createCentsUsdPattern3(this, 'pain_index'),
9435
9551
  greedIndex: createCentsUsdPattern3(this, 'greed_index'),
9436
9552
  net: createCentsUsdPattern(this, 'net_sentiment'),
9437
9553
  },
9438
9554
  },
9555
+ investedCapital: createInPattern(this, 'invested_capital_in'),
9439
9556
  },
9440
9557
  sth: {
9441
- supply: createDeltaHalfInToTotalPattern2(this, 'sth_supply'),
9558
+ supply: createDeltaDominanceHalfInTotalPattern2(this, 'sth_supply'),
9442
9559
  outputs: createSpendingSpentUnspentPattern(this, 'sth'),
9443
9560
  activity: createCoindaysCoinyearsDormancyTransferPattern(this, 'sth'),
9444
9561
  realized: {
@@ -9528,16 +9645,17 @@ class BrkClient extends BrkClientBase {
9528
9645
  netPnl: createBlockChangeCumulativeDeltaSumPattern(this, 'sth_net'),
9529
9646
  sopr: createAdjustedRatioValuePattern(this, 'sth'),
9530
9647
  grossPnl: createBlockCumulativeSumPattern(this, 'sth_realized_gross_pnl'),
9531
- sellSideRiskRatio: create_1m1w1y24hPattern7(this, 'sth_sell_side_risk_ratio'),
9648
+ sellSideRiskRatio: create_1m1w1y24hPattern8(this, 'sth_sell_side_risk_ratio'),
9532
9649
  peakRegret: createBlockCumulativeSumPattern(this, 'sth_realized_peak_regret'),
9533
- investor: createPricePattern(this, 'sth_investor_price'),
9650
+ capitalized: createPricePattern(this, 'sth_capitalized_price'),
9534
9651
  profitToLossRatio: create_1m1w1y24hPattern(this, 'sth_realized_profit_to_loss_ratio'),
9535
9652
  },
9536
9653
  costBasis: createInMaxMinPerSupplyPattern(this, 'sth'),
9537
- unrealized: createGrossInvestedInvestorLossNetNuplProfitSentimentPattern2(this, 'sth'),
9654
+ unrealized: createCapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2(this, 'sth'),
9655
+ investedCapital: createInPattern(this, 'sth_invested_capital_in'),
9538
9656
  },
9539
9657
  lth: {
9540
- supply: createDeltaHalfInToTotalPattern2(this, 'lth_supply'),
9658
+ supply: createDeltaDominanceHalfInTotalPattern2(this, 'lth_supply'),
9541
9659
  outputs: createSpendingSpentUnspentPattern(this, 'lth'),
9542
9660
  activity: createCoindaysCoinyearsDormancyTransferPattern(this, 'lth'),
9543
9661
  realized: {
@@ -9630,13 +9748,14 @@ class BrkClient extends BrkClientBase {
9630
9748
  ratio: create_1m1w1y24hPattern(this, 'lth_sopr'),
9631
9749
  },
9632
9750
  grossPnl: createBlockCumulativeSumPattern(this, 'lth_realized_gross_pnl'),
9633
- sellSideRiskRatio: create_1m1w1y24hPattern7(this, 'lth_sell_side_risk_ratio'),
9751
+ sellSideRiskRatio: create_1m1w1y24hPattern8(this, 'lth_sell_side_risk_ratio'),
9634
9752
  peakRegret: createBlockCumulativeSumPattern(this, 'lth_realized_peak_regret'),
9635
- investor: createPricePattern(this, 'lth_investor_price'),
9753
+ capitalized: createPricePattern(this, 'lth_capitalized_price'),
9636
9754
  profitToLossRatio: create_1m1w1y24hPattern(this, 'lth_realized_profit_to_loss_ratio'),
9637
9755
  },
9638
9756
  costBasis: createInMaxMinPerSupplyPattern(this, 'lth'),
9639
- unrealized: createGrossInvestedInvestorLossNetNuplProfitSentimentPattern2(this, 'lth'),
9757
+ unrealized: createCapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2(this, 'lth'),
9758
+ investedCapital: createInPattern(this, 'lth_invested_capital_in'),
9640
9759
  },
9641
9760
  ageRange: {
9642
9761
  under1h: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_1h_old'),
@@ -10383,63 +10502,6 @@ class BrkClient extends BrkClientBase {
10383
10502
  return this.getJson(path, { signal, onUpdate });
10384
10503
  }
10385
10504
 
10386
- /**
10387
- * Available cost basis cohorts
10388
- *
10389
- * List available cohorts for cost basis distribution.
10390
- *
10391
- * Endpoint: `GET /api/series/cost-basis`
10392
- * @param {{ signal?: AbortSignal, onUpdate?: (value: string[]) => void }} [options]
10393
- * @returns {Promise<string[]>}
10394
- */
10395
- async getCostBasisCohorts({ signal, onUpdate } = {}) {
10396
- const path = `/api/series/cost-basis`;
10397
- return this.getJson(path, { signal, onUpdate });
10398
- }
10399
-
10400
- /**
10401
- * Available cost basis dates
10402
- *
10403
- * List available dates for a cohort's cost basis distribution.
10404
- *
10405
- * Endpoint: `GET /api/series/cost-basis/{cohort}/dates`
10406
- *
10407
- * @param {Cohort} cohort
10408
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Date[]) => void }} [options]
10409
- * @returns {Promise<Date[]>}
10410
- */
10411
- async getCostBasisDates(cohort, { signal, onUpdate } = {}) {
10412
- const path = `/api/series/cost-basis/${cohort}/dates`;
10413
- return this.getJson(path, { signal, onUpdate });
10414
- }
10415
-
10416
- /**
10417
- * Cost basis distribution
10418
- *
10419
- * Get the cost basis distribution for a cohort on a specific date.
10420
- *
10421
- * Query params:
10422
- * - `bucket`: raw (default), lin200, lin500, lin1000, log10, log50, log100
10423
- * - `value`: supply (default, in BTC), realized (USD), unrealized (USD)
10424
- *
10425
- * Endpoint: `GET /api/series/cost-basis/{cohort}/{date}`
10426
- *
10427
- * @param {Cohort} cohort
10428
- * @param {string} date
10429
- * @param {CostBasisBucket=} [bucket] - Bucket type for aggregation. Default: raw (no aggregation).
10430
- * @param {CostBasisValue=} [value] - Value type to return. Default: supply.
10431
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Object) => void }} [options]
10432
- * @returns {Promise<Object>}
10433
- */
10434
- async getCostBasis(cohort, date, bucket, value, { signal, onUpdate } = {}) {
10435
- const params = new URLSearchParams();
10436
- if (bucket !== undefined) params.set('bucket', String(bucket));
10437
- if (value !== undefined) params.set('value', String(value));
10438
- const query = params.toString();
10439
- const path = `/api/series/cost-basis/${cohort}/${date}${query ? '?' + query : ''}`;
10440
- return this.getJson(path, { signal, onUpdate });
10441
- }
10442
-
10443
10505
  /**
10444
10506
  * Series count
10445
10507
  *
@@ -10822,6 +10884,81 @@ class BrkClient extends BrkClientBase {
10822
10884
  return this.getJson(path, { signal, onUpdate });
10823
10885
  }
10824
10886
 
10887
+ /**
10888
+ * Available URPD cohorts
10889
+ *
10890
+ * Cohorts for which URPD data is available. Returns names like `all`, `sth`, `lth`, `utxos_under_1h_old`.
10891
+ *
10892
+ * Endpoint: `GET /api/urpd`
10893
+ * @param {{ signal?: AbortSignal, onUpdate?: (value: Cohort[]) => void }} [options]
10894
+ * @returns {Promise<Cohort[]>}
10895
+ */
10896
+ async listUrpdCohorts({ signal, onUpdate } = {}) {
10897
+ const path = `/api/urpd`;
10898
+ return this.getJson(path, { signal, onUpdate });
10899
+ }
10900
+
10901
+ /**
10902
+ * Latest URPD
10903
+ *
10904
+ * URPD for the most recent available date in the cohort. The response's `date` field echoes which date was served.
10905
+ *
10906
+ * See the URPD tag description for the response shape and `agg` options.
10907
+ *
10908
+ * Endpoint: `GET /api/urpd/{cohort}`
10909
+ *
10910
+ * @param {Cohort} cohort
10911
+ * @param {UrpdAggregation=} [agg] - Aggregation strategy. Default: raw (no aggregation). Accepts `bucket` as alias.
10912
+ * @param {{ signal?: AbortSignal, onUpdate?: (value: Urpd) => void }} [options]
10913
+ * @returns {Promise<Urpd>}
10914
+ */
10915
+ async getUrpd(cohort, agg, { signal, onUpdate } = {}) {
10916
+ const params = new URLSearchParams();
10917
+ if (agg !== undefined) params.set('agg', String(agg));
10918
+ const query = params.toString();
10919
+ const path = `/api/urpd/${cohort}${query ? '?' + query : ''}`;
10920
+ return this.getJson(path, { signal, onUpdate });
10921
+ }
10922
+
10923
+ /**
10924
+ * Available URPD dates
10925
+ *
10926
+ * Dates for which a URPD snapshot is available for the cohort. One entry per UTC day, sorted ascending.
10927
+ *
10928
+ * Endpoint: `GET /api/urpd/{cohort}/dates`
10929
+ *
10930
+ * @param {Cohort} cohort
10931
+ * @param {{ signal?: AbortSignal, onUpdate?: (value: Date[]) => void }} [options]
10932
+ * @returns {Promise<Date[]>}
10933
+ */
10934
+ async listUrpdDates(cohort, { signal, onUpdate } = {}) {
10935
+ const path = `/api/urpd/${cohort}/dates`;
10936
+ return this.getJson(path, { signal, onUpdate });
10937
+ }
10938
+
10939
+ /**
10940
+ * URPD at date
10941
+ *
10942
+ * URPD for a (cohort, date) pair. Returns `{ cohort, date, aggregation, close, total_supply, buckets }` where each bucket is `{ price_floor, supply, realized_cap, unrealized_pnl }`.
10943
+ *
10944
+ * See the URPD tag description for unit conventions and `agg` options.
10945
+ *
10946
+ * Endpoint: `GET /api/urpd/{cohort}/{date}`
10947
+ *
10948
+ * @param {Cohort} cohort
10949
+ * @param {string} date
10950
+ * @param {UrpdAggregation=} [agg] - Aggregation strategy. Default: raw (no aggregation). Accepts `bucket` as alias.
10951
+ * @param {{ signal?: AbortSignal, onUpdate?: (value: Urpd) => void }} [options]
10952
+ * @returns {Promise<Urpd>}
10953
+ */
10954
+ async getUrpdAt(cohort, date, agg, { signal, onUpdate } = {}) {
10955
+ const params = new URLSearchParams();
10956
+ if (agg !== undefined) params.set('agg', String(agg));
10957
+ const query = params.toString();
10958
+ const path = `/api/urpd/${cohort}/${date}${query ? '?' + query : ''}`;
10959
+ return this.getJson(path, { signal, onUpdate });
10960
+ }
10961
+
10825
10962
  /**
10826
10963
  * Block (v1)
10827
10964
  *
package/package.json CHANGED
@@ -40,5 +40,5 @@
40
40
  "url": "git+https://github.com/bitcoinresearchkit/brk.git"
41
41
  },
42
42
  "type": "module",
43
- "version": "0.3.0-beta.2"
43
+ "version": "0.3.0-beta.4"
44
44
  }