brk-client 0.1.0-alpha.6 → 0.1.0-beta.0
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.
- package/README.md +4 -0
- package/index.js +337 -302
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
JavaScript/TypeScript client for the [Bitcoin Research Kit](https://github.com/bitcoinresearchkit/brk) API.
|
|
4
4
|
|
|
5
|
+
Zero dependencies.
|
|
6
|
+
|
|
5
7
|
[npm](https://www.npmjs.com/package/brk-client) | [API Reference](https://github.com/bitcoinresearchkit/brk/blob/main/modules/brk-client/docs/globals.md)
|
|
6
8
|
|
|
7
9
|
## Installation
|
|
@@ -10,6 +12,8 @@ JavaScript/TypeScript client for the [Bitcoin Research Kit](https://github.com/b
|
|
|
10
12
|
npm install brk-client
|
|
11
13
|
```
|
|
12
14
|
|
|
15
|
+
Or just copy [`index.js`](./index.js) into your project - it's a single file with no dependencies.
|
|
16
|
+
|
|
13
17
|
## Quick Start
|
|
14
18
|
|
|
15
19
|
```javascript
|
package/index.js
CHANGED
|
@@ -606,7 +606,7 @@
|
|
|
606
606
|
*/
|
|
607
607
|
/** @typedef {number} SemesterIndex */
|
|
608
608
|
/**
|
|
609
|
-
* Fixed-size boolean value optimized for on-disk storage (stored as
|
|
609
|
+
* Fixed-size boolean value optimized for on-disk storage (stored as u8)
|
|
610
610
|
*
|
|
611
611
|
* @typedef {number} StoredBool
|
|
612
612
|
*/
|
|
@@ -620,7 +620,7 @@
|
|
|
620
620
|
*
|
|
621
621
|
* @typedef {number} StoredF64
|
|
622
622
|
*/
|
|
623
|
-
/** @typedef {number}
|
|
623
|
+
/** @typedef {number} StoredI8 */
|
|
624
624
|
/** @typedef {number} StoredU16 */
|
|
625
625
|
/**
|
|
626
626
|
* Fixed-size 32-bit unsigned integer optimized for on-disk storage
|
|
@@ -839,9 +839,11 @@ class BrkError extends Error {
|
|
|
839
839
|
/**
|
|
840
840
|
* @template T
|
|
841
841
|
* @typedef {Object} MetricData
|
|
842
|
+
* @property {number} version - Version of the metric data
|
|
842
843
|
* @property {number} total - Total number of data points
|
|
843
844
|
* @property {number} start - Start index (inclusive)
|
|
844
845
|
* @property {number} end - End index (exclusive)
|
|
846
|
+
* @property {string} stamp - ISO 8601 timestamp of when the response was generated
|
|
845
847
|
* @property {T[]} data - The metric data
|
|
846
848
|
*/
|
|
847
849
|
/** @typedef {MetricData<any>} AnyMetricData */
|
|
@@ -1645,59 +1647,6 @@ function createPrice111dSmaPattern(client, acc) {
|
|
|
1645
1647
|
};
|
|
1646
1648
|
}
|
|
1647
1649
|
|
|
1648
|
-
/**
|
|
1649
|
-
* @typedef {Object} PercentilesPattern
|
|
1650
|
-
* @property {MetricPattern4<Dollars>} pct05
|
|
1651
|
-
* @property {MetricPattern4<Dollars>} pct10
|
|
1652
|
-
* @property {MetricPattern4<Dollars>} pct15
|
|
1653
|
-
* @property {MetricPattern4<Dollars>} pct20
|
|
1654
|
-
* @property {MetricPattern4<Dollars>} pct25
|
|
1655
|
-
* @property {MetricPattern4<Dollars>} pct30
|
|
1656
|
-
* @property {MetricPattern4<Dollars>} pct35
|
|
1657
|
-
* @property {MetricPattern4<Dollars>} pct40
|
|
1658
|
-
* @property {MetricPattern4<Dollars>} pct45
|
|
1659
|
-
* @property {MetricPattern4<Dollars>} pct50
|
|
1660
|
-
* @property {MetricPattern4<Dollars>} pct55
|
|
1661
|
-
* @property {MetricPattern4<Dollars>} pct60
|
|
1662
|
-
* @property {MetricPattern4<Dollars>} pct65
|
|
1663
|
-
* @property {MetricPattern4<Dollars>} pct70
|
|
1664
|
-
* @property {MetricPattern4<Dollars>} pct75
|
|
1665
|
-
* @property {MetricPattern4<Dollars>} pct80
|
|
1666
|
-
* @property {MetricPattern4<Dollars>} pct85
|
|
1667
|
-
* @property {MetricPattern4<Dollars>} pct90
|
|
1668
|
-
* @property {MetricPattern4<Dollars>} pct95
|
|
1669
|
-
*/
|
|
1670
|
-
|
|
1671
|
-
/**
|
|
1672
|
-
* Create a PercentilesPattern pattern node
|
|
1673
|
-
* @param {BrkClientBase} client
|
|
1674
|
-
* @param {string} acc - Accumulated metric name
|
|
1675
|
-
* @returns {PercentilesPattern}
|
|
1676
|
-
*/
|
|
1677
|
-
function createPercentilesPattern(client, acc) {
|
|
1678
|
-
return {
|
|
1679
|
-
pct05: createMetricPattern4(client, _m(acc, 'pct05')),
|
|
1680
|
-
pct10: createMetricPattern4(client, _m(acc, 'pct10')),
|
|
1681
|
-
pct15: createMetricPattern4(client, _m(acc, 'pct15')),
|
|
1682
|
-
pct20: createMetricPattern4(client, _m(acc, 'pct20')),
|
|
1683
|
-
pct25: createMetricPattern4(client, _m(acc, 'pct25')),
|
|
1684
|
-
pct30: createMetricPattern4(client, _m(acc, 'pct30')),
|
|
1685
|
-
pct35: createMetricPattern4(client, _m(acc, 'pct35')),
|
|
1686
|
-
pct40: createMetricPattern4(client, _m(acc, 'pct40')),
|
|
1687
|
-
pct45: createMetricPattern4(client, _m(acc, 'pct45')),
|
|
1688
|
-
pct50: createMetricPattern4(client, _m(acc, 'pct50')),
|
|
1689
|
-
pct55: createMetricPattern4(client, _m(acc, 'pct55')),
|
|
1690
|
-
pct60: createMetricPattern4(client, _m(acc, 'pct60')),
|
|
1691
|
-
pct65: createMetricPattern4(client, _m(acc, 'pct65')),
|
|
1692
|
-
pct70: createMetricPattern4(client, _m(acc, 'pct70')),
|
|
1693
|
-
pct75: createMetricPattern4(client, _m(acc, 'pct75')),
|
|
1694
|
-
pct80: createMetricPattern4(client, _m(acc, 'pct80')),
|
|
1695
|
-
pct85: createMetricPattern4(client, _m(acc, 'pct85')),
|
|
1696
|
-
pct90: createMetricPattern4(client, _m(acc, 'pct90')),
|
|
1697
|
-
pct95: createMetricPattern4(client, _m(acc, 'pct95')),
|
|
1698
|
-
};
|
|
1699
|
-
}
|
|
1700
|
-
|
|
1701
1650
|
/**
|
|
1702
1651
|
* @typedef {Object} ActivePriceRatioPattern
|
|
1703
1652
|
* @property {MetricPattern4<StoredF32>} ratio
|
|
@@ -1751,6 +1700,59 @@ function createActivePriceRatioPattern(client, acc) {
|
|
|
1751
1700
|
};
|
|
1752
1701
|
}
|
|
1753
1702
|
|
|
1703
|
+
/**
|
|
1704
|
+
* @typedef {Object} PercentilesPattern
|
|
1705
|
+
* @property {MetricPattern4<Dollars>} pct05
|
|
1706
|
+
* @property {MetricPattern4<Dollars>} pct10
|
|
1707
|
+
* @property {MetricPattern4<Dollars>} pct15
|
|
1708
|
+
* @property {MetricPattern4<Dollars>} pct20
|
|
1709
|
+
* @property {MetricPattern4<Dollars>} pct25
|
|
1710
|
+
* @property {MetricPattern4<Dollars>} pct30
|
|
1711
|
+
* @property {MetricPattern4<Dollars>} pct35
|
|
1712
|
+
* @property {MetricPattern4<Dollars>} pct40
|
|
1713
|
+
* @property {MetricPattern4<Dollars>} pct45
|
|
1714
|
+
* @property {MetricPattern4<Dollars>} pct50
|
|
1715
|
+
* @property {MetricPattern4<Dollars>} pct55
|
|
1716
|
+
* @property {MetricPattern4<Dollars>} pct60
|
|
1717
|
+
* @property {MetricPattern4<Dollars>} pct65
|
|
1718
|
+
* @property {MetricPattern4<Dollars>} pct70
|
|
1719
|
+
* @property {MetricPattern4<Dollars>} pct75
|
|
1720
|
+
* @property {MetricPattern4<Dollars>} pct80
|
|
1721
|
+
* @property {MetricPattern4<Dollars>} pct85
|
|
1722
|
+
* @property {MetricPattern4<Dollars>} pct90
|
|
1723
|
+
* @property {MetricPattern4<Dollars>} pct95
|
|
1724
|
+
*/
|
|
1725
|
+
|
|
1726
|
+
/**
|
|
1727
|
+
* Create a PercentilesPattern pattern node
|
|
1728
|
+
* @param {BrkClientBase} client
|
|
1729
|
+
* @param {string} acc - Accumulated metric name
|
|
1730
|
+
* @returns {PercentilesPattern}
|
|
1731
|
+
*/
|
|
1732
|
+
function createPercentilesPattern(client, acc) {
|
|
1733
|
+
return {
|
|
1734
|
+
pct05: createMetricPattern4(client, _m(acc, 'pct05')),
|
|
1735
|
+
pct10: createMetricPattern4(client, _m(acc, 'pct10')),
|
|
1736
|
+
pct15: createMetricPattern4(client, _m(acc, 'pct15')),
|
|
1737
|
+
pct20: createMetricPattern4(client, _m(acc, 'pct20')),
|
|
1738
|
+
pct25: createMetricPattern4(client, _m(acc, 'pct25')),
|
|
1739
|
+
pct30: createMetricPattern4(client, _m(acc, 'pct30')),
|
|
1740
|
+
pct35: createMetricPattern4(client, _m(acc, 'pct35')),
|
|
1741
|
+
pct40: createMetricPattern4(client, _m(acc, 'pct40')),
|
|
1742
|
+
pct45: createMetricPattern4(client, _m(acc, 'pct45')),
|
|
1743
|
+
pct50: createMetricPattern4(client, _m(acc, 'pct50')),
|
|
1744
|
+
pct55: createMetricPattern4(client, _m(acc, 'pct55')),
|
|
1745
|
+
pct60: createMetricPattern4(client, _m(acc, 'pct60')),
|
|
1746
|
+
pct65: createMetricPattern4(client, _m(acc, 'pct65')),
|
|
1747
|
+
pct70: createMetricPattern4(client, _m(acc, 'pct70')),
|
|
1748
|
+
pct75: createMetricPattern4(client, _m(acc, 'pct75')),
|
|
1749
|
+
pct80: createMetricPattern4(client, _m(acc, 'pct80')),
|
|
1750
|
+
pct85: createMetricPattern4(client, _m(acc, 'pct85')),
|
|
1751
|
+
pct90: createMetricPattern4(client, _m(acc, 'pct90')),
|
|
1752
|
+
pct95: createMetricPattern4(client, _m(acc, 'pct95')),
|
|
1753
|
+
};
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1754
1756
|
/**
|
|
1755
1757
|
* @typedef {Object} RelativePattern5
|
|
1756
1758
|
* @property {MetricPattern1<StoredF32>} negUnrealizedLossRelToMarketCap
|
|
@@ -1813,6 +1815,7 @@ function createRelativePattern5(client, acc) {
|
|
|
1813
1815
|
* @property {MetricPattern1<StoredU32>} _24hBlocksMined
|
|
1814
1816
|
* @property {MetricPattern1<StoredF32>} _24hDominance
|
|
1815
1817
|
* @property {BlockCountPattern<StoredU32>} blocksMined
|
|
1818
|
+
* @property {MetricPattern1<StoredU32>} blocksSinceBlock
|
|
1816
1819
|
* @property {CoinbasePattern2} coinbase
|
|
1817
1820
|
* @property {MetricPattern4<StoredU16>} daysSinceBlock
|
|
1818
1821
|
* @property {MetricPattern1<StoredF32>} dominance
|
|
@@ -1837,6 +1840,7 @@ function createAaopoolPattern(client, acc) {
|
|
|
1837
1840
|
_24hBlocksMined: createMetricPattern1(client, _m(acc, '24h_blocks_mined')),
|
|
1838
1841
|
_24hDominance: createMetricPattern1(client, _m(acc, '24h_dominance')),
|
|
1839
1842
|
blocksMined: createBlockCountPattern(client, _m(acc, 'blocks_mined')),
|
|
1843
|
+
blocksSinceBlock: createMetricPattern1(client, _m(acc, 'blocks_since_block')),
|
|
1840
1844
|
coinbase: createCoinbasePattern2(client, _m(acc, 'coinbase')),
|
|
1841
1845
|
daysSinceBlock: createMetricPattern4(client, _m(acc, 'days_since_block')),
|
|
1842
1846
|
dominance: createMetricPattern1(client, _m(acc, 'dominance')),
|
|
@@ -1968,6 +1972,47 @@ function createPeriodAveragePricePattern(client, acc) {
|
|
|
1968
1972
|
};
|
|
1969
1973
|
}
|
|
1970
1974
|
|
|
1975
|
+
/**
|
|
1976
|
+
* @template T
|
|
1977
|
+
* @typedef {Object} ClassAveragePricePattern
|
|
1978
|
+
* @property {MetricPattern4<T>} _2015
|
|
1979
|
+
* @property {MetricPattern4<T>} _2016
|
|
1980
|
+
* @property {MetricPattern4<T>} _2017
|
|
1981
|
+
* @property {MetricPattern4<T>} _2018
|
|
1982
|
+
* @property {MetricPattern4<T>} _2019
|
|
1983
|
+
* @property {MetricPattern4<T>} _2020
|
|
1984
|
+
* @property {MetricPattern4<T>} _2021
|
|
1985
|
+
* @property {MetricPattern4<T>} _2022
|
|
1986
|
+
* @property {MetricPattern4<T>} _2023
|
|
1987
|
+
* @property {MetricPattern4<T>} _2024
|
|
1988
|
+
* @property {MetricPattern4<T>} _2025
|
|
1989
|
+
* @property {MetricPattern4<T>} _2026
|
|
1990
|
+
*/
|
|
1991
|
+
|
|
1992
|
+
/**
|
|
1993
|
+
* Create a ClassAveragePricePattern pattern node
|
|
1994
|
+
* @template T
|
|
1995
|
+
* @param {BrkClientBase} client
|
|
1996
|
+
* @param {string} acc - Accumulated metric name
|
|
1997
|
+
* @returns {ClassAveragePricePattern<T>}
|
|
1998
|
+
*/
|
|
1999
|
+
function createClassAveragePricePattern(client, acc) {
|
|
2000
|
+
return {
|
|
2001
|
+
_2015: createMetricPattern4(client, _m(acc, '2015_average_price')),
|
|
2002
|
+
_2016: createMetricPattern4(client, _m(acc, '2016_average_price')),
|
|
2003
|
+
_2017: createMetricPattern4(client, _m(acc, '2017_average_price')),
|
|
2004
|
+
_2018: createMetricPattern4(client, _m(acc, '2018_average_price')),
|
|
2005
|
+
_2019: createMetricPattern4(client, _m(acc, '2019_average_price')),
|
|
2006
|
+
_2020: createMetricPattern4(client, _m(acc, '2020_average_price')),
|
|
2007
|
+
_2021: createMetricPattern4(client, _m(acc, '2021_average_price')),
|
|
2008
|
+
_2022: createMetricPattern4(client, _m(acc, '2022_average_price')),
|
|
2009
|
+
_2023: createMetricPattern4(client, _m(acc, '2023_average_price')),
|
|
2010
|
+
_2024: createMetricPattern4(client, _m(acc, '2024_average_price')),
|
|
2011
|
+
_2025: createMetricPattern4(client, _m(acc, '2025_average_price')),
|
|
2012
|
+
_2026: createMetricPattern4(client, _m(acc, '2026_average_price')),
|
|
2013
|
+
};
|
|
2014
|
+
}
|
|
2015
|
+
|
|
1971
2016
|
/**
|
|
1972
2017
|
* @typedef {Object} BitcoinPattern
|
|
1973
2018
|
* @property {MetricPattern2<Bitcoin>} average
|
|
@@ -2045,41 +2090,37 @@ function createDollarsPattern(client, acc) {
|
|
|
2045
2090
|
}
|
|
2046
2091
|
|
|
2047
2092
|
/**
|
|
2048
|
-
* @
|
|
2049
|
-
* @
|
|
2050
|
-
* @property {
|
|
2051
|
-
* @property {
|
|
2052
|
-
* @property {
|
|
2053
|
-
* @property {
|
|
2054
|
-
* @property {
|
|
2055
|
-
* @property {
|
|
2056
|
-
* @property {
|
|
2057
|
-
* @property {
|
|
2058
|
-
* @property {
|
|
2059
|
-
* @property {MetricPattern4<T>} _2024
|
|
2060
|
-
* @property {MetricPattern4<T>} _2025
|
|
2093
|
+
* @typedef {Object} RelativePattern2
|
|
2094
|
+
* @property {MetricPattern1<StoredF32>} negUnrealizedLossRelToOwnMarketCap
|
|
2095
|
+
* @property {MetricPattern1<StoredF32>} negUnrealizedLossRelToOwnTotalUnrealizedPnl
|
|
2096
|
+
* @property {MetricPattern1<StoredF32>} netUnrealizedPnlRelToOwnMarketCap
|
|
2097
|
+
* @property {MetricPattern1<StoredF32>} netUnrealizedPnlRelToOwnTotalUnrealizedPnl
|
|
2098
|
+
* @property {MetricPattern1<StoredF64>} supplyInLossRelToOwnSupply
|
|
2099
|
+
* @property {MetricPattern1<StoredF64>} supplyInProfitRelToOwnSupply
|
|
2100
|
+
* @property {MetricPattern1<StoredF32>} unrealizedLossRelToOwnMarketCap
|
|
2101
|
+
* @property {MetricPattern1<StoredF32>} unrealizedLossRelToOwnTotalUnrealizedPnl
|
|
2102
|
+
* @property {MetricPattern1<StoredF32>} unrealizedProfitRelToOwnMarketCap
|
|
2103
|
+
* @property {MetricPattern1<StoredF32>} unrealizedProfitRelToOwnTotalUnrealizedPnl
|
|
2061
2104
|
*/
|
|
2062
2105
|
|
|
2063
2106
|
/**
|
|
2064
|
-
* Create a
|
|
2065
|
-
* @template T
|
|
2107
|
+
* Create a RelativePattern2 pattern node
|
|
2066
2108
|
* @param {BrkClientBase} client
|
|
2067
2109
|
* @param {string} acc - Accumulated metric name
|
|
2068
|
-
* @returns {
|
|
2110
|
+
* @returns {RelativePattern2}
|
|
2069
2111
|
*/
|
|
2070
|
-
function
|
|
2112
|
+
function createRelativePattern2(client, acc) {
|
|
2071
2113
|
return {
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
_2025: createMetricPattern4(client, _m(acc, '2025_returns')),
|
|
2114
|
+
negUnrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')),
|
|
2115
|
+
negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')),
|
|
2116
|
+
netUnrealizedPnlRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')),
|
|
2117
|
+
netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')),
|
|
2118
|
+
supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')),
|
|
2119
|
+
supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')),
|
|
2120
|
+
unrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')),
|
|
2121
|
+
unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')),
|
|
2122
|
+
unrealizedProfitRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')),
|
|
2123
|
+
unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')),
|
|
2083
2124
|
};
|
|
2084
2125
|
}
|
|
2085
2126
|
|
|
@@ -2118,41 +2159,6 @@ function createRelativePattern(client, acc) {
|
|
|
2118
2159
|
};
|
|
2119
2160
|
}
|
|
2120
2161
|
|
|
2121
|
-
/**
|
|
2122
|
-
* @typedef {Object} RelativePattern2
|
|
2123
|
-
* @property {MetricPattern1<StoredF32>} negUnrealizedLossRelToOwnMarketCap
|
|
2124
|
-
* @property {MetricPattern1<StoredF32>} negUnrealizedLossRelToOwnTotalUnrealizedPnl
|
|
2125
|
-
* @property {MetricPattern1<StoredF32>} netUnrealizedPnlRelToOwnMarketCap
|
|
2126
|
-
* @property {MetricPattern1<StoredF32>} netUnrealizedPnlRelToOwnTotalUnrealizedPnl
|
|
2127
|
-
* @property {MetricPattern1<StoredF64>} supplyInLossRelToOwnSupply
|
|
2128
|
-
* @property {MetricPattern1<StoredF64>} supplyInProfitRelToOwnSupply
|
|
2129
|
-
* @property {MetricPattern1<StoredF32>} unrealizedLossRelToOwnMarketCap
|
|
2130
|
-
* @property {MetricPattern1<StoredF32>} unrealizedLossRelToOwnTotalUnrealizedPnl
|
|
2131
|
-
* @property {MetricPattern1<StoredF32>} unrealizedProfitRelToOwnMarketCap
|
|
2132
|
-
* @property {MetricPattern1<StoredF32>} unrealizedProfitRelToOwnTotalUnrealizedPnl
|
|
2133
|
-
*/
|
|
2134
|
-
|
|
2135
|
-
/**
|
|
2136
|
-
* Create a RelativePattern2 pattern node
|
|
2137
|
-
* @param {BrkClientBase} client
|
|
2138
|
-
* @param {string} acc - Accumulated metric name
|
|
2139
|
-
* @returns {RelativePattern2}
|
|
2140
|
-
*/
|
|
2141
|
-
function createRelativePattern2(client, acc) {
|
|
2142
|
-
return {
|
|
2143
|
-
negUnrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')),
|
|
2144
|
-
negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')),
|
|
2145
|
-
netUnrealizedPnlRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')),
|
|
2146
|
-
netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')),
|
|
2147
|
-
supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')),
|
|
2148
|
-
supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')),
|
|
2149
|
-
unrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')),
|
|
2150
|
-
unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')),
|
|
2151
|
-
unrealizedProfitRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')),
|
|
2152
|
-
unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')),
|
|
2153
|
-
};
|
|
2154
|
-
}
|
|
2155
|
-
|
|
2156
2162
|
/**
|
|
2157
2163
|
* @template T
|
|
2158
2164
|
* @typedef {Object} CountPattern2
|
|
@@ -2358,31 +2364,60 @@ function createPhaseDailyCentsPattern(client, acc) {
|
|
|
2358
2364
|
}
|
|
2359
2365
|
|
|
2360
2366
|
/**
|
|
2361
|
-
* @typedef {Object}
|
|
2362
|
-
* @property {
|
|
2363
|
-
* @property {
|
|
2364
|
-
* @property {
|
|
2365
|
-
* @property {
|
|
2366
|
-
* @property {
|
|
2367
|
-
* @property {
|
|
2368
|
-
* @property {
|
|
2367
|
+
* @typedef {Object} _10yTo12yPattern
|
|
2368
|
+
* @property {ActivityPattern2} activity
|
|
2369
|
+
* @property {CostBasisPattern2} costBasis
|
|
2370
|
+
* @property {OutputsPattern} outputs
|
|
2371
|
+
* @property {RealizedPattern2} realized
|
|
2372
|
+
* @property {RelativePattern2} relative
|
|
2373
|
+
* @property {SupplyPattern2} supply
|
|
2374
|
+
* @property {UnrealizedPattern} unrealized
|
|
2369
2375
|
*/
|
|
2370
2376
|
|
|
2371
2377
|
/**
|
|
2372
|
-
* Create a
|
|
2378
|
+
* Create a _10yTo12yPattern pattern node
|
|
2373
2379
|
* @param {BrkClientBase} client
|
|
2374
2380
|
* @param {string} acc - Accumulated metric name
|
|
2375
|
-
* @returns {
|
|
2381
|
+
* @returns {_10yTo12yPattern}
|
|
2376
2382
|
*/
|
|
2377
|
-
function
|
|
2383
|
+
function create_10yTo12yPattern(client, acc) {
|
|
2378
2384
|
return {
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2385
|
+
activity: createActivityPattern2(client, acc),
|
|
2386
|
+
costBasis: createCostBasisPattern2(client, acc),
|
|
2387
|
+
outputs: createOutputsPattern(client, _m(acc, 'utxo_count')),
|
|
2388
|
+
realized: createRealizedPattern2(client, acc),
|
|
2389
|
+
relative: createRelativePattern2(client, acc),
|
|
2390
|
+
supply: createSupplyPattern2(client, _m(acc, 'supply')),
|
|
2391
|
+
unrealized: createUnrealizedPattern(client, acc),
|
|
2392
|
+
};
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
/**
|
|
2396
|
+
* @typedef {Object} UnrealizedPattern
|
|
2397
|
+
* @property {MetricPattern1<Dollars>} negUnrealizedLoss
|
|
2398
|
+
* @property {MetricPattern1<Dollars>} netUnrealizedPnl
|
|
2399
|
+
* @property {ActiveSupplyPattern} supplyInLoss
|
|
2400
|
+
* @property {ActiveSupplyPattern} supplyInProfit
|
|
2401
|
+
* @property {MetricPattern1<Dollars>} totalUnrealizedPnl
|
|
2402
|
+
* @property {MetricPattern1<Dollars>} unrealizedLoss
|
|
2403
|
+
* @property {MetricPattern1<Dollars>} unrealizedProfit
|
|
2404
|
+
*/
|
|
2405
|
+
|
|
2406
|
+
/**
|
|
2407
|
+
* Create a UnrealizedPattern pattern node
|
|
2408
|
+
* @param {BrkClientBase} client
|
|
2409
|
+
* @param {string} acc - Accumulated metric name
|
|
2410
|
+
* @returns {UnrealizedPattern}
|
|
2411
|
+
*/
|
|
2412
|
+
function createUnrealizedPattern(client, acc) {
|
|
2413
|
+
return {
|
|
2414
|
+
negUnrealizedLoss: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss')),
|
|
2415
|
+
netUnrealizedPnl: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl')),
|
|
2416
|
+
supplyInLoss: createActiveSupplyPattern(client, _m(acc, 'supply_in_loss')),
|
|
2417
|
+
supplyInProfit: createActiveSupplyPattern(client, _m(acc, 'supply_in_profit')),
|
|
2418
|
+
totalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'total_unrealized_pnl')),
|
|
2419
|
+
unrealizedLoss: createMetricPattern1(client, _m(acc, 'unrealized_loss')),
|
|
2420
|
+
unrealizedProfit: createMetricPattern1(client, _m(acc, 'unrealized_profit')),
|
|
2386
2421
|
};
|
|
2387
2422
|
}
|
|
2388
2423
|
|
|
@@ -2416,58 +2451,58 @@ function create_0satsPattern2(client, acc) {
|
|
|
2416
2451
|
}
|
|
2417
2452
|
|
|
2418
2453
|
/**
|
|
2419
|
-
* @typedef {Object}
|
|
2420
|
-
* @property {
|
|
2421
|
-
* @property {
|
|
2422
|
-
* @property {
|
|
2423
|
-
* @property {
|
|
2424
|
-
* @property {
|
|
2425
|
-
* @property {
|
|
2426
|
-
* @property {
|
|
2454
|
+
* @typedef {Object} PeriodCagrPattern
|
|
2455
|
+
* @property {MetricPattern4<StoredF32>} _10y
|
|
2456
|
+
* @property {MetricPattern4<StoredF32>} _2y
|
|
2457
|
+
* @property {MetricPattern4<StoredF32>} _3y
|
|
2458
|
+
* @property {MetricPattern4<StoredF32>} _4y
|
|
2459
|
+
* @property {MetricPattern4<StoredF32>} _5y
|
|
2460
|
+
* @property {MetricPattern4<StoredF32>} _6y
|
|
2461
|
+
* @property {MetricPattern4<StoredF32>} _8y
|
|
2427
2462
|
*/
|
|
2428
2463
|
|
|
2429
2464
|
/**
|
|
2430
|
-
* Create a
|
|
2465
|
+
* Create a PeriodCagrPattern pattern node
|
|
2431
2466
|
* @param {BrkClientBase} client
|
|
2432
2467
|
* @param {string} acc - Accumulated metric name
|
|
2433
|
-
* @returns {
|
|
2468
|
+
* @returns {PeriodCagrPattern}
|
|
2434
2469
|
*/
|
|
2435
|
-
function
|
|
2470
|
+
function createPeriodCagrPattern(client, acc) {
|
|
2436
2471
|
return {
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2472
|
+
_10y: createMetricPattern4(client, _p('10y', acc)),
|
|
2473
|
+
_2y: createMetricPattern4(client, _p('2y', acc)),
|
|
2474
|
+
_3y: createMetricPattern4(client, _p('3y', acc)),
|
|
2475
|
+
_4y: createMetricPattern4(client, _p('4y', acc)),
|
|
2476
|
+
_5y: createMetricPattern4(client, _p('5y', acc)),
|
|
2477
|
+
_6y: createMetricPattern4(client, _p('6y', acc)),
|
|
2478
|
+
_8y: createMetricPattern4(client, _p('8y', acc)),
|
|
2444
2479
|
};
|
|
2445
2480
|
}
|
|
2446
2481
|
|
|
2447
2482
|
/**
|
|
2448
|
-
* @typedef {Object}
|
|
2483
|
+
* @typedef {Object} _10yPattern
|
|
2449
2484
|
* @property {ActivityPattern2} activity
|
|
2450
|
-
* @property {
|
|
2485
|
+
* @property {CostBasisPattern} costBasis
|
|
2451
2486
|
* @property {OutputsPattern} outputs
|
|
2452
|
-
* @property {
|
|
2453
|
-
* @property {
|
|
2487
|
+
* @property {RealizedPattern4} realized
|
|
2488
|
+
* @property {RelativePattern} relative
|
|
2454
2489
|
* @property {SupplyPattern2} supply
|
|
2455
2490
|
* @property {UnrealizedPattern} unrealized
|
|
2456
2491
|
*/
|
|
2457
2492
|
|
|
2458
2493
|
/**
|
|
2459
|
-
* Create a
|
|
2494
|
+
* Create a _10yPattern pattern node
|
|
2460
2495
|
* @param {BrkClientBase} client
|
|
2461
2496
|
* @param {string} acc - Accumulated metric name
|
|
2462
|
-
* @returns {
|
|
2497
|
+
* @returns {_10yPattern}
|
|
2463
2498
|
*/
|
|
2464
|
-
function
|
|
2499
|
+
function create_10yPattern(client, acc) {
|
|
2465
2500
|
return {
|
|
2466
2501
|
activity: createActivityPattern2(client, acc),
|
|
2467
|
-
costBasis:
|
|
2502
|
+
costBasis: createCostBasisPattern(client, acc),
|
|
2468
2503
|
outputs: createOutputsPattern(client, _m(acc, 'utxo_count')),
|
|
2469
|
-
realized:
|
|
2470
|
-
relative:
|
|
2504
|
+
realized: createRealizedPattern4(client, acc),
|
|
2505
|
+
relative: createRelativePattern(client, acc),
|
|
2471
2506
|
supply: createSupplyPattern2(client, _m(acc, 'supply')),
|
|
2472
2507
|
unrealized: createUnrealizedPattern(client, acc),
|
|
2473
2508
|
};
|
|
@@ -2502,35 +2537,6 @@ function create_100btcPattern(client, acc) {
|
|
|
2502
2537
|
};
|
|
2503
2538
|
}
|
|
2504
2539
|
|
|
2505
|
-
/**
|
|
2506
|
-
* @typedef {Object} UnrealizedPattern
|
|
2507
|
-
* @property {MetricPattern1<Dollars>} negUnrealizedLoss
|
|
2508
|
-
* @property {MetricPattern1<Dollars>} netUnrealizedPnl
|
|
2509
|
-
* @property {ActiveSupplyPattern} supplyInLoss
|
|
2510
|
-
* @property {ActiveSupplyPattern} supplyInProfit
|
|
2511
|
-
* @property {MetricPattern1<Dollars>} totalUnrealizedPnl
|
|
2512
|
-
* @property {MetricPattern1<Dollars>} unrealizedLoss
|
|
2513
|
-
* @property {MetricPattern1<Dollars>} unrealizedProfit
|
|
2514
|
-
*/
|
|
2515
|
-
|
|
2516
|
-
/**
|
|
2517
|
-
* Create a UnrealizedPattern pattern node
|
|
2518
|
-
* @param {BrkClientBase} client
|
|
2519
|
-
* @param {string} acc - Accumulated metric name
|
|
2520
|
-
* @returns {UnrealizedPattern}
|
|
2521
|
-
*/
|
|
2522
|
-
function createUnrealizedPattern(client, acc) {
|
|
2523
|
-
return {
|
|
2524
|
-
negUnrealizedLoss: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss')),
|
|
2525
|
-
netUnrealizedPnl: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl')),
|
|
2526
|
-
supplyInLoss: createActiveSupplyPattern(client, _m(acc, 'supply_in_loss')),
|
|
2527
|
-
supplyInProfit: createActiveSupplyPattern(client, _m(acc, 'supply_in_profit')),
|
|
2528
|
-
totalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'total_unrealized_pnl')),
|
|
2529
|
-
unrealizedLoss: createMetricPattern1(client, _m(acc, 'unrealized_loss')),
|
|
2530
|
-
unrealizedProfit: createMetricPattern1(client, _m(acc, 'unrealized_profit')),
|
|
2531
|
-
};
|
|
2532
|
-
}
|
|
2533
|
-
|
|
2534
2540
|
/**
|
|
2535
2541
|
* @typedef {Object} ActivityPattern2
|
|
2536
2542
|
* @property {BlockCountPattern<StoredF64>} coinblocksDestroyed
|
|
@@ -2582,23 +2588,23 @@ function createSplitPattern2(client, acc) {
|
|
|
2582
2588
|
}
|
|
2583
2589
|
|
|
2584
2590
|
/**
|
|
2585
|
-
* @typedef {Object}
|
|
2586
|
-
* @property {
|
|
2587
|
-
* @property {
|
|
2588
|
-
* @property {
|
|
2591
|
+
* @typedef {Object} UnclaimedRewardsPattern
|
|
2592
|
+
* @property {BitcoinPattern2<Bitcoin>} bitcoin
|
|
2593
|
+
* @property {BlockCountPattern<Dollars>} dollars
|
|
2594
|
+
* @property {BlockCountPattern<Sats>} sats
|
|
2589
2595
|
*/
|
|
2590
2596
|
|
|
2591
2597
|
/**
|
|
2592
|
-
* Create a
|
|
2598
|
+
* Create a UnclaimedRewardsPattern pattern node
|
|
2593
2599
|
* @param {BrkClientBase} client
|
|
2594
2600
|
* @param {string} acc - Accumulated metric name
|
|
2595
|
-
* @returns {
|
|
2601
|
+
* @returns {UnclaimedRewardsPattern}
|
|
2596
2602
|
*/
|
|
2597
|
-
function
|
|
2603
|
+
function createUnclaimedRewardsPattern(client, acc) {
|
|
2598
2604
|
return {
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2605
|
+
bitcoin: createBitcoinPattern2(client, _m(acc, 'btc')),
|
|
2606
|
+
dollars: createBlockCountPattern(client, _m(acc, 'usd')),
|
|
2607
|
+
sats: createBlockCountPattern(client, acc),
|
|
2602
2608
|
};
|
|
2603
2609
|
}
|
|
2604
2610
|
|
|
@@ -2624,65 +2630,65 @@ function createCoinbasePattern(client, acc) {
|
|
|
2624
2630
|
}
|
|
2625
2631
|
|
|
2626
2632
|
/**
|
|
2627
|
-
* @typedef {Object}
|
|
2628
|
-
* @property {
|
|
2629
|
-
* @property {
|
|
2630
|
-
* @property {
|
|
2633
|
+
* @typedef {Object} SegwitAdoptionPattern
|
|
2634
|
+
* @property {MetricPattern11<StoredF32>} base
|
|
2635
|
+
* @property {MetricPattern2<StoredF32>} cumulative
|
|
2636
|
+
* @property {MetricPattern2<StoredF32>} sum
|
|
2631
2637
|
*/
|
|
2632
2638
|
|
|
2633
2639
|
/**
|
|
2634
|
-
* Create a
|
|
2640
|
+
* Create a SegwitAdoptionPattern pattern node
|
|
2635
2641
|
* @param {BrkClientBase} client
|
|
2636
2642
|
* @param {string} acc - Accumulated metric name
|
|
2637
|
-
* @returns {
|
|
2643
|
+
* @returns {SegwitAdoptionPattern}
|
|
2638
2644
|
*/
|
|
2639
|
-
function
|
|
2645
|
+
function createSegwitAdoptionPattern(client, acc) {
|
|
2640
2646
|
return {
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2647
|
+
base: createMetricPattern11(client, acc),
|
|
2648
|
+
cumulative: createMetricPattern2(client, _m(acc, 'cumulative')),
|
|
2649
|
+
sum: createMetricPattern2(client, _m(acc, 'sum')),
|
|
2644
2650
|
};
|
|
2645
2651
|
}
|
|
2646
2652
|
|
|
2647
2653
|
/**
|
|
2648
|
-
* @typedef {Object}
|
|
2649
|
-
* @property {
|
|
2650
|
-
* @property {
|
|
2651
|
-
* @property {
|
|
2654
|
+
* @typedef {Object} CostBasisPattern2
|
|
2655
|
+
* @property {MetricPattern1<Dollars>} max
|
|
2656
|
+
* @property {MetricPattern1<Dollars>} min
|
|
2657
|
+
* @property {PercentilesPattern} percentiles
|
|
2652
2658
|
*/
|
|
2653
2659
|
|
|
2654
2660
|
/**
|
|
2655
|
-
* Create a
|
|
2661
|
+
* Create a CostBasisPattern2 pattern node
|
|
2656
2662
|
* @param {BrkClientBase} client
|
|
2657
2663
|
* @param {string} acc - Accumulated metric name
|
|
2658
|
-
* @returns {
|
|
2664
|
+
* @returns {CostBasisPattern2}
|
|
2659
2665
|
*/
|
|
2660
|
-
function
|
|
2666
|
+
function createCostBasisPattern2(client, acc) {
|
|
2661
2667
|
return {
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2668
|
+
max: createMetricPattern1(client, _m(acc, 'max_cost_basis')),
|
|
2669
|
+
min: createMetricPattern1(client, _m(acc, 'min_cost_basis')),
|
|
2670
|
+
percentiles: createPercentilesPattern(client, _m(acc, 'cost_basis')),
|
|
2665
2671
|
};
|
|
2666
2672
|
}
|
|
2667
2673
|
|
|
2668
2674
|
/**
|
|
2669
|
-
* @typedef {Object}
|
|
2670
|
-
* @property {
|
|
2671
|
-
* @property {
|
|
2672
|
-
* @property {
|
|
2675
|
+
* @typedef {Object} ActiveSupplyPattern
|
|
2676
|
+
* @property {MetricPattern1<Bitcoin>} bitcoin
|
|
2677
|
+
* @property {MetricPattern1<Dollars>} dollars
|
|
2678
|
+
* @property {MetricPattern1<Sats>} sats
|
|
2673
2679
|
*/
|
|
2674
2680
|
|
|
2675
2681
|
/**
|
|
2676
|
-
* Create a
|
|
2682
|
+
* Create a ActiveSupplyPattern pattern node
|
|
2677
2683
|
* @param {BrkClientBase} client
|
|
2678
2684
|
* @param {string} acc - Accumulated metric name
|
|
2679
|
-
* @returns {
|
|
2685
|
+
* @returns {ActiveSupplyPattern}
|
|
2680
2686
|
*/
|
|
2681
|
-
function
|
|
2687
|
+
function createActiveSupplyPattern(client, acc) {
|
|
2682
2688
|
return {
|
|
2683
|
-
bitcoin:
|
|
2684
|
-
dollars:
|
|
2685
|
-
sats:
|
|
2689
|
+
bitcoin: createMetricPattern1(client, _m(acc, 'btc')),
|
|
2690
|
+
dollars: createMetricPattern1(client, _m(acc, 'usd')),
|
|
2691
|
+
sats: createMetricPattern1(client, acc),
|
|
2686
2692
|
};
|
|
2687
2693
|
}
|
|
2688
2694
|
|
|
@@ -2708,23 +2714,23 @@ function create_2015Pattern(client, acc) {
|
|
|
2708
2714
|
}
|
|
2709
2715
|
|
|
2710
2716
|
/**
|
|
2711
|
-
* @typedef {Object}
|
|
2712
|
-
* @property {
|
|
2713
|
-
* @property {
|
|
2714
|
-
* @property {
|
|
2717
|
+
* @typedef {Object} CoinbasePattern2
|
|
2718
|
+
* @property {BlockCountPattern<Bitcoin>} bitcoin
|
|
2719
|
+
* @property {BlockCountPattern<Dollars>} dollars
|
|
2720
|
+
* @property {BlockCountPattern<Sats>} sats
|
|
2715
2721
|
*/
|
|
2716
2722
|
|
|
2717
2723
|
/**
|
|
2718
|
-
* Create a
|
|
2724
|
+
* Create a CoinbasePattern2 pattern node
|
|
2719
2725
|
* @param {BrkClientBase} client
|
|
2720
2726
|
* @param {string} acc - Accumulated metric name
|
|
2721
|
-
* @returns {
|
|
2727
|
+
* @returns {CoinbasePattern2}
|
|
2722
2728
|
*/
|
|
2723
|
-
function
|
|
2729
|
+
function createCoinbasePattern2(client, acc) {
|
|
2724
2730
|
return {
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2731
|
+
bitcoin: createBlockCountPattern(client, _m(acc, 'btc')),
|
|
2732
|
+
dollars: createBlockCountPattern(client, _m(acc, 'usd')),
|
|
2733
|
+
sats: createBlockCountPattern(client, acc),
|
|
2728
2734
|
};
|
|
2729
2735
|
}
|
|
2730
2736
|
|
|
@@ -2767,40 +2773,40 @@ function createCostBasisPattern(client, acc) {
|
|
|
2767
2773
|
}
|
|
2768
2774
|
|
|
2769
2775
|
/**
|
|
2770
|
-
* @typedef {Object}
|
|
2771
|
-
* @property {
|
|
2772
|
-
* @property {
|
|
2776
|
+
* @typedef {Object} SupplyPattern2
|
|
2777
|
+
* @property {ActiveSupplyPattern} halved
|
|
2778
|
+
* @property {ActiveSupplyPattern} total
|
|
2773
2779
|
*/
|
|
2774
2780
|
|
|
2775
2781
|
/**
|
|
2776
|
-
* Create a
|
|
2782
|
+
* Create a SupplyPattern2 pattern node
|
|
2777
2783
|
* @param {BrkClientBase} client
|
|
2778
2784
|
* @param {string} acc - Accumulated metric name
|
|
2779
|
-
* @returns {
|
|
2785
|
+
* @returns {SupplyPattern2}
|
|
2780
2786
|
*/
|
|
2781
|
-
function
|
|
2787
|
+
function createSupplyPattern2(client, acc) {
|
|
2782
2788
|
return {
|
|
2783
|
-
|
|
2784
|
-
|
|
2789
|
+
halved: createActiveSupplyPattern(client, _m(acc, 'halved')),
|
|
2790
|
+
total: createActiveSupplyPattern(client, acc),
|
|
2785
2791
|
};
|
|
2786
2792
|
}
|
|
2787
2793
|
|
|
2788
2794
|
/**
|
|
2789
|
-
* @typedef {Object}
|
|
2790
|
-
* @property {
|
|
2791
|
-
* @property {
|
|
2795
|
+
* @typedef {Object} RelativePattern4
|
|
2796
|
+
* @property {MetricPattern1<StoredF64>} supplyInLossRelToOwnSupply
|
|
2797
|
+
* @property {MetricPattern1<StoredF64>} supplyInProfitRelToOwnSupply
|
|
2792
2798
|
*/
|
|
2793
2799
|
|
|
2794
2800
|
/**
|
|
2795
|
-
* Create a
|
|
2801
|
+
* Create a RelativePattern4 pattern node
|
|
2796
2802
|
* @param {BrkClientBase} client
|
|
2797
2803
|
* @param {string} acc - Accumulated metric name
|
|
2798
|
-
* @returns {
|
|
2804
|
+
* @returns {RelativePattern4}
|
|
2799
2805
|
*/
|
|
2800
|
-
function
|
|
2806
|
+
function createRelativePattern4(client, acc) {
|
|
2801
2807
|
return {
|
|
2802
|
-
|
|
2803
|
-
|
|
2808
|
+
supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'loss_rel_to_own_supply')),
|
|
2809
|
+
supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'profit_rel_to_own_supply')),
|
|
2804
2810
|
};
|
|
2805
2811
|
}
|
|
2806
2812
|
|
|
@@ -2841,8 +2847,8 @@ function createBitcoinPattern2(client, acc) {
|
|
|
2841
2847
|
*/
|
|
2842
2848
|
function createSatsPattern(client, acc) {
|
|
2843
2849
|
return {
|
|
2844
|
-
ohlc: createMetricPattern1(client, _m(acc, '
|
|
2845
|
-
split: createSplitPattern2(client,
|
|
2850
|
+
ohlc: createMetricPattern1(client, _m(acc, 'ohlc')),
|
|
2851
|
+
split: createSplitPattern2(client, acc),
|
|
2846
2852
|
};
|
|
2847
2853
|
}
|
|
2848
2854
|
|
|
@@ -3054,6 +3060,7 @@ function createRealizedPriceExtraPattern(client, acc) {
|
|
|
3054
3060
|
* @property {MetricsTree_Cointime_Adjusted} adjusted
|
|
3055
3061
|
* @property {MetricsTree_Cointime_Cap} cap
|
|
3056
3062
|
* @property {MetricsTree_Cointime_Pricing} pricing
|
|
3063
|
+
* @property {MetricsTree_Cointime_ReserveRisk} reserveRisk
|
|
3057
3064
|
* @property {MetricsTree_Cointime_Supply} supply
|
|
3058
3065
|
* @property {MetricsTree_Cointime_Value} value
|
|
3059
3066
|
*/
|
|
@@ -3095,6 +3102,13 @@ function createRealizedPriceExtraPattern(client, acc) {
|
|
|
3095
3102
|
* @property {ActivePriceRatioPattern} vaultedPriceRatio
|
|
3096
3103
|
*/
|
|
3097
3104
|
|
|
3105
|
+
/**
|
|
3106
|
+
* @typedef {Object} MetricsTree_Cointime_ReserveRisk
|
|
3107
|
+
* @property {MetricPattern6<StoredF64>} hodlBank
|
|
3108
|
+
* @property {MetricPattern4<StoredF64>} reserveRisk
|
|
3109
|
+
* @property {MetricPattern6<StoredF64>} vocdd365dSma
|
|
3110
|
+
*/
|
|
3111
|
+
|
|
3098
3112
|
/**
|
|
3099
3113
|
* @typedef {Object} MetricsTree_Cointime_Supply
|
|
3100
3114
|
* @property {ActiveSupplyPattern} activeSupply
|
|
@@ -3106,6 +3120,7 @@ function createRealizedPriceExtraPattern(client, acc) {
|
|
|
3106
3120
|
* @property {BlockCountPattern<StoredF64>} cointimeValueCreated
|
|
3107
3121
|
* @property {BlockCountPattern<StoredF64>} cointimeValueDestroyed
|
|
3108
3122
|
* @property {BlockCountPattern<StoredF64>} cointimeValueStored
|
|
3123
|
+
* @property {BlockCountPattern<StoredF64>} vocdd
|
|
3109
3124
|
*/
|
|
3110
3125
|
|
|
3111
3126
|
/**
|
|
@@ -3124,10 +3139,10 @@ function createRealizedPriceExtraPattern(client, acc) {
|
|
|
3124
3139
|
* @property {MetricPattern1<StoredF32>} constant618
|
|
3125
3140
|
* @property {MetricPattern1<StoredU16>} constant70
|
|
3126
3141
|
* @property {MetricPattern1<StoredU16>} constant80
|
|
3127
|
-
* @property {MetricPattern1<
|
|
3128
|
-
* @property {MetricPattern1<
|
|
3129
|
-
* @property {MetricPattern1<
|
|
3130
|
-
* @property {MetricPattern1<
|
|
3142
|
+
* @property {MetricPattern1<StoredI8>} constantMinus1
|
|
3143
|
+
* @property {MetricPattern1<StoredI8>} constantMinus2
|
|
3144
|
+
* @property {MetricPattern1<StoredI8>} constantMinus3
|
|
3145
|
+
* @property {MetricPattern1<StoredI8>} constantMinus4
|
|
3131
3146
|
*/
|
|
3132
3147
|
|
|
3133
3148
|
/**
|
|
@@ -3696,8 +3711,8 @@ function createRealizedPriceExtraPattern(client, acc) {
|
|
|
3696
3711
|
|
|
3697
3712
|
/**
|
|
3698
3713
|
* @typedef {Object} MetricsTree_Market_Dca
|
|
3699
|
-
* @property {
|
|
3700
|
-
* @property {
|
|
3714
|
+
* @property {ClassAveragePricePattern<Dollars>} classAveragePrice
|
|
3715
|
+
* @property {MetricsTree_Market_Dca_ClassReturns} classReturns
|
|
3701
3716
|
* @property {MetricsTree_Market_Dca_ClassStack} classStack
|
|
3702
3717
|
* @property {PeriodAveragePricePattern<Dollars>} periodAveragePrice
|
|
3703
3718
|
* @property {PeriodCagrPattern} periodCagr
|
|
@@ -3707,18 +3722,19 @@ function createRealizedPriceExtraPattern(client, acc) {
|
|
|
3707
3722
|
*/
|
|
3708
3723
|
|
|
3709
3724
|
/**
|
|
3710
|
-
* @typedef {Object}
|
|
3711
|
-
* @property {MetricPattern4<
|
|
3712
|
-
* @property {MetricPattern4<
|
|
3713
|
-
* @property {MetricPattern4<
|
|
3714
|
-
* @property {MetricPattern4<
|
|
3715
|
-
* @property {MetricPattern4<
|
|
3716
|
-
* @property {MetricPattern4<
|
|
3717
|
-
* @property {MetricPattern4<
|
|
3718
|
-
* @property {MetricPattern4<
|
|
3719
|
-
* @property {MetricPattern4<
|
|
3720
|
-
* @property {MetricPattern4<
|
|
3721
|
-
* @property {MetricPattern4<
|
|
3725
|
+
* @typedef {Object} MetricsTree_Market_Dca_ClassReturns
|
|
3726
|
+
* @property {MetricPattern4<StoredF32>} _2015
|
|
3727
|
+
* @property {MetricPattern4<StoredF32>} _2016
|
|
3728
|
+
* @property {MetricPattern4<StoredF32>} _2017
|
|
3729
|
+
* @property {MetricPattern4<StoredF32>} _2018
|
|
3730
|
+
* @property {MetricPattern4<StoredF32>} _2019
|
|
3731
|
+
* @property {MetricPattern4<StoredF32>} _2020
|
|
3732
|
+
* @property {MetricPattern4<StoredF32>} _2021
|
|
3733
|
+
* @property {MetricPattern4<StoredF32>} _2022
|
|
3734
|
+
* @property {MetricPattern4<StoredF32>} _2023
|
|
3735
|
+
* @property {MetricPattern4<StoredF32>} _2024
|
|
3736
|
+
* @property {MetricPattern4<StoredF32>} _2025
|
|
3737
|
+
* @property {MetricPattern4<StoredF32>} _2026
|
|
3722
3738
|
*/
|
|
3723
3739
|
|
|
3724
3740
|
/**
|
|
@@ -3734,6 +3750,7 @@ function createRealizedPriceExtraPattern(client, acc) {
|
|
|
3734
3750
|
* @property {_2015Pattern} _2023
|
|
3735
3751
|
* @property {_2015Pattern} _2024
|
|
3736
3752
|
* @property {_2015Pattern} _2025
|
|
3753
|
+
* @property {_2015Pattern} _2026
|
|
3737
3754
|
*/
|
|
3738
3755
|
|
|
3739
3756
|
/**
|
|
@@ -4056,8 +4073,8 @@ function createRealizedPriceExtraPattern(client, acc) {
|
|
|
4056
4073
|
* @typedef {Object} MetricsTree_Price
|
|
4057
4074
|
* @property {MetricsTree_Price_Cents} cents
|
|
4058
4075
|
* @property {MetricsTree_Price_Oracle} oracle
|
|
4059
|
-
* @property {
|
|
4060
|
-
* @property {
|
|
4076
|
+
* @property {MetricsTree_Price_Sats} sats
|
|
4077
|
+
* @property {SatsPattern<OHLCDollars>} usd
|
|
4061
4078
|
*/
|
|
4062
4079
|
|
|
4063
4080
|
/**
|
|
@@ -4076,7 +4093,11 @@ function createRealizedPriceExtraPattern(client, acc) {
|
|
|
4076
4093
|
|
|
4077
4094
|
/**
|
|
4078
4095
|
* @typedef {Object} MetricsTree_Price_Oracle
|
|
4096
|
+
* @property {MetricPattern6<OHLCCents>} closeOhlcCents
|
|
4097
|
+
* @property {MetricPattern6<OHLCDollars>} closeOhlcDollars
|
|
4079
4098
|
* @property {MetricPattern11<PairOutputIndex>} heightToFirstPairoutputindex
|
|
4099
|
+
* @property {MetricPattern6<OHLCCents>} midOhlcCents
|
|
4100
|
+
* @property {MetricPattern6<OHLCDollars>} midOhlcDollars
|
|
4080
4101
|
* @property {MetricPattern6<OHLCCents>} ohlcCents
|
|
4081
4102
|
* @property {MetricPattern6<OHLCDollars>} ohlcDollars
|
|
4082
4103
|
* @property {MetricPattern33<Sats>} output0Value
|
|
@@ -4105,9 +4126,9 @@ function createRealizedPriceExtraPattern(client, acc) {
|
|
|
4105
4126
|
*/
|
|
4106
4127
|
|
|
4107
4128
|
/**
|
|
4108
|
-
* @typedef {Object}
|
|
4109
|
-
* @property {MetricPattern1<
|
|
4110
|
-
* @property {SplitPattern2<
|
|
4129
|
+
* @typedef {Object} MetricsTree_Price_Sats
|
|
4130
|
+
* @property {MetricPattern1<OHLCSats>} ohlc
|
|
4131
|
+
* @property {SplitPattern2<Sats>} split
|
|
4111
4132
|
*/
|
|
4112
4133
|
|
|
4113
4134
|
/**
|
|
@@ -4250,6 +4271,7 @@ function createRealizedPriceExtraPattern(client, acc) {
|
|
|
4250
4271
|
* @property {_2015Pattern} annualizedVolume
|
|
4251
4272
|
* @property {MetricPattern4<StoredF32>} inputsPerSec
|
|
4252
4273
|
* @property {MetricPattern4<StoredF32>} outputsPerSec
|
|
4274
|
+
* @property {ActiveSupplyPattern} receivedSum
|
|
4253
4275
|
* @property {ActiveSupplyPattern} sentSum
|
|
4254
4276
|
* @property {MetricPattern4<StoredF32>} txPerSec
|
|
4255
4277
|
*/
|
|
@@ -4259,7 +4281,7 @@ function createRealizedPriceExtraPattern(client, acc) {
|
|
|
4259
4281
|
* @extends BrkClientBase
|
|
4260
4282
|
*/
|
|
4261
4283
|
class BrkClient extends BrkClientBase {
|
|
4262
|
-
VERSION = "v0.1.0-alpha.
|
|
4284
|
+
VERSION = "v0.1.0-alpha.6";
|
|
4263
4285
|
|
|
4264
4286
|
INDEXES = /** @type {const} */ ([
|
|
4265
4287
|
"dateindex",
|
|
@@ -5297,6 +5319,11 @@ class BrkClient extends BrkClientBase {
|
|
|
5297
5319
|
vaultedPrice: createMetricPattern1(this, 'vaulted_price'),
|
|
5298
5320
|
vaultedPriceRatio: createActivePriceRatioPattern(this, 'vaulted_price_ratio'),
|
|
5299
5321
|
},
|
|
5322
|
+
reserveRisk: {
|
|
5323
|
+
hodlBank: createMetricPattern6(this, 'hodl_bank'),
|
|
5324
|
+
reserveRisk: createMetricPattern4(this, 'reserve_risk'),
|
|
5325
|
+
vocdd365dSma: createMetricPattern6(this, 'vocdd_365d_sma'),
|
|
5326
|
+
},
|
|
5300
5327
|
supply: {
|
|
5301
5328
|
activeSupply: createActiveSupplyPattern(this, 'active_supply'),
|
|
5302
5329
|
vaultedSupply: createActiveSupplyPattern(this, 'vaulted_supply'),
|
|
@@ -5305,6 +5332,7 @@ class BrkClient extends BrkClientBase {
|
|
|
5305
5332
|
cointimeValueCreated: createBlockCountPattern(this, 'cointime_value_created'),
|
|
5306
5333
|
cointimeValueDestroyed: createBlockCountPattern(this, 'cointime_value_destroyed'),
|
|
5307
5334
|
cointimeValueStored: createBlockCountPattern(this, 'cointime_value_stored'),
|
|
5335
|
+
vocdd: createBlockCountPattern(this, 'vocdd'),
|
|
5308
5336
|
},
|
|
5309
5337
|
},
|
|
5310
5338
|
constants: {
|
|
@@ -5726,20 +5754,21 @@ class BrkClient extends BrkClientBase {
|
|
|
5726
5754
|
yearsSincePriceAth: createMetricPattern4(this, 'years_since_price_ath'),
|
|
5727
5755
|
},
|
|
5728
5756
|
dca: {
|
|
5729
|
-
classAveragePrice:
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5757
|
+
classAveragePrice: createClassAveragePricePattern(this, 'dca_class'),
|
|
5758
|
+
classReturns: {
|
|
5759
|
+
_2015: createMetricPattern4(this, 'dca_class_2015_returns'),
|
|
5760
|
+
_2016: createMetricPattern4(this, 'dca_class_2016_returns'),
|
|
5761
|
+
_2017: createMetricPattern4(this, 'dca_class_2017_returns'),
|
|
5762
|
+
_2018: createMetricPattern4(this, 'dca_class_2018_returns'),
|
|
5763
|
+
_2019: createMetricPattern4(this, 'dca_class_2019_returns'),
|
|
5764
|
+
_2020: createMetricPattern4(this, 'dca_class_2020_returns'),
|
|
5765
|
+
_2021: createMetricPattern4(this, 'dca_class_2021_returns'),
|
|
5766
|
+
_2022: createMetricPattern4(this, 'dca_class_2022_returns'),
|
|
5767
|
+
_2023: createMetricPattern4(this, 'dca_class_2023_returns'),
|
|
5768
|
+
_2024: createMetricPattern4(this, 'dca_class_2024_returns'),
|
|
5769
|
+
_2025: createMetricPattern4(this, 'dca_class_2025_returns'),
|
|
5770
|
+
_2026: createMetricPattern4(this, 'dca_class_2026_returns'),
|
|
5741
5771
|
},
|
|
5742
|
-
classReturns: createClassAveragePricePattern(this, 'dca_class'),
|
|
5743
5772
|
classStack: {
|
|
5744
5773
|
_2015: create_2015Pattern(this, 'dca_class_2015_stack'),
|
|
5745
5774
|
_2016: create_2015Pattern(this, 'dca_class_2016_stack'),
|
|
@@ -5752,6 +5781,7 @@ class BrkClient extends BrkClientBase {
|
|
|
5752
5781
|
_2023: create_2015Pattern(this, 'dca_class_2023_stack'),
|
|
5753
5782
|
_2024: create_2015Pattern(this, 'dca_class_2024_stack'),
|
|
5754
5783
|
_2025: create_2015Pattern(this, 'dca_class_2025_stack'),
|
|
5784
|
+
_2026: create_2015Pattern(this, 'dca_class_2026_stack'),
|
|
5755
5785
|
},
|
|
5756
5786
|
periodAveragePrice: createPeriodAveragePricePattern(this, 'dca_average_price'),
|
|
5757
5787
|
periodCagr: createPeriodCagrPattern(this, 'dca_cagr'),
|
|
@@ -6060,7 +6090,11 @@ class BrkClient extends BrkClientBase {
|
|
|
6060
6090
|
},
|
|
6061
6091
|
},
|
|
6062
6092
|
oracle: {
|
|
6093
|
+
closeOhlcCents: createMetricPattern6(this, 'close_ohlc_cents'),
|
|
6094
|
+
closeOhlcDollars: createMetricPattern6(this, 'close_ohlc_dollars'),
|
|
6063
6095
|
heightToFirstPairoutputindex: createMetricPattern11(this, 'height_to_first_pairoutputindex'),
|
|
6096
|
+
midOhlcCents: createMetricPattern6(this, 'mid_ohlc_cents'),
|
|
6097
|
+
midOhlcDollars: createMetricPattern6(this, 'mid_ohlc_dollars'),
|
|
6064
6098
|
ohlcCents: createMetricPattern6(this, 'oracle_ohlc_cents'),
|
|
6065
6099
|
ohlcDollars: createMetricPattern6(this, 'oracle_ohlc'),
|
|
6066
6100
|
output0Value: createMetricPattern33(this, 'pair_output0_value'),
|
|
@@ -6087,11 +6121,11 @@ class BrkClient extends BrkClientBase {
|
|
|
6087
6121
|
priceCents: createMetricPattern11(this, 'oracle_price_cents'),
|
|
6088
6122
|
txCount: createMetricPattern6(this, 'oracle_tx_count'),
|
|
6089
6123
|
},
|
|
6090
|
-
sats:
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
split: createSplitPattern2(this, 'price'),
|
|
6124
|
+
sats: {
|
|
6125
|
+
ohlc: createMetricPattern1(this, 'price_ohlc_sats'),
|
|
6126
|
+
split: createSplitPattern2(this, 'price_sats'),
|
|
6094
6127
|
},
|
|
6128
|
+
usd: createSatsPattern(this, 'price'),
|
|
6095
6129
|
},
|
|
6096
6130
|
scripts: {
|
|
6097
6131
|
count: {
|
|
@@ -6191,6 +6225,7 @@ class BrkClient extends BrkClientBase {
|
|
|
6191
6225
|
annualizedVolume: create_2015Pattern(this, 'annualized_volume'),
|
|
6192
6226
|
inputsPerSec: createMetricPattern4(this, 'inputs_per_sec'),
|
|
6193
6227
|
outputsPerSec: createMetricPattern4(this, 'outputs_per_sec'),
|
|
6228
|
+
receivedSum: createActiveSupplyPattern(this, 'received_sum'),
|
|
6194
6229
|
sentSum: createActiveSupplyPattern(this, 'sent_sum'),
|
|
6195
6230
|
txPerSec: createMetricPattern4(this, 'tx_per_sec'),
|
|
6196
6231
|
},
|
package/package.json
CHANGED