mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-25 07:09:59 -07:00
global: snapshot
This commit is contained in:
@@ -456,6 +456,7 @@
|
||||
* @typedef {Cents} Open
|
||||
*/
|
||||
/** @typedef {number[]} OracleBins */
|
||||
/** @typedef {number[]} OracleBinsV2 */
|
||||
/** @typedef {number} OutPoint */
|
||||
/**
|
||||
* Type (P2PKH, P2WPKH, P2SH, P2TR, etc.)
|
||||
@@ -1644,59 +1645,6 @@ function createPrice111dSmaPattern(client, acc) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} PercentilesPattern
|
||||
* @property {MetricPattern4<Dollars>} pct05
|
||||
* @property {MetricPattern4<Dollars>} pct10
|
||||
* @property {MetricPattern4<Dollars>} pct15
|
||||
* @property {MetricPattern4<Dollars>} pct20
|
||||
* @property {MetricPattern4<Dollars>} pct25
|
||||
* @property {MetricPattern4<Dollars>} pct30
|
||||
* @property {MetricPattern4<Dollars>} pct35
|
||||
* @property {MetricPattern4<Dollars>} pct40
|
||||
* @property {MetricPattern4<Dollars>} pct45
|
||||
* @property {MetricPattern4<Dollars>} pct50
|
||||
* @property {MetricPattern4<Dollars>} pct55
|
||||
* @property {MetricPattern4<Dollars>} pct60
|
||||
* @property {MetricPattern4<Dollars>} pct65
|
||||
* @property {MetricPattern4<Dollars>} pct70
|
||||
* @property {MetricPattern4<Dollars>} pct75
|
||||
* @property {MetricPattern4<Dollars>} pct80
|
||||
* @property {MetricPattern4<Dollars>} pct85
|
||||
* @property {MetricPattern4<Dollars>} pct90
|
||||
* @property {MetricPattern4<Dollars>} pct95
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a PercentilesPattern pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {PercentilesPattern}
|
||||
*/
|
||||
function createPercentilesPattern(client, acc) {
|
||||
return {
|
||||
pct05: createMetricPattern4(client, _m(acc, 'pct05')),
|
||||
pct10: createMetricPattern4(client, _m(acc, 'pct10')),
|
||||
pct15: createMetricPattern4(client, _m(acc, 'pct15')),
|
||||
pct20: createMetricPattern4(client, _m(acc, 'pct20')),
|
||||
pct25: createMetricPattern4(client, _m(acc, 'pct25')),
|
||||
pct30: createMetricPattern4(client, _m(acc, 'pct30')),
|
||||
pct35: createMetricPattern4(client, _m(acc, 'pct35')),
|
||||
pct40: createMetricPattern4(client, _m(acc, 'pct40')),
|
||||
pct45: createMetricPattern4(client, _m(acc, 'pct45')),
|
||||
pct50: createMetricPattern4(client, _m(acc, 'pct50')),
|
||||
pct55: createMetricPattern4(client, _m(acc, 'pct55')),
|
||||
pct60: createMetricPattern4(client, _m(acc, 'pct60')),
|
||||
pct65: createMetricPattern4(client, _m(acc, 'pct65')),
|
||||
pct70: createMetricPattern4(client, _m(acc, 'pct70')),
|
||||
pct75: createMetricPattern4(client, _m(acc, 'pct75')),
|
||||
pct80: createMetricPattern4(client, _m(acc, 'pct80')),
|
||||
pct85: createMetricPattern4(client, _m(acc, 'pct85')),
|
||||
pct90: createMetricPattern4(client, _m(acc, 'pct90')),
|
||||
pct95: createMetricPattern4(client, _m(acc, 'pct95')),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} ActivePriceRatioPattern
|
||||
* @property {MetricPattern4<StoredF32>} ratio
|
||||
@@ -1750,6 +1698,59 @@ function createActivePriceRatioPattern(client, acc) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} PercentilesPattern
|
||||
* @property {MetricPattern4<Dollars>} pct05
|
||||
* @property {MetricPattern4<Dollars>} pct10
|
||||
* @property {MetricPattern4<Dollars>} pct15
|
||||
* @property {MetricPattern4<Dollars>} pct20
|
||||
* @property {MetricPattern4<Dollars>} pct25
|
||||
* @property {MetricPattern4<Dollars>} pct30
|
||||
* @property {MetricPattern4<Dollars>} pct35
|
||||
* @property {MetricPattern4<Dollars>} pct40
|
||||
* @property {MetricPattern4<Dollars>} pct45
|
||||
* @property {MetricPattern4<Dollars>} pct50
|
||||
* @property {MetricPattern4<Dollars>} pct55
|
||||
* @property {MetricPattern4<Dollars>} pct60
|
||||
* @property {MetricPattern4<Dollars>} pct65
|
||||
* @property {MetricPattern4<Dollars>} pct70
|
||||
* @property {MetricPattern4<Dollars>} pct75
|
||||
* @property {MetricPattern4<Dollars>} pct80
|
||||
* @property {MetricPattern4<Dollars>} pct85
|
||||
* @property {MetricPattern4<Dollars>} pct90
|
||||
* @property {MetricPattern4<Dollars>} pct95
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a PercentilesPattern pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {PercentilesPattern}
|
||||
*/
|
||||
function createPercentilesPattern(client, acc) {
|
||||
return {
|
||||
pct05: createMetricPattern4(client, _m(acc, 'pct05')),
|
||||
pct10: createMetricPattern4(client, _m(acc, 'pct10')),
|
||||
pct15: createMetricPattern4(client, _m(acc, 'pct15')),
|
||||
pct20: createMetricPattern4(client, _m(acc, 'pct20')),
|
||||
pct25: createMetricPattern4(client, _m(acc, 'pct25')),
|
||||
pct30: createMetricPattern4(client, _m(acc, 'pct30')),
|
||||
pct35: createMetricPattern4(client, _m(acc, 'pct35')),
|
||||
pct40: createMetricPattern4(client, _m(acc, 'pct40')),
|
||||
pct45: createMetricPattern4(client, _m(acc, 'pct45')),
|
||||
pct50: createMetricPattern4(client, _m(acc, 'pct50')),
|
||||
pct55: createMetricPattern4(client, _m(acc, 'pct55')),
|
||||
pct60: createMetricPattern4(client, _m(acc, 'pct60')),
|
||||
pct65: createMetricPattern4(client, _m(acc, 'pct65')),
|
||||
pct70: createMetricPattern4(client, _m(acc, 'pct70')),
|
||||
pct75: createMetricPattern4(client, _m(acc, 'pct75')),
|
||||
pct80: createMetricPattern4(client, _m(acc, 'pct80')),
|
||||
pct85: createMetricPattern4(client, _m(acc, 'pct85')),
|
||||
pct90: createMetricPattern4(client, _m(acc, 'pct90')),
|
||||
pct95: createMetricPattern4(client, _m(acc, 'pct95')),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} RelativePattern5
|
||||
* @property {MetricPattern1<StoredF32>} negUnrealizedLossRelToMarketCap
|
||||
@@ -2082,41 +2083,6 @@ function createDollarsPattern(client, acc) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} RelativePattern2
|
||||
* @property {MetricPattern1<StoredF32>} negUnrealizedLossRelToOwnMarketCap
|
||||
* @property {MetricPattern1<StoredF32>} negUnrealizedLossRelToOwnTotalUnrealizedPnl
|
||||
* @property {MetricPattern1<StoredF32>} netUnrealizedPnlRelToOwnMarketCap
|
||||
* @property {MetricPattern1<StoredF32>} netUnrealizedPnlRelToOwnTotalUnrealizedPnl
|
||||
* @property {MetricPattern1<StoredF64>} supplyInLossRelToOwnSupply
|
||||
* @property {MetricPattern1<StoredF64>} supplyInProfitRelToOwnSupply
|
||||
* @property {MetricPattern1<StoredF32>} unrealizedLossRelToOwnMarketCap
|
||||
* @property {MetricPattern1<StoredF32>} unrealizedLossRelToOwnTotalUnrealizedPnl
|
||||
* @property {MetricPattern1<StoredF32>} unrealizedProfitRelToOwnMarketCap
|
||||
* @property {MetricPattern1<StoredF32>} unrealizedProfitRelToOwnTotalUnrealizedPnl
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a RelativePattern2 pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {RelativePattern2}
|
||||
*/
|
||||
function createRelativePattern2(client, acc) {
|
||||
return {
|
||||
negUnrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')),
|
||||
negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')),
|
||||
netUnrealizedPnlRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')),
|
||||
netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')),
|
||||
supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')),
|
||||
supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')),
|
||||
unrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')),
|
||||
unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')),
|
||||
unrealizedProfitRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')),
|
||||
unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} RelativePattern
|
||||
* @property {MetricPattern1<StoredF32>} negUnrealizedLossRelToMarketCap
|
||||
@@ -2152,6 +2118,41 @@ function createRelativePattern(client, acc) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} RelativePattern2
|
||||
* @property {MetricPattern1<StoredF32>} negUnrealizedLossRelToOwnMarketCap
|
||||
* @property {MetricPattern1<StoredF32>} negUnrealizedLossRelToOwnTotalUnrealizedPnl
|
||||
* @property {MetricPattern1<StoredF32>} netUnrealizedPnlRelToOwnMarketCap
|
||||
* @property {MetricPattern1<StoredF32>} netUnrealizedPnlRelToOwnTotalUnrealizedPnl
|
||||
* @property {MetricPattern1<StoredF64>} supplyInLossRelToOwnSupply
|
||||
* @property {MetricPattern1<StoredF64>} supplyInProfitRelToOwnSupply
|
||||
* @property {MetricPattern1<StoredF32>} unrealizedLossRelToOwnMarketCap
|
||||
* @property {MetricPattern1<StoredF32>} unrealizedLossRelToOwnTotalUnrealizedPnl
|
||||
* @property {MetricPattern1<StoredF32>} unrealizedProfitRelToOwnMarketCap
|
||||
* @property {MetricPattern1<StoredF32>} unrealizedProfitRelToOwnTotalUnrealizedPnl
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a RelativePattern2 pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {RelativePattern2}
|
||||
*/
|
||||
function createRelativePattern2(client, acc) {
|
||||
return {
|
||||
negUnrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')),
|
||||
negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')),
|
||||
netUnrealizedPnlRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')),
|
||||
netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')),
|
||||
supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')),
|
||||
supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')),
|
||||
unrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')),
|
||||
unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')),
|
||||
unrealizedProfitRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')),
|
||||
unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {Object} CountPattern2
|
||||
@@ -2222,41 +2223,6 @@ function createAddrCountPattern(client, acc) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {Object} FullnessPattern
|
||||
* @property {MetricPattern2<T>} average
|
||||
* @property {MetricPattern11<T>} base
|
||||
* @property {MetricPattern2<T>} max
|
||||
* @property {MetricPattern6<T>} median
|
||||
* @property {MetricPattern2<T>} min
|
||||
* @property {MetricPattern6<T>} pct10
|
||||
* @property {MetricPattern6<T>} pct25
|
||||
* @property {MetricPattern6<T>} pct75
|
||||
* @property {MetricPattern6<T>} pct90
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a FullnessPattern pattern node
|
||||
* @template T
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {FullnessPattern<T>}
|
||||
*/
|
||||
function createFullnessPattern(client, acc) {
|
||||
return {
|
||||
average: createMetricPattern2(client, _m(acc, 'average')),
|
||||
base: createMetricPattern11(client, acc),
|
||||
max: createMetricPattern2(client, _m(acc, 'max')),
|
||||
median: createMetricPattern6(client, _m(acc, 'median')),
|
||||
min: createMetricPattern2(client, _m(acc, 'min')),
|
||||
pct10: createMetricPattern6(client, _m(acc, 'pct10')),
|
||||
pct25: createMetricPattern6(client, _m(acc, 'pct25')),
|
||||
pct75: createMetricPattern6(client, _m(acc, 'pct75')),
|
||||
pct90: createMetricPattern6(client, _m(acc, 'pct90')),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {Object} FeeRatePattern
|
||||
@@ -2292,6 +2258,41 @@ function createFeeRatePattern(client, acc) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {Object} FullnessPattern
|
||||
* @property {MetricPattern2<T>} average
|
||||
* @property {MetricPattern11<T>} base
|
||||
* @property {MetricPattern2<T>} max
|
||||
* @property {MetricPattern6<T>} median
|
||||
* @property {MetricPattern2<T>} min
|
||||
* @property {MetricPattern6<T>} pct10
|
||||
* @property {MetricPattern6<T>} pct25
|
||||
* @property {MetricPattern6<T>} pct75
|
||||
* @property {MetricPattern6<T>} pct90
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a FullnessPattern pattern node
|
||||
* @template T
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {FullnessPattern<T>}
|
||||
*/
|
||||
function createFullnessPattern(client, acc) {
|
||||
return {
|
||||
average: createMetricPattern2(client, _m(acc, 'average')),
|
||||
base: createMetricPattern11(client, acc),
|
||||
max: createMetricPattern2(client, _m(acc, 'max')),
|
||||
median: createMetricPattern6(client, _m(acc, 'median')),
|
||||
min: createMetricPattern2(client, _m(acc, 'min')),
|
||||
pct10: createMetricPattern6(client, _m(acc, 'pct10')),
|
||||
pct25: createMetricPattern6(client, _m(acc, 'pct25')),
|
||||
pct75: createMetricPattern6(client, _m(acc, 'pct75')),
|
||||
pct90: createMetricPattern6(client, _m(acc, 'pct90')),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} _0satsPattern
|
||||
* @property {ActivityPattern2} activity
|
||||
@@ -2356,6 +2357,93 @@ function createPhaseDailyCentsPattern(client, acc) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} PeriodCagrPattern
|
||||
* @property {MetricPattern4<StoredF32>} _10y
|
||||
* @property {MetricPattern4<StoredF32>} _2y
|
||||
* @property {MetricPattern4<StoredF32>} _3y
|
||||
* @property {MetricPattern4<StoredF32>} _4y
|
||||
* @property {MetricPattern4<StoredF32>} _5y
|
||||
* @property {MetricPattern4<StoredF32>} _6y
|
||||
* @property {MetricPattern4<StoredF32>} _8y
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a PeriodCagrPattern pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {PeriodCagrPattern}
|
||||
*/
|
||||
function createPeriodCagrPattern(client, acc) {
|
||||
return {
|
||||
_10y: createMetricPattern4(client, _p('10y', acc)),
|
||||
_2y: createMetricPattern4(client, _p('2y', acc)),
|
||||
_3y: createMetricPattern4(client, _p('3y', acc)),
|
||||
_4y: createMetricPattern4(client, _p('4y', acc)),
|
||||
_5y: createMetricPattern4(client, _p('5y', acc)),
|
||||
_6y: createMetricPattern4(client, _p('6y', acc)),
|
||||
_8y: createMetricPattern4(client, _p('8y', acc)),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} _0satsPattern2
|
||||
* @property {ActivityPattern2} activity
|
||||
* @property {CostBasisPattern} costBasis
|
||||
* @property {OutputsPattern} outputs
|
||||
* @property {RealizedPattern} realized
|
||||
* @property {RelativePattern4} relative
|
||||
* @property {SupplyPattern2} supply
|
||||
* @property {UnrealizedPattern} unrealized
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a _0satsPattern2 pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {_0satsPattern2}
|
||||
*/
|
||||
function create_0satsPattern2(client, acc) {
|
||||
return {
|
||||
activity: createActivityPattern2(client, acc),
|
||||
costBasis: createCostBasisPattern(client, acc),
|
||||
outputs: createOutputsPattern(client, _m(acc, 'utxo_count')),
|
||||
realized: createRealizedPattern(client, acc),
|
||||
relative: createRelativePattern4(client, _m(acc, 'supply_in')),
|
||||
supply: createSupplyPattern2(client, _m(acc, 'supply')),
|
||||
unrealized: createUnrealizedPattern(client, acc),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} _100btcPattern
|
||||
* @property {ActivityPattern2} activity
|
||||
* @property {CostBasisPattern} costBasis
|
||||
* @property {OutputsPattern} outputs
|
||||
* @property {RealizedPattern} realized
|
||||
* @property {RelativePattern} relative
|
||||
* @property {SupplyPattern2} supply
|
||||
* @property {UnrealizedPattern} unrealized
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a _100btcPattern pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {_100btcPattern}
|
||||
*/
|
||||
function create_100btcPattern(client, acc) {
|
||||
return {
|
||||
activity: createActivityPattern2(client, acc),
|
||||
costBasis: createCostBasisPattern(client, acc),
|
||||
outputs: createOutputsPattern(client, _m(acc, 'utxo_count')),
|
||||
realized: createRealizedPattern(client, acc),
|
||||
relative: createRelativePattern(client, acc),
|
||||
supply: createSupplyPattern2(client, _m(acc, 'supply')),
|
||||
unrealized: createUnrealizedPattern(client, acc),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} UnrealizedPattern
|
||||
* @property {MetricPattern1<Dollars>} negUnrealizedLoss
|
||||
@@ -2414,35 +2502,6 @@ function create_10yTo12yPattern(client, acc) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} PeriodCagrPattern
|
||||
* @property {MetricPattern4<StoredF32>} _10y
|
||||
* @property {MetricPattern4<StoredF32>} _2y
|
||||
* @property {MetricPattern4<StoredF32>} _3y
|
||||
* @property {MetricPattern4<StoredF32>} _4y
|
||||
* @property {MetricPattern4<StoredF32>} _5y
|
||||
* @property {MetricPattern4<StoredF32>} _6y
|
||||
* @property {MetricPattern4<StoredF32>} _8y
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a PeriodCagrPattern pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {PeriodCagrPattern}
|
||||
*/
|
||||
function createPeriodCagrPattern(client, acc) {
|
||||
return {
|
||||
_10y: createMetricPattern4(client, _p('10y', acc)),
|
||||
_2y: createMetricPattern4(client, _p('2y', acc)),
|
||||
_3y: createMetricPattern4(client, _p('3y', acc)),
|
||||
_4y: createMetricPattern4(client, _p('4y', acc)),
|
||||
_5y: createMetricPattern4(client, _p('5y', acc)),
|
||||
_6y: createMetricPattern4(client, _p('6y', acc)),
|
||||
_8y: createMetricPattern4(client, _p('8y', acc)),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} _10yPattern
|
||||
* @property {ActivityPattern2} activity
|
||||
@@ -2472,64 +2531,6 @@ function create_10yPattern(client, acc) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} _100btcPattern
|
||||
* @property {ActivityPattern2} activity
|
||||
* @property {CostBasisPattern} costBasis
|
||||
* @property {OutputsPattern} outputs
|
||||
* @property {RealizedPattern} realized
|
||||
* @property {RelativePattern} relative
|
||||
* @property {SupplyPattern2} supply
|
||||
* @property {UnrealizedPattern} unrealized
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a _100btcPattern pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {_100btcPattern}
|
||||
*/
|
||||
function create_100btcPattern(client, acc) {
|
||||
return {
|
||||
activity: createActivityPattern2(client, acc),
|
||||
costBasis: createCostBasisPattern(client, acc),
|
||||
outputs: createOutputsPattern(client, _m(acc, 'utxo_count')),
|
||||
realized: createRealizedPattern(client, acc),
|
||||
relative: createRelativePattern(client, acc),
|
||||
supply: createSupplyPattern2(client, _m(acc, 'supply')),
|
||||
unrealized: createUnrealizedPattern(client, acc),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} _0satsPattern2
|
||||
* @property {ActivityPattern2} activity
|
||||
* @property {CostBasisPattern} costBasis
|
||||
* @property {OutputsPattern} outputs
|
||||
* @property {RealizedPattern} realized
|
||||
* @property {RelativePattern4} relative
|
||||
* @property {SupplyPattern2} supply
|
||||
* @property {UnrealizedPattern} unrealized
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a _0satsPattern2 pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {_0satsPattern2}
|
||||
*/
|
||||
function create_0satsPattern2(client, acc) {
|
||||
return {
|
||||
activity: createActivityPattern2(client, acc),
|
||||
costBasis: createCostBasisPattern(client, acc),
|
||||
outputs: createOutputsPattern(client, _m(acc, 'utxo_count')),
|
||||
realized: createRealizedPattern(client, acc),
|
||||
relative: createRelativePattern4(client, _m(acc, 'supply_in')),
|
||||
supply: createSupplyPattern2(client, _m(acc, 'supply')),
|
||||
unrealized: createUnrealizedPattern(client, acc),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} ActivityPattern2
|
||||
* @property {BlockCountPattern<StoredF64>} coinblocksDestroyed
|
||||
@@ -2580,27 +2581,6 @@ function createSplitPattern2(client, acc) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} _2015Pattern
|
||||
* @property {MetricPattern4<Bitcoin>} bitcoin
|
||||
* @property {MetricPattern4<Dollars>} dollars
|
||||
* @property {MetricPattern4<Sats>} sats
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a _2015Pattern pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {_2015Pattern}
|
||||
*/
|
||||
function create_2015Pattern(client, acc) {
|
||||
return {
|
||||
bitcoin: createMetricPattern4(client, _m(acc, 'btc')),
|
||||
dollars: createMetricPattern4(client, _m(acc, 'usd')),
|
||||
sats: createMetricPattern4(client, acc),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} ActiveSupplyPattern
|
||||
* @property {MetricPattern1<Bitcoin>} bitcoin
|
||||
@@ -2623,23 +2603,23 @@ function createActiveSupplyPattern(client, acc) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} CostBasisPattern2
|
||||
* @property {MetricPattern1<Dollars>} max
|
||||
* @property {MetricPattern1<Dollars>} min
|
||||
* @property {PercentilesPattern} percentiles
|
||||
* @typedef {Object} _2015Pattern
|
||||
* @property {MetricPattern4<Bitcoin>} bitcoin
|
||||
* @property {MetricPattern4<Dollars>} dollars
|
||||
* @property {MetricPattern4<Sats>} sats
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a CostBasisPattern2 pattern node
|
||||
* Create a _2015Pattern pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {CostBasisPattern2}
|
||||
* @returns {_2015Pattern}
|
||||
*/
|
||||
function createCostBasisPattern2(client, acc) {
|
||||
function create_2015Pattern(client, acc) {
|
||||
return {
|
||||
max: createMetricPattern1(client, _m(acc, 'max_cost_basis')),
|
||||
min: createMetricPattern1(client, _m(acc, 'min_cost_basis')),
|
||||
percentiles: createPercentilesPattern(client, _m(acc, 'cost_basis')),
|
||||
bitcoin: createMetricPattern4(client, _m(acc, 'btc')),
|
||||
dollars: createMetricPattern4(client, _m(acc, 'usd')),
|
||||
sats: createMetricPattern4(client, acc),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2664,6 +2644,27 @@ function createCoinbasePattern2(client, acc) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} CostBasisPattern2
|
||||
* @property {MetricPattern1<Dollars>} max
|
||||
* @property {MetricPattern1<Dollars>} min
|
||||
* @property {PercentilesPattern} percentiles
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a CostBasisPattern2 pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {CostBasisPattern2}
|
||||
*/
|
||||
function createCostBasisPattern2(client, acc) {
|
||||
return {
|
||||
max: createMetricPattern1(client, _m(acc, 'max_cost_basis')),
|
||||
min: createMetricPattern1(client, _m(acc, 'min_cost_basis')),
|
||||
percentiles: createPercentilesPattern(client, _m(acc, 'cost_basis')),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} SegwitAdoptionPattern
|
||||
* @property {MetricPattern11<StoredF32>} base
|
||||
@@ -2685,27 +2686,6 @@ function createSegwitAdoptionPattern(client, acc) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} CoinbasePattern
|
||||
* @property {BitcoinPattern} bitcoin
|
||||
* @property {DollarsPattern<Dollars>} dollars
|
||||
* @property {DollarsPattern<Sats>} sats
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a CoinbasePattern pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {CoinbasePattern}
|
||||
*/
|
||||
function createCoinbasePattern(client, acc) {
|
||||
return {
|
||||
bitcoin: createBitcoinPattern(client, _m(acc, 'btc')),
|
||||
dollars: createDollarsPattern(client, _m(acc, 'usd')),
|
||||
sats: createDollarsPattern(client, acc),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} UnclaimedRewardsPattern
|
||||
* @property {BitcoinPattern2<Bitcoin>} bitcoin
|
||||
@@ -2728,21 +2708,23 @@ function createUnclaimedRewardsPattern(client, acc) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} SupplyPattern2
|
||||
* @property {ActiveSupplyPattern} halved
|
||||
* @property {ActiveSupplyPattern} total
|
||||
* @typedef {Object} CoinbasePattern
|
||||
* @property {BitcoinPattern} bitcoin
|
||||
* @property {DollarsPattern<Dollars>} dollars
|
||||
* @property {DollarsPattern<Sats>} sats
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a SupplyPattern2 pattern node
|
||||
* Create a CoinbasePattern pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {SupplyPattern2}
|
||||
* @returns {CoinbasePattern}
|
||||
*/
|
||||
function createSupplyPattern2(client, acc) {
|
||||
function createCoinbasePattern(client, acc) {
|
||||
return {
|
||||
halved: createActiveSupplyPattern(client, _m(acc, 'halved')),
|
||||
total: createActiveSupplyPattern(client, acc),
|
||||
bitcoin: createBitcoinPattern(client, _m(acc, 'btc')),
|
||||
dollars: createDollarsPattern(client, _m(acc, 'usd')),
|
||||
sats: createDollarsPattern(client, acc),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2765,25 +2747,6 @@ function createRelativePattern4(client, acc) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} CostBasisPattern
|
||||
* @property {MetricPattern1<Dollars>} max
|
||||
* @property {MetricPattern1<Dollars>} min
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a CostBasisPattern pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {CostBasisPattern}
|
||||
*/
|
||||
function createCostBasisPattern(client, acc) {
|
||||
return {
|
||||
max: createMetricPattern1(client, _m(acc, 'max_cost_basis')),
|
||||
min: createMetricPattern1(client, _m(acc, 'min_cost_basis')),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} _1dReturns1mSdPattern
|
||||
* @property {MetricPattern4<StoredF32>} sd
|
||||
@@ -2804,23 +2767,40 @@ function create_1dReturns1mSdPattern(client, acc) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {Object} BitcoinPattern2
|
||||
* @property {MetricPattern2<T>} cumulative
|
||||
* @property {MetricPattern1<T>} sum
|
||||
* @typedef {Object} CostBasisPattern
|
||||
* @property {MetricPattern1<Dollars>} max
|
||||
* @property {MetricPattern1<Dollars>} min
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a BitcoinPattern2 pattern node
|
||||
* @template T
|
||||
* Create a CostBasisPattern pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {BitcoinPattern2<T>}
|
||||
* @returns {CostBasisPattern}
|
||||
*/
|
||||
function createBitcoinPattern2(client, acc) {
|
||||
function createCostBasisPattern(client, acc) {
|
||||
return {
|
||||
cumulative: createMetricPattern2(client, _m(acc, 'cumulative')),
|
||||
sum: createMetricPattern1(client, acc),
|
||||
max: createMetricPattern1(client, _m(acc, 'max_cost_basis')),
|
||||
min: createMetricPattern1(client, _m(acc, 'min_cost_basis')),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} SupplyPattern2
|
||||
* @property {ActiveSupplyPattern} halved
|
||||
* @property {ActiveSupplyPattern} total
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a SupplyPattern2 pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {SupplyPattern2}
|
||||
*/
|
||||
function createSupplyPattern2(client, acc) {
|
||||
return {
|
||||
halved: createActiveSupplyPattern(client, _m(acc, 'halved')),
|
||||
total: createActiveSupplyPattern(client, acc),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2845,6 +2825,27 @@ function createBlockCountPattern(client, acc) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {Object} BitcoinPattern2
|
||||
* @property {MetricPattern2<T>} cumulative
|
||||
* @property {MetricPattern1<T>} sum
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a BitcoinPattern2 pattern node
|
||||
* @template T
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {BitcoinPattern2<T>}
|
||||
*/
|
||||
function createBitcoinPattern2(client, acc) {
|
||||
return {
|
||||
cumulative: createMetricPattern2(client, _m(acc, 'cumulative')),
|
||||
sum: createMetricPattern1(client, acc),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {Object} SatsPattern
|
||||
@@ -2861,25 +2862,8 @@ function createBlockCountPattern(client, acc) {
|
||||
*/
|
||||
function createSatsPattern(client, acc) {
|
||||
return {
|
||||
ohlc: createMetricPattern1(client, _m(acc, 'ohlc')),
|
||||
split: createSplitPattern2(client, acc),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} RealizedPriceExtraPattern
|
||||
* @property {MetricPattern4<StoredF32>} ratio
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a RealizedPriceExtraPattern pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {RealizedPriceExtraPattern}
|
||||
*/
|
||||
function createRealizedPriceExtraPattern(client, acc) {
|
||||
return {
|
||||
ratio: createMetricPattern4(client, acc),
|
||||
ohlc: createMetricPattern1(client, _m(acc, 'ohlc_sats')),
|
||||
split: createSplitPattern2(client, _m(acc, 'sats')),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2900,6 +2884,23 @@ function createOutputsPattern(client, acc) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} RealizedPriceExtraPattern
|
||||
* @property {MetricPattern4<StoredF32>} ratio
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a RealizedPriceExtraPattern pattern node
|
||||
* @param {BrkClientBase} client
|
||||
* @param {string} acc - Accumulated metric name
|
||||
* @returns {RealizedPriceExtraPattern}
|
||||
*/
|
||||
function createRealizedPriceExtraPattern(client, acc) {
|
||||
return {
|
||||
ratio: createMetricPattern4(client, acc),
|
||||
};
|
||||
}
|
||||
|
||||
// Catalog tree typedefs
|
||||
|
||||
/**
|
||||
@@ -4055,8 +4056,8 @@ function createOutputsPattern(client, acc) {
|
||||
* @typedef {Object} MetricsTree_Price
|
||||
* @property {MetricsTree_Price_Cents} cents
|
||||
* @property {MetricsTree_Price_Oracle} oracle
|
||||
* @property {MetricsTree_Price_Sats} sats
|
||||
* @property {SatsPattern<OHLCDollars>} usd
|
||||
* @property {SatsPattern<OHLCSats>} sats
|
||||
* @property {MetricsTree_Price_Usd} usd
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -4085,14 +4086,28 @@ function createOutputsPattern(client, acc) {
|
||||
* @property {PhaseDailyCentsPattern<Dollars>} phaseDailyDollars
|
||||
* @property {MetricPattern11<OracleBins>} phaseHistogram
|
||||
* @property {MetricPattern11<Cents>} phasePriceCents
|
||||
* @property {PhaseDailyCentsPattern<Cents>} phaseV2DailyCents
|
||||
* @property {PhaseDailyCentsPattern<Dollars>} phaseV2DailyDollars
|
||||
* @property {MetricPattern11<OracleBinsV2>} phaseV2Histogram
|
||||
* @property {PhaseDailyCentsPattern<Cents>} phaseV2PeakDailyCents
|
||||
* @property {PhaseDailyCentsPattern<Dollars>} phaseV2PeakDailyDollars
|
||||
* @property {MetricPattern11<Cents>} phaseV2PeakPriceCents
|
||||
* @property {MetricPattern11<Cents>} phaseV2PriceCents
|
||||
* @property {PhaseDailyCentsPattern<Cents>} phaseV3DailyCents
|
||||
* @property {PhaseDailyCentsPattern<Dollars>} phaseV3DailyDollars
|
||||
* @property {MetricPattern11<OracleBinsV2>} phaseV3Histogram
|
||||
* @property {PhaseDailyCentsPattern<Cents>} phaseV3PeakDailyCents
|
||||
* @property {PhaseDailyCentsPattern<Dollars>} phaseV3PeakDailyDollars
|
||||
* @property {MetricPattern11<Cents>} phaseV3PeakPriceCents
|
||||
* @property {MetricPattern11<Cents>} phaseV3PriceCents
|
||||
* @property {MetricPattern11<Cents>} priceCents
|
||||
* @property {MetricPattern6<StoredU32>} txCount
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} MetricsTree_Price_Sats
|
||||
* @property {MetricPattern1<OHLCSats>} ohlc
|
||||
* @property {SplitPattern2<Sats>} split
|
||||
* @typedef {Object} MetricsTree_Price_Usd
|
||||
* @property {MetricPattern1<OHLCDollars>} ohlc
|
||||
* @property {SplitPattern2<Dollars>} split
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -6055,14 +6070,28 @@ class BrkClient extends BrkClientBase {
|
||||
phaseDailyDollars: createPhaseDailyCentsPattern(this, 'phase_daily_dollars'),
|
||||
phaseHistogram: createMetricPattern11(this, 'phase_histogram'),
|
||||
phasePriceCents: createMetricPattern11(this, 'phase_price_cents'),
|
||||
phaseV2DailyCents: createPhaseDailyCentsPattern(this, 'phase_v2_daily'),
|
||||
phaseV2DailyDollars: createPhaseDailyCentsPattern(this, 'phase_v2_daily_dollars'),
|
||||
phaseV2Histogram: createMetricPattern11(this, 'phase_v2_histogram'),
|
||||
phaseV2PeakDailyCents: createPhaseDailyCentsPattern(this, 'phase_v2_peak_daily'),
|
||||
phaseV2PeakDailyDollars: createPhaseDailyCentsPattern(this, 'phase_v2_peak_daily_dollars'),
|
||||
phaseV2PeakPriceCents: createMetricPattern11(this, 'phase_v2_peak_price_cents'),
|
||||
phaseV2PriceCents: createMetricPattern11(this, 'phase_v2_price_cents'),
|
||||
phaseV3DailyCents: createPhaseDailyCentsPattern(this, 'phase_v3_daily'),
|
||||
phaseV3DailyDollars: createPhaseDailyCentsPattern(this, 'phase_v3_daily_dollars'),
|
||||
phaseV3Histogram: createMetricPattern11(this, 'phase_v3_histogram'),
|
||||
phaseV3PeakDailyCents: createPhaseDailyCentsPattern(this, 'phase_v3_peak_daily'),
|
||||
phaseV3PeakDailyDollars: createPhaseDailyCentsPattern(this, 'phase_v3_peak_daily_dollars'),
|
||||
phaseV3PeakPriceCents: createMetricPattern11(this, 'phase_v3_peak_price_cents'),
|
||||
phaseV3PriceCents: createMetricPattern11(this, 'phase_v3_price_cents'),
|
||||
priceCents: createMetricPattern11(this, 'oracle_price_cents'),
|
||||
txCount: createMetricPattern6(this, 'oracle_tx_count'),
|
||||
},
|
||||
sats: {
|
||||
ohlc: createMetricPattern1(this, 'price_ohlc_sats'),
|
||||
split: createSplitPattern2(this, 'price_sats'),
|
||||
sats: createSatsPattern(this, 'price'),
|
||||
usd: {
|
||||
ohlc: createMetricPattern1(this, 'price_ohlc'),
|
||||
split: createSplitPattern2(this, 'price'),
|
||||
},
|
||||
usd: createSatsPattern(this, 'price'),
|
||||
},
|
||||
scripts: {
|
||||
count: {
|
||||
@@ -6184,29 +6213,17 @@ class BrkClient extends BrkClientBase {
|
||||
}
|
||||
|
||||
/**
|
||||
* OpenAPI specification
|
||||
* Compact OpenAPI specification
|
||||
*
|
||||
* Full OpenAPI 3.1 specification for this API.
|
||||
* Compact OpenAPI specification optimized for LLM consumption. Removes redundant fields while preserving essential API information. Full spec available at `/openapi.json`.
|
||||
*
|
||||
* Endpoint: `GET /api.json`
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
async getOpenapi() {
|
||||
async getApi() {
|
||||
return this.getJson(`/api.json`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Trimmed OpenAPI specification
|
||||
*
|
||||
* Compact OpenAPI specification optimized for LLM consumption. Removes redundant fields while preserving essential API information.
|
||||
*
|
||||
* Endpoint: `GET /api.trimmed.json`
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
async getOpenapiTrimmed() {
|
||||
return this.getJson(`/api.trimmed.json`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Address information
|
||||
*
|
||||
@@ -6997,6 +7014,18 @@ class BrkClient extends BrkClientBase {
|
||||
return this.getJson(`/health`);
|
||||
}
|
||||
|
||||
/**
|
||||
* OpenAPI specification
|
||||
*
|
||||
* Full OpenAPI 3.1 specification for this API.
|
||||
*
|
||||
* Endpoint: `GET /openapi.json`
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
async getOpenapi() {
|
||||
return this.getJson(`/openapi.json`);
|
||||
}
|
||||
|
||||
/**
|
||||
* API version
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user