Compare commits

...

7 Commits

Author SHA1 Message Date
nym21 7562f51e07 release: v0.0.36 2025-05-13 13:01:32 +02:00
nym21 09bba99e68 kibo: add priceline 2025-05-13 13:01:11 +02:00
nym21 9d674cd49b global: snapshot 2025-05-13 11:46:03 +02:00
nym21 88a0c9ea03 global: returns (lump sum vs dca) 2025-05-13 01:27:21 +02:00
nym21 5014e0ce3e release: v0.0.35 2025-05-12 12:56:08 +02:00
nym21 b7a1ee9ebc global: averages + ratio datasets 2025-05-12 12:55:40 +02:00
nym21 292ceddd66 comp + kibo: add market smas 2025-05-10 13:17:51 +02:00
52 changed files with 4616 additions and 673 deletions
Generated
+96 -110
View File
@@ -30,15 +30,15 @@ dependencies = [
[[package]]
name = "ahash"
version = "0.8.11"
version = "0.8.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"
dependencies = [
"cfg-if",
"getrandom 0.2.16",
"getrandom 0.3.3",
"once_cell",
"version_check",
"zerocopy 0.7.35",
"zerocopy",
]
[[package]]
@@ -381,7 +381,7 @@ dependencies = [
[[package]]
name = "brk"
version = "0.0.34"
version = "0.0.36"
dependencies = [
"brk_cli",
"brk_computer",
@@ -398,7 +398,7 @@ dependencies = [
[[package]]
name = "brk_cli"
version = "0.0.34"
version = "0.0.36"
dependencies = [
"brk_computer",
"brk_core",
@@ -421,7 +421,7 @@ dependencies = [
[[package]]
name = "brk_computer"
version = "0.0.34"
version = "0.0.36"
dependencies = [
"brk_core",
"brk_exit",
@@ -435,17 +435,18 @@ dependencies = [
"color-eyre",
"fjall",
"log",
"rayon",
"serde",
"serde_json",
]
[[package]]
name = "brk_core"
version = "0.0.34"
version = "0.0.36"
dependencies = [
"bitcoin",
"bitcoincore-rpc",
"byteview",
"byteview 0.7.0",
"derive_deref",
"jiff",
"log",
@@ -454,13 +455,13 @@ dependencies = [
"serde",
"serde_bytes",
"serde_derive",
"zerocopy 0.8.25",
"zerocopy-derive 0.8.25",
"zerocopy",
"zerocopy-derive",
]
[[package]]
name = "brk_exit"
version = "0.0.34"
version = "0.0.36"
dependencies = [
"brk_logger",
"ctrlc",
@@ -469,7 +470,7 @@ dependencies = [
[[package]]
name = "brk_fetcher"
version = "0.0.34"
version = "0.0.36"
dependencies = [
"brk_core",
"brk_logger",
@@ -482,7 +483,7 @@ dependencies = [
[[package]]
name = "brk_indexer"
version = "0.0.34"
version = "0.0.36"
dependencies = [
"bitcoin",
"bitcoincore-rpc",
@@ -491,17 +492,17 @@ dependencies = [
"brk_logger",
"brk_parser",
"brk_vec",
"byteview",
"byteview 0.7.0",
"color-eyre",
"fjall",
"log",
"rayon",
"zerocopy 0.8.25",
"zerocopy",
]
[[package]]
name = "brk_logger"
version = "0.0.34"
version = "0.0.36"
dependencies = [
"color-eyre",
"env_logger",
@@ -511,7 +512,7 @@ dependencies = [
[[package]]
name = "brk_parser"
version = "0.0.34"
version = "0.0.36"
dependencies = [
"bitcoin",
"bitcoincore-rpc",
@@ -521,12 +522,12 @@ dependencies = [
"rayon",
"serde",
"serde_json",
"zerocopy 0.8.25",
"zerocopy",
]
[[package]]
name = "brk_query"
version = "0.0.34"
version = "0.0.36"
dependencies = [
"brk_computer",
"brk_indexer",
@@ -543,7 +544,7 @@ dependencies = [
[[package]]
name = "brk_server"
version = "0.0.34"
version = "0.0.36"
dependencies = [
"axum",
"brk_computer",
@@ -571,7 +572,7 @@ dependencies = [
[[package]]
name = "brk_vec"
version = "0.0.34"
version = "0.0.36"
dependencies = [
"arc-swap",
"brk_core",
@@ -583,8 +584,8 @@ dependencies = [
"rayon",
"serde",
"serde_json",
"zerocopy 0.8.25",
"zerocopy-derive 0.8.25",
"zerocopy",
"zerocopy-derive",
"zstd",
]
@@ -642,6 +643,12 @@ version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6236364b88b9b6d0bc181ba374cf1ab55ba3ef97a1cb6f8cddad48a273767fb5"
[[package]]
name = "byteview"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f996a0c883b1ae93c53ffd21857b6eaba768998dbb1f7e2f269d53dd6553256c"
[[package]]
name = "bzip2"
version = "0.5.2"
@@ -672,9 +679,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.2.21"
version = "1.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8691782945451c1c383942c4874dbe63814f61cb57ef773cda2972682b7bb3c0"
checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1"
dependencies = [
"jobserver",
"libc",
@@ -718,18 +725,18 @@ dependencies = [
[[package]]
name = "clap"
version = "4.5.37"
version = "4.5.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071"
checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000"
dependencies = [
"clap_builder",
]
[[package]]
name = "clap_builder"
version = "4.5.37"
version = "4.5.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2"
checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120"
dependencies = [
"anstream",
"anstyle",
@@ -937,9 +944,9 @@ dependencies = [
[[package]]
name = "ctrlc"
version = "3.4.6"
version = "3.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "697b5419f348fd5ae2478e8018cb016c00a5881c7f46c717de98ffd135a5651c"
checksum = "46f93780a459b7d656ef7f071fe699c4d3d2cb201c4b24d085b6ddc505276e73"
dependencies = [
"nix",
"windows-sys 0.59.0",
@@ -1135,7 +1142,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b929b3db7be7d7b4d4df67fb016fc446b8f57507b48a82e69d2a30610e460f28"
dependencies = [
"byteorder",
"byteview",
"byteview 0.6.1",
"dashmap",
"log",
"lsm-tree",
@@ -1238,9 +1245,9 @@ dependencies = [
[[package]]
name = "getrandom"
version = "0.3.2"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0"
checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
dependencies = [
"cfg-if",
"js-sys",
@@ -1546,7 +1553,7 @@ version = "0.1.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a"
dependencies = [
"getrandom 0.3.2",
"getrandom 0.3.3",
"libc",
]
@@ -1720,9 +1727,9 @@ dependencies = [
[[package]]
name = "nix"
version = "0.29.0"
version = "0.30.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6"
dependencies = [
"bitflags",
"cfg-if",
@@ -1799,9 +1806,9 @@ checksum = "1036865bb9422d3300cf723f657c2851d0e9ab12567854b1f4eba3d77decf564"
[[package]]
name = "oxc"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f907527226ea09664a17963b36d3057ddcab280c1dcc19b3a287f40de30c3965"
checksum = "6adee1268a2077efca9b1c1f36fdc9d9be2986b70c26bfc648d686002dfc50dd"
dependencies = [
"oxc_allocator",
"oxc_ast",
@@ -1842,9 +1849,9 @@ dependencies = [
[[package]]
name = "oxc_allocator"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3da7bc2d06c0fd029c7817889b1e4d418f4955c25c003d5a9ea4a525db8fce9"
checksum = "d64a116c5711ab4de5f6780627c9a88a61effc7e918db50a5943472ab5697164"
dependencies = [
"allocator-api2",
"bumpalo",
@@ -1856,9 +1863,9 @@ dependencies = [
[[package]]
name = "oxc_ast"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a83d102ba84b604cf24be6b943c3347f13740afa97304461d798f2598d4a92e"
checksum = "76a801811f4a51678fcb766049a54cf452033240fc7fbe036d356854c7350c9e"
dependencies = [
"bitflags",
"cow-utils",
@@ -1873,9 +1880,9 @@ dependencies = [
[[package]]
name = "oxc_ast_macros"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e03da9a237d05fa378e3398a5a2c28124a387ff666218c1ca4ebfe5f0544d3d"
checksum = "41ce0ae699f31d2b03e251cc54a0226b1e6022bfa2012dc6074d858f23da154c"
dependencies = [
"proc-macro2",
"quote",
@@ -1884,9 +1891,9 @@ dependencies = [
[[package]]
name = "oxc_ast_visit"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f97a1716d68a3c9a0c9cf1d906eaeaa3a806052f91d8e4ef14e6afc50d515132"
checksum = "9e96d753425812fb3ff3dee311f8b78a333e60fe235f74b99281f3c8bfbb7cd2"
dependencies = [
"oxc_allocator",
"oxc_ast",
@@ -1896,9 +1903,9 @@ dependencies = [
[[package]]
name = "oxc_cfg"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de348366d30393be8eab6591bfa03c63c18e0b239cccf666554769547d94cd39"
checksum = "74e353d71cadac4a92445380e76d511ce95622795e5bf64e0e644b0d71f56621"
dependencies = [
"bitflags",
"itertools",
@@ -1911,9 +1918,9 @@ dependencies = [
[[package]]
name = "oxc_codegen"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "740de9affaf00644d8122c3e74009c01888747d7233487c387415b298c5f9fd4"
checksum = "f9b63fa7d6b53b7eb5eabb5d6c62146b2e661199e12ddf9b9849c915d502fec1"
dependencies = [
"bitflags",
"cow-utils",
@@ -1932,15 +1939,15 @@ dependencies = [
[[package]]
name = "oxc_data_structures"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9603941570dc1dbc111e6312d622d60722395b502aa68e703646beacc45d0d2"
checksum = "48a633d6f98c3e66c4f46a28f2d6d90b826f66464c7ae74c3ad1c084cb5db4af"
[[package]]
name = "oxc_diagnostics"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a01184ff8ddf40a39c5ec4b0979b53e6e3f8e5701e4a0aed8edefd208ae310eb"
checksum = "458d78cc5805fb9496d94b4906afc63a8e4d03cfd293cca8d77c048a1821141f"
dependencies = [
"cow-utils",
"oxc-miette",
@@ -1948,9 +1955,9 @@ dependencies = [
[[package]]
name = "oxc_ecmascript"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d549b884069d155eae98207c404b71113dc8fce2bea84dc53e8476a221405a83"
checksum = "4c1190881a073f992e1b420c7fc9bf7fcdc73b7377a5bc188844873d44ec87e7"
dependencies = [
"cow-utils",
"num-bigint",
@@ -1962,9 +1969,9 @@ dependencies = [
[[package]]
name = "oxc_estree"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66904246cb3ceef3c7f9dd4b3a79bb104b242d8e442eb94f6097cec241a0eec4"
checksum = "78d6c5726456864b42e2ba570e1aceb4fccaef6c98edd2ed2b44ce9f27432373"
[[package]]
name = "oxc_index"
@@ -1974,9 +1981,9 @@ checksum = "2fa07b0cfa997730afed43705766ef27792873fdf5215b1391949fec678d2392"
[[package]]
name = "oxc_mangler"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d862ba81d295897e817489c0850b04c41facb927bf760d808778da40cc7ad580"
checksum = "8351243ef6acfe269da935764959443929541b4a681c5061a21ac807715ddd8e"
dependencies = [
"fixedbitset",
"itertools",
@@ -1991,9 +1998,9 @@ dependencies = [
[[package]]
name = "oxc_minifier"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "465c3ce7241550963b95a7127879e83a5f64094bdf217eb393e209b9eb9bed9c"
checksum = "a11de372cdb1eed5c47ea485511b11d3e492ee321d10eb9c31d14e7398443233"
dependencies = [
"cow-utils",
"oxc_allocator",
@@ -2013,9 +2020,9 @@ dependencies = [
[[package]]
name = "oxc_parser"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a662d53b21550ca1a5600f70d033fcec40b2a25ba2b5281ecaf2ecd01cb16559"
checksum = "ec5d7bd6ced861f21f476ef3edca2b2c9b0775696dee4f370614aa06c4d4b767"
dependencies = [
"bitflags",
"cow-utils",
@@ -2036,14 +2043,13 @@ dependencies = [
[[package]]
name = "oxc_regular_expression"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c53f760363c78764bb28b8e0f8316d9c28adf89a0ddfba625c8a9f465f4e2199"
checksum = "d9a1d0d251aa32bbc1228cf2e67b016ed9cdb97f2144c2b1027f3dd0fa9d662a"
dependencies = [
"oxc_allocator",
"oxc_ast_macros",
"oxc_diagnostics",
"oxc_estree",
"oxc_span",
"phf",
"rustc-hash",
@@ -2052,9 +2058,9 @@ dependencies = [
[[package]]
name = "oxc_semantic"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "942de11616459d462489166eddf7870cfb8589ba3f12b91f61d28e80b77f7fd0"
checksum = "c3c1e25e8ce948cdfb8aef182e487074b931e449e7251d2df8442dde559644b8"
dependencies = [
"itertools",
"oxc_allocator",
@@ -2074,9 +2080,9 @@ dependencies = [
[[package]]
name = "oxc_sourcemap"
version = "3.0.0"
version = "3.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6665c417b2aa1c426a7b142bcc0d2f47d9fee9e6f88610f054cfa7ce6623001e"
checksum = "9cd7bb37974a2684a080d05b9c28460e1610c5ac5ef13f481a45179f458239cb"
dependencies = [
"base64-simd",
"cfg-if",
@@ -2088,9 +2094,9 @@ dependencies = [
[[package]]
name = "oxc_span"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f8e3cd484054ea0ce496e16437d802d4d9126e238deb267796db140a80d91dc"
checksum = "e04ea95e074243c7ee2f48bb8e7164c6b4f53afb6d1b61dd5d1c521c3c173f3e"
dependencies = [
"compact_str",
"oxc-miette",
@@ -2101,9 +2107,9 @@ dependencies = [
[[package]]
name = "oxc_syntax"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8933bda357ccc13260bb2fe3a08f02d98ceeb695c9af04d8ec5913edd9bec6d6"
checksum = "71f3943f294bacbd1395143ee7d47f19080e35028bd3eaca829f154bd99e3a51"
dependencies = [
"bitflags",
"cow-utils",
@@ -2122,9 +2128,9 @@ dependencies = [
[[package]]
name = "oxc_traverse"
version = "0.68.1"
version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e318be8193f3c72ab703afbb8941b31ed475168514067337325fa151416301a"
checksum = "afda4da5f89f3b40efe6a6501b3e52cc268508aafc01a0b4c8725c64f58dc492"
dependencies = [
"itoa",
"oxc_allocator",
@@ -2305,7 +2311,7 @@ version = "0.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
dependencies = [
"zerocopy 0.8.25",
"zerocopy",
]
[[package]]
@@ -2341,9 +2347,9 @@ dependencies = [
[[package]]
name = "quick_cache"
version = "0.6.13"
version = "0.6.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "287e56aac5a2b4fb25a6fb050961d157635924c8696305a5c937a76f29841a0f"
checksum = "6b450dad8382b1b95061d5ca1eb792081fb082adf48c678791fe917509596d5f"
dependencies = [
"equivalent",
"hashbrown 0.15.3",
@@ -2850,12 +2856,12 @@ dependencies = [
[[package]]
name = "tempfile"
version = "3.19.1"
version = "3.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf"
checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1"
dependencies = [
"fastrand",
"getrandom 0.3.2",
"getrandom 0.3.3",
"once_cell",
"rustix",
"windows-sys 0.59.0",
@@ -3043,9 +3049,9 @@ dependencies = [
[[package]]
name = "tower-http"
version = "0.6.3"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1cfca9ae570b2a6efc764a88e914c29b3dfaa1fafe5f495812ae97ec9bc4d53"
checksum = "0fdb0c213ca27a9f57ab69ddb290fd80d970922355b83ae380b395d3986b8a2e"
dependencies = [
"async-compression",
"bitflags",
@@ -3182,7 +3188,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62fc7c4ce161f049607ecea654dca3f2d727da5371ae85e2e4f14ce2b98ed67c"
dependencies = [
"byteorder",
"byteview",
"byteview 0.6.1",
"interval-heap",
"log",
"path-absolutize",
@@ -3463,33 +3469,13 @@ dependencies = [
"lzma-sys",
]
[[package]]
name = "zerocopy"
version = "0.7.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
dependencies = [
"zerocopy-derive 0.7.35",
]
[[package]]
name = "zerocopy"
version = "0.8.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb"
dependencies = [
"zerocopy-derive 0.8.25",
]
[[package]]
name = "zerocopy-derive"
version = "0.7.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"zerocopy-derive",
]
[[package]]
@@ -3537,7 +3523,7 @@ dependencies = [
"crossbeam-utils",
"deflate64",
"flate2",
"getrandom 0.3.2",
"getrandom 0.3.3",
"hmac",
"indexmap 2.9.0",
"lzma-rs",
+3 -3
View File
@@ -4,7 +4,7 @@ members = ["crates/*"]
package.description = "The Bitcoin Research Kit is a suite of tools designed to extract, compute and display data stored on a Bitcoin Core node"
package.license = "MIT"
package.edition = "2024"
package.version = "0.0.34"
package.version = "0.0.36"
package.repository = "https://github.com/bitcoinresearchkit/brk"
[profile.release]
@@ -30,8 +30,8 @@ brk_parser = { version = "0", path = "crates/brk_parser" }
brk_query = { version = "0", path = "crates/brk_query" }
brk_server = { version = "0", path = "crates/brk_server" }
brk_vec = { version = "0", path = "crates/brk_vec" }
byteview = "0.6.1"
clap = { version = "4.5.37", features = ["string"] }
byteview = "0.7.0"
clap = { version = "4.5.38", features = ["string"] }
clap_derive = "4.5.32"
color-eyre = "0.6.4"
derive_deref = "1.1.1"
+67 -59
View File
@@ -1,7 +1,7 @@
use std::{
fs,
path::{Path, PathBuf},
thread::sleep,
thread::{self, sleep},
time::Duration,
};
@@ -33,77 +33,85 @@ pub fn run(config: RunConfig) -> color_eyre::Result<()> {
indexer.import_stores()?;
indexer.import_vecs()?;
let mut computer = Computer::new(&config.outputsdir(), config.fetcher(), compressed);
computer.import_stores(&indexer)?;
computer.import_vecs(&indexer, config.computation())?;
let wait_for_synced_node = || -> color_eyre::Result<()> {
let is_synced = || -> color_eyre::Result<bool> {
let info = rpc.get_blockchain_info()?;
Ok(info.headers == info.blocks)
};
tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()?
.block_on(async {
let server = if config.serve() {
let served_indexer = indexer.clone();
let served_computer = computer.clone();
if !is_synced()? {
info!("Waiting for node to be synced...");
while !is_synced()? {
sleep(Duration::from_secs(1))
}
}
let server = Server::new(served_indexer, served_computer, config.website())?;
Ok(())
};
let opt = Some(tokio::spawn(async move {
server.serve().await.unwrap();
}));
let f = move || -> color_eyre::Result<()> {
let mut computer = Computer::new(&config.outputsdir(), config.fetcher(), compressed);
computer.import_stores(&indexer)?;
computer.import_vecs(&indexer, config.computation())?;
sleep(Duration::from_secs(1));
tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()?
.block_on(async {
let server = if config.serve() {
let served_indexer = indexer.clone();
let served_computer = computer.clone();
opt
} else {
None
};
let server = Server::new(served_indexer, served_computer, config.website())?;
if config.process() {
let wait_for_synced_node = || -> color_eyre::Result<()> {
let is_synced = || -> color_eyre::Result<bool> {
let info = rpc.get_blockchain_info()?;
Ok(info.headers == info.blocks)
};
let opt = Some(tokio::spawn(async move {
server.serve().await.unwrap();
}));
if !is_synced()? {
info!("Waiting for node to be synced...");
while !is_synced()? {
sleep(Duration::from_secs(1));
opt
} else {
None
};
if config.process() {
loop {
wait_for_synced_node()?;
let block_count = rpc.get_block_count()?;
info!("{} blocks found.", block_count + 1);
let starting_indexes = indexer.index(&parser, rpc, &exit)?;
computer.compute(&mut indexer, starting_indexes, &exit)?;
if let Some(delay) = config.delay() {
sleep(Duration::from_secs(delay))
}
info!("Waiting for new blocks...");
while block_count == rpc.get_block_count()? {
sleep(Duration::from_secs(1))
}
}
Ok(())
};
loop {
wait_for_synced_node()?;
let block_count = rpc.get_block_count()?;
info!("{} blocks found.", block_count + 1);
let starting_indexes = indexer.index(&parser, rpc, &exit)?;
computer.compute(&mut indexer, starting_indexes, &exit)?;
if let Some(delay) = config.delay() {
sleep(Duration::from_secs(delay))
}
info!("Waiting for new blocks...");
while block_count == rpc.get_block_count()? {
sleep(Duration::from_secs(1))
}
}
}
if let Some(handle) = server {
handle.await.unwrap();
}
if let Some(handle) = server {
handle.await.unwrap();
}
Ok(())
})
Ok(())
})
};
thread::Builder::new()
.stack_size(128 * 1024 * 1024)
.spawn(f)?
.join()
.unwrap()
}
#[derive(Parser, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)]
+1
View File
@@ -19,5 +19,6 @@ clap_derive = { workspace = true }
color-eyre = { workspace = true }
fjall = { workspace = true }
log = { workspace = true }
rayon = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
+24 -15
View File
@@ -1,7 +1,7 @@
use std::path::Path;
use std::{path::Path, thread};
use brk_computer::Computer;
use brk_core::default_bitcoin_path;
use brk_core::{default_bitcoin_path, default_brk_path};
use brk_exit::Exit;
use brk_fetcher::Fetcher;
use brk_indexer::Indexer;
@@ -21,25 +21,34 @@ pub fn main() -> color_eyre::Result<()> {
)?));
let exit = Exit::new();
let parser = Parser::new(bitcoin_dir.join("blocks"), rpc);
// Can't increase main thread's stack programatically, thus we need to use another thread
thread::Builder::new()
.stack_size(32 * 1024 * 1024)
.spawn(move || -> color_eyre::Result<()> {
let parser = Parser::new(bitcoin_dir.join("blocks"), rpc);
let outputs_dir = Path::new("../../_outputs");
let _outputs_dir = default_brk_path().join("outputs");
let outputs_dir = _outputs_dir.as_path();
// let outputs_dir = Path::new("../../_outputs");
let compressed = false;
let compressed = false;
let mut indexer = Indexer::new(outputs_dir, compressed, true)?;
indexer.import_stores()?;
indexer.import_vecs()?;
let mut indexer = Indexer::new(outputs_dir, compressed, true)?;
indexer.import_stores()?;
indexer.import_vecs()?;
let fetcher = Fetcher::import(None)?;
let fetcher = Fetcher::import(None)?;
let mut computer = Computer::new(outputs_dir, Some(fetcher), compressed);
computer.import_stores(&indexer)?;
computer.import_vecs(&indexer, Computation::Lazy)?;
let mut computer = Computer::new(outputs_dir, Some(fetcher), compressed);
computer.import_stores(&indexer)?;
computer.import_vecs(&indexer, Computation::Lazy)?;
let starting_indexes = indexer.index(&parser, rpc, &exit)?;
let starting_indexes = indexer.index(&parser, rpc, &exit)?;
computer.compute(&mut indexer, starting_indexes, &exit)?;
computer.compute(&mut indexer, starting_indexes, &exit)?;
Ok(())
Ok(())
})?
.join()
.unwrap()
}
+9 -6
View File
@@ -7,14 +7,17 @@ use std::path::{Path, PathBuf};
use brk_exit::Exit;
use brk_fetcher::Fetcher;
use brk_indexer::{Indexer, Indexes};
use brk_indexer::Indexer;
pub use brk_parser::rpc;
mod storage;
use brk_vec::{AnyCollectableVec, Compressed, Computation};
mod stores;
mod utils;
mod vecs;
use log::info;
use storage::{Stores, Vecs};
use stores::Stores;
use vecs::Vecs;
#[derive(Clone)]
pub struct Computer {
@@ -66,7 +69,7 @@ impl Computer {
pub fn compute(
&mut self,
indexer: &mut Indexer,
starting_indexes: Indexes,
starting_indexes: brk_indexer::Indexes,
exit: &Exit,
) -> color_eyre::Result<()> {
info!("Computing...");
-5
View File
@@ -1,5 +0,0 @@
mod stores;
mod vecs;
pub use stores::*;
pub use vecs::*;
@@ -1,253 +0,0 @@
use std::{fs, path::Path};
use brk_core::{Dollars, StoredF64, StoredUsize};
use brk_exit::Exit;
use brk_indexer::Indexer;
use brk_vec::{AnyCollectableVec, Compressed, Computation, StoredIndex, VecIterator, Version};
use super::{
Indexes, fetched,
grouped::{ComputedVecsFromDateindex, StorableVecGeneatorOptions},
indexes, transactions,
};
#[derive(Clone)]
pub struct Vecs {
pub indexes_to_marketcap: ComputedVecsFromDateindex<Dollars>,
pub indexes_to_ath: ComputedVecsFromDateindex<Dollars>,
pub indexes_to_drawdown: ComputedVecsFromDateindex<StoredF64>,
pub indexes_to_days_since_ath: ComputedVecsFromDateindex<StoredUsize>,
pub indexes_to_max_days_between_ath: ComputedVecsFromDateindex<StoredUsize>,
pub indexes_to_max_years_between_ath: ComputedVecsFromDateindex<StoredF64>,
}
impl Vecs {
pub fn forced_import(
path: &Path,
_computation: Computation,
compressed: Compressed,
) -> color_eyre::Result<Self> {
fs::create_dir_all(path)?;
Ok(Self {
indexes_to_marketcap: ComputedVecsFromDateindex::forced_import(
path,
"marketcap",
Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_last(),
)?,
indexes_to_ath: ComputedVecsFromDateindex::forced_import(
path,
"ath",
Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_last(),
)?,
indexes_to_drawdown: ComputedVecsFromDateindex::forced_import(
path,
"drawdown",
Version::ONE,
compressed,
StorableVecGeneatorOptions::default().add_last(),
)?,
indexes_to_days_since_ath: ComputedVecsFromDateindex::forced_import(
path,
"days_since_ath",
Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_last(),
)?,
indexes_to_max_days_between_ath: ComputedVecsFromDateindex::forced_import(
path,
"max_days_between_ath",
Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_last(),
)?,
indexes_to_max_years_between_ath: ComputedVecsFromDateindex::forced_import(
path,
"max_years_between_ath",
Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_last(),
)?,
})
}
pub fn compute(
&mut self,
indexer: &Indexer,
indexes: &indexes::Vecs,
fetched: &fetched::Vecs,
transactions: &mut transactions::Vecs,
starting_indexes: &Indexes,
exit: &Exit,
) -> color_eyre::Result<()> {
self.indexes_to_marketcap.compute(
indexer,
indexes,
starting_indexes,
exit,
|v, _, _, starting_indexes, exit| {
let mut total_subsidy_in_btc = transactions
.indexes_to_subsidy
.bitcoin
.dateindex
.unwrap_total()
.into_iter();
v.compute_transform(
starting_indexes.dateindex,
&fetched.timeindexes_to_close.dateindex,
|(i, close, ..)| {
let supply = total_subsidy_in_btc.unwrap_get_inner(i);
(i, *close * supply)
},
exit,
)
},
)?;
self.indexes_to_ath.compute(
indexer,
indexes,
starting_indexes,
exit,
|v, _, _, starting_indexes, exit| {
let mut prev = None;
v.compute_transform(
starting_indexes.dateindex,
&fetched.timeindexes_to_high.dateindex,
|(i, high, slf)| {
if prev.is_none() {
let i = i.unwrap_to_usize();
prev.replace(if i > 0 {
slf.into_iter().unwrap_get_inner_(i - 1)
} else {
Dollars::ZERO
});
}
let ath = prev.unwrap().max(*high);
prev.replace(ath);
(i, ath)
},
exit,
)
},
)?;
self.indexes_to_drawdown.compute(
indexer,
indexes,
starting_indexes,
exit,
|v, _, _, starting_indexes, exit| {
let mut close_iter = fetched.timeindexes_to_close.dateindex.into_iter();
v.compute_transform(
starting_indexes.dateindex,
&self.indexes_to_ath.dateindex,
|(i, ath, ..)| {
if ath == Dollars::ZERO {
return (i, StoredF64::default());
}
let close = *close_iter.unwrap_get_inner(i);
let drawdown = StoredF64::from((*ath - *close) / *ath * -100.0);
(i, drawdown)
},
exit,
)
},
)?;
self.indexes_to_days_since_ath.compute(
indexer,
indexes,
starting_indexes,
exit,
|v, _, _, starting_indexes, exit| {
let mut high_iter = fetched.timeindexes_to_high.dateindex.into_iter();
let mut prev = None;
v.compute_transform(
starting_indexes.dateindex,
&self.indexes_to_ath.dateindex,
|(i, ath, slf)| {
if prev.is_none() {
let i = i.unwrap_to_usize();
prev.replace(if i > 0 {
slf.into_iter().unwrap_get_inner_(i - 1)
} else {
StoredUsize::default()
});
}
let days = if *high_iter.unwrap_get_inner(i) == ath {
StoredUsize::default()
} else {
prev.unwrap() + StoredUsize::from(1)
};
prev.replace(days);
(i, days)
},
exit,
)
},
)?;
self.indexes_to_max_days_between_ath.compute(
indexer,
indexes,
starting_indexes,
exit,
|v, _, _, starting_indexes, exit| {
let mut prev = None;
v.compute_transform(
starting_indexes.dateindex,
&self.indexes_to_days_since_ath.dateindex,
|(i, days, slf)| {
if prev.is_none() {
let i = i.unwrap_to_usize();
prev.replace(if i > 0 {
slf.into_iter().unwrap_get_inner_(i - 1)
} else {
StoredUsize::ZERO
});
}
let max = prev.unwrap().max(days);
prev.replace(max);
(i, max)
},
exit,
)
},
)?;
self.indexes_to_max_years_between_ath.compute(
indexer,
indexes,
starting_indexes,
exit,
|v, _, _, starting_indexes, exit| {
v.compute_transform(
starting_indexes.dateindex,
&self.indexes_to_max_days_between_ath.dateindex,
|(i, max, ..)| (i, StoredF64::from(*max as f64 / 365.0)),
exit,
)
},
)?;
Ok(())
}
pub fn vecs(&self) -> Vec<&dyn AnyCollectableVec> {
[
self.indexes_to_marketcap.vecs(),
self.indexes_to_ath.vecs(),
self.indexes_to_drawdown.vecs(),
self.indexes_to_days_since_ath.vecs(),
self.indexes_to_max_days_between_ath.vecs(),
self.indexes_to_max_years_between_ath.vecs(),
]
.concat()
}
}
+27
View File
@@ -0,0 +1,27 @@
use std::ops::{Add, Div};
pub fn get_percentile<T>(sorted: &[T], percentile: f64) -> T
where
T: Clone + Div<usize, Output = T> + Add<T, Output = T>,
{
let len = sorted.len();
if len == 0 {
panic!();
} else if len == 1 {
sorted[0].clone()
} else {
let index = (len - 1) as f64 * percentile;
let fract = index.fract();
if fract != 0.0 {
let left = sorted.get(index as usize).unwrap().clone();
let right = sorted.get(index.ceil() as usize).unwrap().clone();
left / 2 + right / 2
} else {
// dbg!(sorted.len(), index);
sorted.get(index as usize).unwrap().clone()
}
}
}
@@ -11,7 +11,7 @@ use brk_vec::{AnyCollectableVec, AnyIterableVec, Compressed, Computation, EagerV
use super::{
Indexes,
grouped::{ComputedVecsFromDateindex, ComputedVecsFromHeight, StorableVecGeneatorOptions},
grouped::{ComputedVecsFromDateIndex, ComputedVecsFromHeight, StorableVecGeneatorOptions},
indexes,
};
@@ -21,7 +21,7 @@ pub struct Vecs {
pub height_to_vbytes: EagerVec<Height, StoredU64>,
pub difficultyepoch_to_timestamp: EagerVec<DifficultyEpoch, Timestamp>,
pub halvingepoch_to_timestamp: EagerVec<HalvingEpoch, Timestamp>,
pub timeindexes_to_timestamp: ComputedVecsFromDateindex<Timestamp>,
pub timeindexes_to_timestamp: ComputedVecsFromDateIndex<Timestamp>,
pub indexes_to_block_count: ComputedVecsFromHeight<StoredU32>,
pub indexes_to_block_interval: ComputedVecsFromHeight<Timestamp>,
pub indexes_to_block_size: ComputedVecsFromHeight<StoredUsize>,
@@ -43,7 +43,7 @@ impl Vecs {
Version::ZERO,
compressed,
)?,
timeindexes_to_timestamp: ComputedVecsFromDateindex::forced_import(
timeindexes_to_timestamp: ComputedVecsFromDateIndex::forced_import(
path,
"timestamp",
Version::ZERO,
+149
View File
@@ -0,0 +1,149 @@
use std::{fs, path::Path};
use brk_core::StoredU8;
use brk_exit::Exit;
use brk_indexer::Indexer;
use brk_vec::{AnyCollectableVec, AnyVec, Compressed, Computation, Version};
use super::{
Indexes,
grouped::{ComputedVecsFromHeight, StorableVecGeneatorOptions},
indexes,
};
#[derive(Clone)]
pub struct Vecs {
pub _0: ComputedVecsFromHeight<StoredU8>,
pub _1: ComputedVecsFromHeight<StoredU8>,
pub _50: ComputedVecsFromHeight<StoredU8>,
pub _100: ComputedVecsFromHeight<StoredU8>,
}
impl Vecs {
pub fn forced_import(
path: &Path,
_computation: Computation,
compressed: Compressed,
) -> color_eyre::Result<Self> {
fs::create_dir_all(path)?;
Ok(Self {
_0: ComputedVecsFromHeight::forced_import(
path,
"0",
true,
Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_last(),
)?,
_1: ComputedVecsFromHeight::forced_import(
path,
"1",
true,
Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_last(),
)?,
_50: ComputedVecsFromHeight::forced_import(
path,
"50",
true,
Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_last(),
)?,
_100: ComputedVecsFromHeight::forced_import(
path,
"100",
true,
Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_last(),
)?,
})
}
pub fn compute(
&mut self,
indexer: &Indexer,
indexes: &indexes::Vecs,
starting_indexes: &Indexes,
exit: &Exit,
) -> color_eyre::Result<()> {
self._0.compute_all(
indexer,
indexes,
starting_indexes,
exit,
|vec, _, indexes, starting_indexes, exit| {
vec.compute_to(
starting_indexes.height,
indexes.height_to_date.len(),
indexes.height_to_date.version(),
|i| (i, StoredU8::new(0)),
exit,
)
},
)?;
self._1.compute_all(
indexer,
indexes,
starting_indexes,
exit,
|vec, _, indexes, starting_indexes, exit| {
vec.compute_to(
starting_indexes.height,
indexes.height_to_date.len(),
indexes.height_to_date.version(),
|i| (i, StoredU8::new(1)),
exit,
)
},
)?;
self._50.compute_all(
indexer,
indexes,
starting_indexes,
exit,
|vec, _, indexes, starting_indexes, exit| {
vec.compute_to(
starting_indexes.height,
indexes.height_to_date.len(),
indexes.height_to_date.version(),
|i| (i, StoredU8::new(50)),
exit,
)
},
)?;
self._100.compute_all(
indexer,
indexes,
starting_indexes,
exit,
|vec, _, indexes, starting_indexes, exit| {
vec.compute_to(
starting_indexes.height,
indexes.height_to_date.len(),
indexes.height_to_date.version(),
|i| (i, StoredU8::new(100)),
exit,
)
},
)?;
Ok(())
}
pub fn vecs(&self) -> Vec<&dyn AnyCollectableVec> {
[
self._0.vecs(),
self._1.vecs(),
self._50.vecs(),
self._100.vecs(),
]
.concat()
}
}
@@ -12,7 +12,7 @@ use brk_vec::{AnyCollectableVec, AnyIterableVec, Compressed, Computation, EagerV
use super::{
Indexes,
grouped::{
ComputedVecsFromDateindex, ComputedVecsFromHeightStrict, StorableVecGeneatorOptions,
ComputedVecsFromDateIndex, ComputedVecsFromHeightStrict, StorableVecGeneatorOptions,
},
indexes,
};
@@ -33,14 +33,14 @@ pub struct Vecs {
pub height_to_ohlc_in_sats: EagerVec<Height, OHLCSats>,
pub height_to_ohlc_in_cents: EagerVec<Height, OHLCCents>,
pub height_to_open_in_cents: EagerVec<Height, Open<Cents>>,
pub timeindexes_to_close: ComputedVecsFromDateindex<Close<Dollars>>,
pub timeindexes_to_high: ComputedVecsFromDateindex<High<Dollars>>,
pub timeindexes_to_low: ComputedVecsFromDateindex<Low<Dollars>>,
pub timeindexes_to_open: ComputedVecsFromDateindex<Open<Dollars>>,
pub timeindexes_to_open_in_sats: ComputedVecsFromDateindex<Open<Sats>>,
pub timeindexes_to_high_in_sats: ComputedVecsFromDateindex<High<Sats>>,
pub timeindexes_to_low_in_sats: ComputedVecsFromDateindex<Low<Sats>>,
pub timeindexes_to_close_in_sats: ComputedVecsFromDateindex<Close<Sats>>,
pub timeindexes_to_close: ComputedVecsFromDateIndex<Close<Dollars>>,
pub timeindexes_to_high: ComputedVecsFromDateIndex<High<Dollars>>,
pub timeindexes_to_low: ComputedVecsFromDateIndex<Low<Dollars>>,
pub timeindexes_to_open: ComputedVecsFromDateIndex<Open<Dollars>>,
pub timeindexes_to_open_in_sats: ComputedVecsFromDateIndex<Open<Sats>>,
pub timeindexes_to_high_in_sats: ComputedVecsFromDateIndex<High<Sats>>,
pub timeindexes_to_low_in_sats: ComputedVecsFromDateIndex<Low<Sats>>,
pub timeindexes_to_close_in_sats: ComputedVecsFromDateIndex<Close<Sats>>,
pub chainindexes_to_close: ComputedVecsFromHeightStrict<Close<Dollars>>,
pub chainindexes_to_high: ComputedVecsFromHeightStrict<High<Dollars>>,
pub chainindexes_to_low: ComputedVecsFromHeightStrict<Low<Dollars>>,
@@ -151,56 +151,56 @@ impl Vecs {
Version::ZERO,
compressed,
)?,
timeindexes_to_open: ComputedVecsFromDateindex::forced_import(
timeindexes_to_open: ComputedVecsFromDateIndex::forced_import(
path,
"open",
Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_first(),
)?,
timeindexes_to_high: ComputedVecsFromDateindex::forced_import(
timeindexes_to_high: ComputedVecsFromDateIndex::forced_import(
path,
"high",
Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_max(),
)?,
timeindexes_to_low: ComputedVecsFromDateindex::forced_import(
timeindexes_to_low: ComputedVecsFromDateIndex::forced_import(
path,
"low",
Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_min(),
)?,
timeindexes_to_close: ComputedVecsFromDateindex::forced_import(
timeindexes_to_close: ComputedVecsFromDateIndex::forced_import(
path,
"close",
Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_last(),
)?,
timeindexes_to_open_in_sats: ComputedVecsFromDateindex::forced_import(
timeindexes_to_open_in_sats: ComputedVecsFromDateIndex::forced_import(
path,
"open_in_sats",
VERSION + VERSION_IN_SATS + Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_first(),
)?,
timeindexes_to_high_in_sats: ComputedVecsFromDateindex::forced_import(
timeindexes_to_high_in_sats: ComputedVecsFromDateIndex::forced_import(
path,
"high_in_sats",
VERSION + VERSION_IN_SATS + Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_max(),
)?,
timeindexes_to_low_in_sats: ComputedVecsFromDateindex::forced_import(
timeindexes_to_low_in_sats: ComputedVecsFromDateIndex::forced_import(
path,
"low_in_sats",
VERSION + VERSION_IN_SATS + Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_min(),
)?,
timeindexes_to_close_in_sats: ComputedVecsFromDateindex::forced_import(
timeindexes_to_close_in_sats: ComputedVecsFromDateIndex::forced_import(
path,
"close_in_sats",
VERSION + VERSION_IN_SATS + Version::ZERO,
@@ -8,6 +8,8 @@ use brk_vec::{
};
use color_eyre::eyre::ContextCompat;
use crate::utils::get_percentile;
use super::ComputedType;
#[derive(Clone, Debug)]
@@ -176,12 +178,12 @@ where
where
I2: StoredIndex + StoredType + CheckedSub<I2>,
{
let index = self.starting_index(max_from);
self.validate_computed_version_or_reset_file(
source.version() + first_indexes.version() + count_indexes.version(),
)?;
let index = self.starting_index(max_from);
let mut count_indexes_iter = count_indexes.iter();
let mut source_iter = source.iter();
@@ -269,23 +271,23 @@ where
}
if let Some(_90p) = self._90p.as_mut() {
_90p.forced_push_at(i, Self::get_percentile(&values, 0.90), exit)?;
_90p.forced_push_at(i, get_percentile(&values, 0.90), exit)?;
}
if let Some(_75p) = self._75p.as_mut() {
_75p.forced_push_at(i, Self::get_percentile(&values, 0.75), exit)?;
_75p.forced_push_at(i, get_percentile(&values, 0.75), exit)?;
}
if let Some(median) = self.median.as_mut() {
median.forced_push_at(i, Self::get_percentile(&values, 0.50), exit)?;
median.forced_push_at(i, get_percentile(&values, 0.50), exit)?;
}
if let Some(_25p) = self._25p.as_mut() {
_25p.forced_push_at(i, Self::get_percentile(&values, 0.25), exit)?;
_25p.forced_push_at(i, get_percentile(&values, 0.25), exit)?;
}
if let Some(_10p) = self._10p.as_mut() {
_10p.forced_push_at(i, Self::get_percentile(&values, 0.10), exit)?;
_10p.forced_push_at(i, get_percentile(&values, 0.10), exit)?;
}
if let Some(min) = self.min.as_mut() {
@@ -472,28 +474,6 @@ where
Ok(())
}
fn get_percentile(sorted: &[T], percentile: f64) -> T {
let len = sorted.len();
if len == 0 {
panic!();
} else if len == 1 {
sorted[0].clone()
} else {
let index = (len - 1) as f64 * percentile;
let fract = index.fract();
if fract != 0.0 {
let left = sorted.get(index as usize).unwrap().clone();
let right = sorted.get(index.ceil() as usize).unwrap().clone();
left / 2 + right / 2
} else {
sorted.get(index as usize).unwrap().clone()
}
}
}
fn starting_index(&self, max_from: I) -> I {
max_from.min(I::from(
self.vecs().into_iter().map(|v| v.len()).min().unwrap(),
@@ -5,12 +5,12 @@ use brk_exit::Exit;
use brk_indexer::Indexer;
use brk_vec::{AnyCollectableVec, Compressed, EagerVec, Result, Version};
use crate::storage::{Indexes, indexes};
use crate::vecs::{Indexes, indexes};
use super::{ComputedType, ComputedVecBuilder, StorableVecGeneatorOptions};
#[derive(Clone)]
pub struct ComputedVecsFromDateindex<T>
pub struct ComputedVecsFromDateIndex<T>
where
T: ComputedType + PartialOrd,
{
@@ -25,7 +25,7 @@ where
const VERSION: Version = Version::ZERO;
impl<T> ComputedVecsFromDateindex<T>
impl<T> ComputedVecsFromDateIndex<T>
where
T: ComputedType,
{
@@ -94,6 +94,15 @@ where
exit,
)?;
self.compute_rest(indexes, starting_indexes, exit)
}
pub fn compute_rest(
&mut self,
indexes: &indexes::Vecs,
starting_indexes: &Indexes,
exit: &Exit,
) -> color_eyre::Result<()> {
self.dateindex_extra
.extend(starting_indexes.dateindex, &self.dateindex, exit)?;
@@ -7,7 +7,7 @@ use brk_exit::Exit;
use brk_indexer::Indexer;
use brk_vec::{AnyCollectableVec, AnyIterableVec, Compressed, EagerVec, Result, Version};
use crate::storage::{Indexes, indexes};
use crate::vecs::{Indexes, indexes};
use super::{ComputedType, ComputedVecBuilder, StorableVecGeneatorOptions};
@@ -5,7 +5,7 @@ use brk_exit::Exit;
use brk_indexer::Indexer;
use brk_vec::{AnyCollectableVec, Compressed, EagerVec, Result, Version};
use crate::storage::{Indexes, indexes};
use crate::vecs::{Indexes, indexes};
use super::{ComputedType, ComputedVecBuilder, StorableVecGeneatorOptions};
@@ -10,7 +10,7 @@ use brk_vec::{
AnyCollectableVec, CollectableVec, Compressed, EagerVec, Result, StoredVec, Version,
};
use crate::storage::{Indexes, indexes};
use crate::vecs::{Indexes, indexes};
use super::{ComputedType, ComputedVecBuilder, StorableVecGeneatorOptions};
@@ -3,6 +3,7 @@ mod from_dateindex;
mod from_height;
mod from_height_strict;
mod from_txindex;
mod ratio_from_dateindex;
mod r#type;
mod value_from_height;
mod value_from_txindex;
@@ -12,6 +13,7 @@ pub use from_dateindex::*;
pub use from_height::*;
pub use from_height_strict::*;
pub use from_txindex::*;
pub use ratio_from_dateindex::*;
use r#type::*;
pub use value_from_height::*;
pub use value_from_txindex::*;
@@ -0,0 +1,872 @@
use std::{f32, path::Path};
use brk_core::{Date, DateIndex, Dollars, StoredF32};
use brk_exit::Exit;
use brk_indexer::Indexer;
use brk_vec::{
AnyCollectableVec, AnyIterableVec, AnyVec, CollectableVec, Compressed, EagerVec, Result,
StoredIndex, VecIterator, Version,
};
// use rayon::prelude::*;
use crate::{
utils::get_percentile,
vecs::{Indexes, fetched, indexes},
};
use super::{ComputedVecsFromDateIndex, StorableVecGeneatorOptions};
#[derive(Clone)]
pub struct ComputedRatioVecsFromDateIndex {
pub price: ComputedVecsFromDateIndex<Dollars>,
pub ratio: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_sma: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_1w_sma: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_1m_sma: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_1y_sma: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_1y_sma_momentum_oscillator: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_standard_deviation: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_p99_9: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_p99_5: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_p99: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_p1: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_p0_5: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_p0_1: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_p1sd: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_p2sd: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_p3sd: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_m1sd: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_m2sd: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_m3sd: ComputedVecsFromDateIndex<StoredF32>,
pub ratio_p99_9_as_price: ComputedVecsFromDateIndex<Dollars>,
pub ratio_p99_5_as_price: ComputedVecsFromDateIndex<Dollars>,
pub ratio_p99_as_price: ComputedVecsFromDateIndex<Dollars>,
pub ratio_p1_as_price: ComputedVecsFromDateIndex<Dollars>,
pub ratio_p0_5_as_price: ComputedVecsFromDateIndex<Dollars>,
pub ratio_p0_1_as_price: ComputedVecsFromDateIndex<Dollars>,
pub ratio_p1sd_as_price: ComputedVecsFromDateIndex<Dollars>,
pub ratio_p2sd_as_price: ComputedVecsFromDateIndex<Dollars>,
pub ratio_p3sd_as_price: ComputedVecsFromDateIndex<Dollars>,
pub ratio_m1sd_as_price: ComputedVecsFromDateIndex<Dollars>,
pub ratio_m2sd_as_price: ComputedVecsFromDateIndex<Dollars>,
pub ratio_m3sd_as_price: ComputedVecsFromDateIndex<Dollars>,
}
const VERSION: Version = Version::ZERO;
impl ComputedRatioVecsFromDateIndex {
pub fn forced_import(
path: &Path,
name: &str,
// _compute_source: bool,
version: Version,
compressed: Compressed,
options: StorableVecGeneatorOptions,
) -> color_eyre::Result<Self> {
Ok(Self {
price: ComputedVecsFromDateIndex::forced_import(
path,
name,
VERSION + version,
compressed,
options,
)?,
ratio: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_sma: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_sma"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_1w_sma: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_1w_sma"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_1m_sma: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_1m_sma"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_1y_sma: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_1y_sma"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_1y_sma_momentum_oscillator: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_1y_sma_momentum_oscillator"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_standard_deviation: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_standard_deviation"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p99_9: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p99_9"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p99_5: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p99_5"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p99: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p99"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p1: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p1"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p0_5: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p0_5"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p0_1: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p0_1"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p1sd: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p1sd"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p2sd: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p2sd"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p3sd: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p3sd"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_m1sd: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_m1sd"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_m2sd: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_m2sd"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_m3sd: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_m3sd"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p99_9_as_price: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p99_9_as_price"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p99_5_as_price: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p99_5_as_price"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p99_as_price: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p99_as_price"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p1_as_price: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p1_as_price"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p0_5_as_price: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p0_5_as_price"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p0_1_as_price: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p0_1_as_price"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p1sd_as_price: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p1sd_as_price"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p2sd_as_price: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p2sd_as_price"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_p3sd_as_price: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_p3sd_as_price"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_m1sd_as_price: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_m1sd_as_price"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_m2sd_as_price: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_m2sd_as_price"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
ratio_m3sd_as_price: ComputedVecsFromDateIndex::forced_import(
path,
&format!("{name}_ratio_m3sd_as_price"),
VERSION + version + Version::TWO,
compressed,
options,
)?,
})
}
pub fn compute<F>(
&mut self,
indexer: &Indexer,
indexes: &indexes::Vecs,
fetched: &fetched::Vecs,
starting_indexes: &Indexes,
exit: &Exit,
compute: F,
) -> color_eyre::Result<()>
where
F: FnMut(
&mut EagerVec<DateIndex, Dollars>,
&Indexer,
&indexes::Vecs,
&Indexes,
&Exit,
) -> Result<()>,
{
self.price
.compute(indexer, indexes, starting_indexes, exit, compute)?;
let closes = &fetched.timeindexes_to_close.dateindex;
self.ratio.compute(
indexer,
indexes,
starting_indexes,
exit,
|v, _, _, starting_indexes, exit| {
let mut price = self.price.dateindex.into_iter();
v.compute_transform(
starting_indexes.dateindex,
closes,
|(i, close, ..)| {
let price = price.unwrap_get_inner(i);
if price == Dollars::ZERO {
(i, StoredF32::from(1.0))
} else {
(i, StoredF32::from(*close / price))
}
},
exit,
)
},
)?;
let min_ratio_date = DateIndex::try_from(Date::MIN_RATIO).unwrap();
self.ratio_sma.compute(
indexer,
indexes,
starting_indexes,
exit,
|v, _, _, starting_indexes, exit| {
v.compute_sma_(
starting_indexes.dateindex,
&self.ratio.dateindex,
usize::MAX,
exit,
Some(min_ratio_date),
)
},
)?;
self.ratio_1w_sma.compute(
indexer,
indexes,
starting_indexes,
exit,
|v, _, _, starting_indexes, exit| {
v.compute_sma_(
starting_indexes.dateindex,
&self.ratio.dateindex,
7,
exit,
Some(min_ratio_date),
)
},
)?;
self.ratio_1m_sma.compute(
indexer,
indexes,
starting_indexes,
exit,
|v, _, _, starting_indexes, exit| {
v.compute_sma_(
starting_indexes.dateindex,
&self.ratio.dateindex,
30,
exit,
Some(min_ratio_date),
)
},
)?;
self.ratio_1y_sma.compute(
indexer,
indexes,
starting_indexes,
exit,
|v, _, _, starting_indexes, exit| {
v.compute_sma_(
starting_indexes.dateindex,
&self.ratio.dateindex,
365,
exit,
Some(min_ratio_date),
)
},
)?;
self.ratio_1y_sma_momentum_oscillator.compute(
indexer,
indexes,
starting_indexes,
exit,
|v, _, _, starting_indexes, exit| {
let mut ratio_1y_sma_iter = self.ratio_1y_sma.dateindex.into_iter();
v.compute_transform(
starting_indexes.dateindex,
&self.ratio.dateindex,
|(i, ratio, ..)| {
(
i,
StoredF32::from(*ratio / *ratio_1y_sma_iter.unwrap_get_inner(i) - 1.0),
)
},
exit,
)
},
)?;
let ratio_version = self.ratio.dateindex.version();
self.mut_ratio_vecs()
.iter_mut()
.try_for_each(|v| -> Result<()> {
v.validate_computed_version_or_reset_file(
Version::ZERO + v.inner_version() + ratio_version,
)
})?;
let starting_dateindex = self
.mut_ratio_vecs()
.iter()
.map(|v| DateIndex::from(v.len()))
.min()
.unwrap()
.min(starting_indexes.dateindex);
let mut sorted = self.ratio.dateindex.collect_range(
Some(min_ratio_date.unwrap_to_usize()),
Some(starting_dateindex.unwrap_to_usize()),
)?;
sorted.sort_unstable();
// if sorted.len() != starting_dateindex.unwrap_to_usize() - min_ratio_date.unwrap_to_usize() {
// unreachable!();
// }
let mut sma_iter = self.ratio_sma.dateindex.into_iter();
let nan = StoredF32::from(f32::NAN);
self.ratio
.dateindex
.iter_at(starting_dateindex)
.try_for_each(|(index, ratio)| -> Result<()> {
if index < min_ratio_date {
self.ratio_p0_1.dateindex.forced_push_at(index, nan, exit)?;
self.ratio_p0_5.dateindex.forced_push_at(index, nan, exit)?;
self.ratio_p1.dateindex.forced_push_at(index, nan, exit)?;
self.ratio_p99.dateindex.forced_push_at(index, nan, exit)?;
self.ratio_p99_5
.dateindex
.forced_push_at(index, nan, exit)?;
self.ratio_p99_9
.dateindex
.forced_push_at(index, nan, exit)?;
self.ratio_standard_deviation
.dateindex
.forced_push_at(index, nan, exit)?;
self.ratio_p1sd.dateindex.forced_push_at(index, nan, exit)?;
self.ratio_p2sd.dateindex.forced_push_at(index, nan, exit)?;
self.ratio_p3sd.dateindex.forced_push_at(index, nan, exit)?;
self.ratio_m1sd.dateindex.forced_push_at(index, nan, exit)?;
self.ratio_m2sd.dateindex.forced_push_at(index, nan, exit)?;
self.ratio_m3sd.dateindex.forced_push_at(index, nan, exit)?;
} else {
let ratio = ratio.into_inner();
let pos = sorted.binary_search(&ratio).unwrap_or_else(|pos| pos);
sorted.insert(pos, ratio);
self.ratio_p0_1.dateindex.forced_push_at(
index,
get_percentile(&sorted, 0.001),
exit,
)?;
self.ratio_p0_5.dateindex.forced_push_at(
index,
get_percentile(&sorted, 0.005),
exit,
)?;
self.ratio_p1.dateindex.forced_push_at(
index,
get_percentile(&sorted, 0.01),
exit,
)?;
self.ratio_p99.dateindex.forced_push_at(
index,
get_percentile(&sorted, 0.99),
exit,
)?;
self.ratio_p99_5.dateindex.forced_push_at(
index,
get_percentile(&sorted, 0.995),
exit,
)?;
self.ratio_p99_9.dateindex.forced_push_at(
index,
get_percentile(&sorted, 0.999),
exit,
)?;
let avg = sma_iter.unwrap_get_inner(index);
let sd = StoredF32::from(
(sorted.iter().map(|v| (**v - *avg).powi(2)).sum::<f32>()
/ (index.unwrap_to_usize() + 1) as f32)
.sqrt(),
);
self.ratio_standard_deviation
.dateindex
.forced_push_at(index, sd, exit)?;
self.ratio_p1sd
.dateindex
.forced_push_at(index, avg + sd, exit)?;
self.ratio_p2sd
.dateindex
.forced_push_at(index, avg + 2 * sd, exit)?;
self.ratio_p3sd
.dateindex
.forced_push_at(index, avg + 3 * sd, exit)?;
self.ratio_m1sd
.dateindex
.forced_push_at(index, avg - sd, exit)?;
self.ratio_m2sd
.dateindex
.forced_push_at(index, avg - 2 * sd, exit)?;
self.ratio_m3sd
.dateindex
.forced_push_at(index, avg - 3 * sd, exit)?;
}
Ok(())
})?;
self.mut_ratio_vecs()
.into_iter()
.try_for_each(|v| v.safe_flush(exit))?;
self.ratio_p99_9
.compute_rest(indexes, starting_indexes, exit)?;
self.ratio_p99_5
.compute_rest(indexes, starting_indexes, exit)?;
self.ratio_p99
.compute_rest(indexes, starting_indexes, exit)?;
self.ratio_p1
.compute_rest(indexes, starting_indexes, exit)?;
self.ratio_p0_5
.compute_rest(indexes, starting_indexes, exit)?;
self.ratio_p0_1
.compute_rest(indexes, starting_indexes, exit)?;
self.ratio_standard_deviation
.compute_rest(indexes, starting_indexes, exit)?;
self.ratio_p1sd
.compute_rest(indexes, starting_indexes, exit)?;
self.ratio_p2sd
.compute_rest(indexes, starting_indexes, exit)?;
self.ratio_p3sd
.compute_rest(indexes, starting_indexes, exit)?;
self.ratio_m1sd
.compute_rest(indexes, starting_indexes, exit)?;
self.ratio_m2sd
.compute_rest(indexes, starting_indexes, exit)?;
self.ratio_m3sd
.compute_rest(indexes, starting_indexes, exit)?;
self.ratio_p99_as_price.compute(
indexer,
indexes,
starting_indexes,
exit,
|vec, _, _, starting_indexes, exit| {
let mut iter = self.ratio_p99.dateindex.into_iter();
vec.compute_transform(
starting_indexes.dateindex,
&self.price.dateindex,
|(i, price, ..)| {
let multiplier = iter.unwrap_get_inner(i);
(i, price * multiplier)
},
exit,
)
},
)?;
self.ratio_p99_5_as_price.compute(
indexer,
indexes,
starting_indexes,
exit,
|vec, _, _, starting_indexes, exit| {
let mut iter = self.ratio_p99_5.dateindex.into_iter();
vec.compute_transform(
starting_indexes.dateindex,
&self.price.dateindex,
|(i, price, ..)| {
let multiplier = iter.unwrap_get_inner(i);
(i, price * multiplier)
},
exit,
)
},
)?;
self.ratio_p99_9_as_price.compute(
indexer,
indexes,
starting_indexes,
exit,
|vec, _, _, starting_indexes, exit| {
let mut iter = self.ratio_p99_9.dateindex.into_iter();
vec.compute_transform(
starting_indexes.dateindex,
&self.price.dateindex,
|(i, price, ..)| {
let multiplier = iter.unwrap_get_inner(i);
(i, price * multiplier)
},
exit,
)
},
)?;
self.ratio_p1_as_price.compute(
indexer,
indexes,
starting_indexes,
exit,
|vec, _, _, starting_indexes, exit| {
let mut iter = self.ratio_p1.dateindex.into_iter();
vec.compute_transform(
starting_indexes.dateindex,
&self.price.dateindex,
|(i, price, ..)| {
let multiplier = iter.unwrap_get_inner(i);
(i, price * multiplier)
},
exit,
)
},
)?;
self.ratio_p0_5_as_price.compute(
indexer,
indexes,
starting_indexes,
exit,
|vec, _, _, starting_indexes, exit| {
let mut iter = self.ratio_p0_5.dateindex.into_iter();
vec.compute_transform(
starting_indexes.dateindex,
&self.price.dateindex,
|(i, price, ..)| {
let multiplier = iter.unwrap_get_inner(i);
(i, price * multiplier)
},
exit,
)
},
)?;
self.ratio_p0_1_as_price.compute(
indexer,
indexes,
starting_indexes,
exit,
|vec, _, _, starting_indexes, exit| {
let mut iter = self.ratio_p0_1.dateindex.into_iter();
vec.compute_transform(
starting_indexes.dateindex,
&self.price.dateindex,
|(i, price, ..)| {
let multiplier = iter.unwrap_get_inner(i);
(i, price * multiplier)
},
exit,
)
},
)?;
self.ratio_p1sd_as_price.compute(
indexer,
indexes,
starting_indexes,
exit,
|vec, _, _, starting_indexes, exit| {
let mut iter = self.ratio_p1sd.dateindex.into_iter();
vec.compute_transform(
starting_indexes.dateindex,
&self.price.dateindex,
|(i, price, ..)| {
let multiplier = iter.unwrap_get_inner(i);
(i, price * multiplier)
},
exit,
)
},
)?;
self.ratio_p2sd_as_price.compute(
indexer,
indexes,
starting_indexes,
exit,
|vec, _, _, starting_indexes, exit| {
let mut iter = self.ratio_p2sd.dateindex.into_iter();
vec.compute_transform(
starting_indexes.dateindex,
&self.price.dateindex,
|(i, price, ..)| {
let multiplier = iter.unwrap_get_inner(i);
(i, price * multiplier)
},
exit,
)
},
)?;
self.ratio_p3sd_as_price.compute(
indexer,
indexes,
starting_indexes,
exit,
|vec, _, _, starting_indexes, exit| {
let mut iter = self.ratio_p3sd.dateindex.into_iter();
vec.compute_transform(
starting_indexes.dateindex,
&self.price.dateindex,
|(i, price, ..)| {
let multiplier = iter.unwrap_get_inner(i);
(i, price * multiplier)
},
exit,
)
},
)?;
self.ratio_m1sd_as_price.compute(
indexer,
indexes,
starting_indexes,
exit,
|vec, _, _, starting_indexes, exit| {
let mut iter = self.ratio_m1sd.dateindex.into_iter();
vec.compute_transform(
starting_indexes.dateindex,
&self.price.dateindex,
|(i, price, ..)| {
let multiplier = iter.unwrap_get_inner(i);
(i, price * multiplier)
},
exit,
)
},
)?;
self.ratio_m2sd_as_price.compute(
indexer,
indexes,
starting_indexes,
exit,
|vec, _, _, starting_indexes, exit| {
let mut iter = self.ratio_m2sd.dateindex.into_iter();
vec.compute_transform(
starting_indexes.dateindex,
&self.price.dateindex,
|(i, price, ..)| {
let multiplier = iter.unwrap_get_inner(i);
(i, price * multiplier)
},
exit,
)
},
)?;
self.ratio_m3sd_as_price.compute(
indexer,
indexes,
starting_indexes,
exit,
|vec, _, _, starting_indexes, exit| {
let mut iter = self.ratio_m3sd.dateindex.into_iter();
vec.compute_transform(
starting_indexes.dateindex,
&self.price.dateindex,
|(i, price, ..)| {
let multiplier = iter.unwrap_get_inner(i);
(i, price * multiplier)
},
exit,
)
},
)?;
Ok(())
}
fn mut_ratio_vecs(&mut self) -> Vec<&mut EagerVec<DateIndex, StoredF32>> {
vec![
&mut self.ratio_standard_deviation.dateindex,
&mut self.ratio_p99_9.dateindex,
&mut self.ratio_p99_5.dateindex,
&mut self.ratio_p99.dateindex,
&mut self.ratio_p1.dateindex,
&mut self.ratio_p0_5.dateindex,
&mut self.ratio_p0_1.dateindex,
&mut self.ratio_p1sd.dateindex,
&mut self.ratio_p2sd.dateindex,
&mut self.ratio_p3sd.dateindex,
&mut self.ratio_m1sd.dateindex,
&mut self.ratio_m2sd.dateindex,
&mut self.ratio_m3sd.dateindex,
]
}
pub fn vecs(&self) -> Vec<&dyn AnyCollectableVec> {
[
self.price.vecs(),
self.ratio.vecs(),
self.ratio_sma.vecs(),
self.ratio_1w_sma.vecs(),
self.ratio_1m_sma.vecs(),
self.ratio_1y_sma.vecs(),
self.ratio_1y_sma_momentum_oscillator.vecs(),
self.ratio_standard_deviation.vecs(),
self.ratio_p99_9.vecs(),
self.ratio_p99_5.vecs(),
self.ratio_p99.vecs(),
self.ratio_p1.vecs(),
self.ratio_p0_5.vecs(),
self.ratio_p0_1.vecs(),
self.ratio_p1sd.vecs(),
self.ratio_p2sd.vecs(),
self.ratio_p3sd.vecs(),
self.ratio_m1sd.vecs(),
self.ratio_m2sd.vecs(),
self.ratio_m3sd.vecs(),
self.ratio_p99_9_as_price.vecs(),
self.ratio_p99_5_as_price.vecs(),
self.ratio_p99_as_price.vecs(),
self.ratio_p1_as_price.vecs(),
self.ratio_p0_5_as_price.vecs(),
self.ratio_p0_1_as_price.vecs(),
self.ratio_p1sd_as_price.vecs(),
self.ratio_p2sd_as_price.vecs(),
self.ratio_p3sd_as_price.vecs(),
self.ratio_m1sd_as_price.vecs(),
self.ratio_m2sd_as_price.vecs(),
self.ratio_m3sd_as_price.vecs(),
]
.concat()
}
}
@@ -7,10 +7,7 @@ use brk_vec::{
AnyCollectableVec, CollectableVec, Compressed, EagerVec, Result, StoredVec, Version,
};
use crate::storage::{
fetched,
vecs::{Indexes, indexes},
};
use crate::vecs::{Indexes, fetched, indexes};
use super::{ComputedVecsFromHeight, StorableVecGeneatorOptions};
@@ -8,10 +8,7 @@ use brk_vec::{
Computation, ComputedVecFrom3, LazyVecFrom1, StoredIndex, StoredVec, Version,
};
use crate::storage::{
fetched,
vecs::{Indexes, indexes},
};
use crate::vecs::{Indexes, fetched, indexes};
use super::{ComputedVecsFromTxindex, StorableVecGeneatorOptions};
File diff suppressed because it is too large Load Diff
@@ -7,15 +7,15 @@ use brk_vec::{AnyCollectableVec, Compressed, Computation, VecIterator, Version};
use super::{
Indexes,
grouped::{ComputedVecsFromDateindex, ComputedVecsFromHeight, StorableVecGeneatorOptions},
grouped::{ComputedVecsFromDateIndex, ComputedVecsFromHeight, StorableVecGeneatorOptions},
indexes,
};
#[derive(Clone)]
pub struct Vecs {
pub indexes_to_difficulty: ComputedVecsFromHeight<StoredF64>,
pub indexes_to_difficultyepoch: ComputedVecsFromDateindex<DifficultyEpoch>,
pub indexes_to_halvingepoch: ComputedVecsFromDateindex<HalvingEpoch>,
pub indexes_to_difficultyepoch: ComputedVecsFromDateIndex<DifficultyEpoch>,
pub indexes_to_halvingepoch: ComputedVecsFromDateIndex<HalvingEpoch>,
}
impl Vecs {
@@ -35,14 +35,14 @@ impl Vecs {
compressed,
StorableVecGeneatorOptions::default().add_last(),
)?,
indexes_to_difficultyepoch: ComputedVecsFromDateindex::forced_import(
indexes_to_difficultyepoch: ComputedVecsFromDateIndex::forced_import(
path,
"difficultyepoch",
Version::ZERO,
compressed,
StorableVecGeneatorOptions::default().add_last(),
)?,
indexes_to_halvingepoch: ComputedVecsFromDateindex::forced_import(
indexes_to_halvingepoch: ComputedVecsFromDateIndex::forced_import(
path,
"halvingepoch",
Version::ZERO,
@@ -6,6 +6,7 @@ use brk_indexer::Indexer;
use brk_vec::{AnyCollectableVec, Compressed, Computation};
pub mod blocks;
pub mod constants;
pub mod fetched;
pub mod grouped;
pub mod indexes;
@@ -18,6 +19,7 @@ pub use indexes::Indexes;
#[derive(Clone)]
pub struct Vecs {
pub indexes: indexes::Vecs,
pub constants: constants::Vecs,
pub blocks: blocks::Vecs,
pub mining: mining::Vecs,
pub market: market::Vecs,
@@ -43,6 +45,7 @@ impl Vecs {
Ok(Self {
blocks: blocks::Vecs::forced_import(path, computation, compressed)?,
mining: mining::Vecs::forced_import(path, computation, compressed)?,
constants: constants::Vecs::forced_import(path, computation, compressed)?,
market: market::Vecs::forced_import(path, computation, compressed)?,
transactions: transactions::Vecs::forced_import(
path,
@@ -66,6 +69,9 @@ impl Vecs {
) -> color_eyre::Result<()> {
let starting_indexes = self.indexes.compute(indexer, starting_indexes, exit)?;
self.constants
.compute(indexer, &self.indexes, &starting_indexes, exit)?;
self.blocks
.compute(indexer, &self.indexes, &starting_indexes, exit)?;
@@ -106,6 +112,7 @@ impl Vecs {
pub fn vecs(&self) -> Vec<&dyn AnyCollectableVec> {
[
self.constants.vecs(),
self.indexes.vecs(),
self.blocks.vecs(),
self.mining.vecs(),
+7 -1
View File
@@ -3,7 +3,7 @@ use std::ops::{Add, Div, Mul};
use serde::Serialize;
use zerocopy_derive::{FromBytes, Immutable, IntoBytes, KnownLayout};
use super::Sats;
use super::{Sats, StoredF64};
#[derive(
Debug,
@@ -53,6 +53,12 @@ impl From<f64> for Bitcoin {
}
}
impl From<StoredF64> for Bitcoin {
fn from(value: StoredF64) -> Self {
Self(*value)
}
}
impl From<Bitcoin> for f64 {
fn from(value: Bitcoin) -> Self {
value.0
+15 -1
View File
@@ -1,4 +1,4 @@
use std::ops::{Add, Div};
use std::ops::{Add, Div, Mul};
use serde::Serialize;
use zerocopy_derive::{FromBytes, Immutable, IntoBytes, KnownLayout};
@@ -74,3 +74,17 @@ impl From<Cents> for u128 {
value.0 as u128
}
}
impl Mul<Cents> for Cents {
type Output = Cents;
fn mul(self, rhs: Cents) -> Self::Output {
Self(self.0 * rhs.0)
}
}
impl Mul<usize> for Cents {
type Output = Cents;
fn mul(self, rhs: usize) -> Self::Output {
Self(self.0 * rhs as u64)
}
}
+1
View File
@@ -14,6 +14,7 @@ impl Date {
pub const INDEX_ZERO_: Date_ = Date_::constant(2009, 1, 3);
pub const INDEX_ONE: Self = Self(20090109);
pub const INDEX_ONE_: Date_ = Date_::constant(2009, 1, 9);
pub const MIN_RATIO: Self = Self(20120101);
pub fn new(year: u16, month: u8, day: u8) -> Self {
Self(year as u32 * 1_00_00 + month as u32 * 1_00 + day as u32)
+92 -3
View File
@@ -1,10 +1,13 @@
use std::ops::{Add, Div, Mul};
use std::{
f64,
ops::{Add, Div, Mul},
};
use derive_deref::Deref;
use serde::Serialize;
use zerocopy_derive::{FromBytes, Immutable, IntoBytes, KnownLayout};
use super::{Bitcoin, Cents, Sats};
use super::{Bitcoin, Cents, Close, Sats, StoredF32, StoredF64};
#[derive(
Debug,
@@ -24,6 +27,16 @@ pub struct Dollars(f64);
impl Dollars {
pub const ZERO: Self = Self(0.0);
pub const fn mint(dollars: f64) -> Self {
Self(dollars)
}
}
impl From<f32> for Dollars {
fn from(value: f32) -> Self {
Self(value as f64)
}
}
impl From<f64> for Dollars {
@@ -38,12 +51,24 @@ impl From<Cents> for Dollars {
}
}
impl From<Dollars> for f32 {
fn from(value: Dollars) -> Self {
value.0 as f32
}
}
impl From<Dollars> for f64 {
fn from(value: Dollars) -> Self {
value.0
}
}
impl From<Close<Dollars>> for Dollars {
fn from(value: Close<Dollars>) -> Self {
Self(value.0)
}
}
impl From<usize> for Dollars {
fn from(value: usize) -> Self {
Self(value as f64)
@@ -57,6 +82,27 @@ impl Add for Dollars {
}
}
impl Div<Dollars> for Dollars {
type Output = StoredF64;
fn div(self, rhs: Dollars) -> Self::Output {
StoredF64::from(self.0 / rhs.0)
}
}
impl Div<Close<Dollars>> for Dollars {
type Output = StoredF64;
fn div(self, rhs: Close<Dollars>) -> Self::Output {
StoredF64::from(self.0 / rhs.0)
}
}
impl Div<Dollars> for Close<Dollars> {
type Output = StoredF64;
fn div(self, rhs: Dollars) -> Self::Output {
StoredF64::from(self.0 / rhs.0)
}
}
impl Div<usize> for Dollars {
type Output = Self;
fn div(self, rhs: usize) -> Self::Output {
@@ -64,6 +110,13 @@ impl Div<usize> for Dollars {
}
}
impl Div<Bitcoin> for Dollars {
type Output = Self;
fn div(self, rhs: Bitcoin) -> Self::Output {
Self(f64::from(self) / f64::from(rhs))
}
}
impl Eq for Dollars {}
#[allow(clippy::derive_ord_xor_partial_ord)]
@@ -74,10 +127,46 @@ impl Ord for Dollars {
}
impl Mul<Bitcoin> for Dollars {
type Output = Dollars;
type Output = Self;
fn mul(self, rhs: Bitcoin) -> Self::Output {
Self::from(Cents::from(
u128::from(Sats::from(rhs)) * u128::from(Cents::from(self)) / u128::from(Sats::ONE_BTC),
))
}
}
impl Mul<StoredF32> for Dollars {
type Output = Self;
fn mul(self, rhs: StoredF32) -> Self::Output {
if rhs.is_nan() {
Self(f64::NAN)
} else {
Self::from(Cents::from(Self::from(self.0 * *rhs as f64)))
}
}
}
impl Mul<usize> for Dollars {
type Output = Self;
fn mul(self, rhs: usize) -> Self::Output {
Self::from(Cents::from(self) * rhs)
}
}
impl From<u128> for Dollars {
fn from(value: u128) -> Self {
Self::from(Cents::from(value))
}
}
impl From<Close<Dollars>> for u128 {
fn from(value: Close<Dollars>) -> Self {
u128::from(*value)
}
}
impl From<Dollars> for u128 {
fn from(value: Dollars) -> Self {
u128::from(Cents::from(value))
}
}
+4
View File
@@ -24,6 +24,7 @@ mod outputtypeindex;
mod quarterindex;
mod rawlocktime;
mod sats;
mod stored_f32;
mod stored_f64;
mod stored_u32;
mod stored_u64;
@@ -67,6 +68,7 @@ pub use outputtypeindex::*;
pub use quarterindex::*;
pub use rawlocktime::*;
pub use sats::*;
pub use stored_f32::*;
pub use stored_f64::*;
pub use stored_u8::*;
pub use stored_u32::*;
@@ -83,3 +85,5 @@ pub use vout::*;
pub use weekindex::*;
pub use weight::*;
pub use yearindex::*;
pub use rlimit;
+18
View File
@@ -453,6 +453,15 @@ where
}
}
impl<T> From<f32> for Close<T>
where
T: From<f32>,
{
fn from(value: f32) -> Self {
Self(T::from(value))
}
}
impl<T> From<f64> for Close<T>
where
T: From<f64>,
@@ -462,6 +471,15 @@ where
}
}
impl<T> From<Close<T>> for f32
where
f32: From<T>,
{
fn from(value: Close<T>) -> Self {
Self::from(value.0)
}
}
impl<T> From<Close<T>> for f64
where
f64: From<T>,
+112
View File
@@ -0,0 +1,112 @@
use std::ops::{Add, Div, Mul, Sub};
use derive_deref::Deref;
use serde::Serialize;
use zerocopy_derive::{FromBytes, Immutable, IntoBytes, KnownLayout};
use crate::CheckedSub;
use super::{Dollars, StoredF64};
#[derive(
Debug,
Deref,
Default,
Clone,
Copy,
PartialEq,
PartialOrd,
FromBytes,
Immutable,
IntoBytes,
KnownLayout,
Serialize,
)]
pub struct StoredF32(f32);
impl From<f32> for StoredF32 {
fn from(value: f32) -> Self {
Self(value)
}
}
impl From<f64> for StoredF32 {
fn from(value: f64) -> Self {
Self(value as f32)
}
}
impl From<StoredF64> for StoredF32 {
fn from(value: StoredF64) -> Self {
Self(*value as f32)
}
}
impl From<usize> for StoredF32 {
fn from(value: usize) -> Self {
Self(value as f32)
}
}
impl CheckedSub<StoredF32> for StoredF32 {
fn checked_sub(self, rhs: Self) -> Option<Self> {
Some(Self(self.0 - rhs.0))
}
}
impl Div<usize> for StoredF32 {
type Output = Self;
fn div(self, rhs: usize) -> Self::Output {
Self(self.0 / rhs as f32)
}
}
impl Add for StoredF32 {
type Output = Self;
fn add(self, rhs: Self) -> Self::Output {
Self(self.0 + rhs.0)
}
}
impl From<StoredF32> for f32 {
fn from(value: StoredF32) -> Self {
value.0
}
}
impl Eq for StoredF32 {}
#[allow(clippy::derive_ord_xor_partial_ord)]
impl Ord for StoredF32 {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.0.partial_cmp(&other.0).unwrap()
}
}
impl Div<Dollars> for StoredF32 {
type Output = Self;
fn div(self, rhs: Dollars) -> Self::Output {
Self::from(self.0 as f64 / *rhs)
}
}
impl Mul<usize> for StoredF32 {
type Output = Self;
fn mul(self, rhs: usize) -> Self::Output {
Self(self.0 * rhs as f32)
}
}
impl Mul<StoredF32> for usize {
type Output = StoredF32;
fn mul(self, rhs: StoredF32) -> Self::Output {
StoredF32(self as f32 * rhs.0)
}
}
impl Sub<StoredF32> for StoredF32 {
type Output = Self;
fn sub(self, rhs: StoredF32) -> Self::Output {
Self(self.0 - rhs.0)
}
}
+14 -1
View File
@@ -1,4 +1,4 @@
use std::ops::{Add, Div};
use std::ops::{Add, Div, Mul};
use derive_deref::Deref;
use serde::Serialize;
@@ -40,6 +40,13 @@ impl CheckedSub<StoredF64> for StoredF64 {
}
}
impl Mul<usize> for StoredF64 {
type Output = Self;
fn mul(self, rhs: usize) -> Self::Output {
Self(self.0 * rhs as f64)
}
}
impl Div<usize> for StoredF64 {
type Output = Self;
fn div(self, rhs: usize) -> Self::Output {
@@ -68,3 +75,9 @@ impl Ord for StoredF64 {
self.0.partial_cmp(&other.0).unwrap()
}
}
impl CheckedSub<usize> for StoredF64 {
fn checked_sub(self, rhs: usize) -> Option<Self> {
Some(Self(self.0 - rhs as f64))
}
}
+8 -1
View File
@@ -4,7 +4,14 @@ use rlimit::{Resource, getrlimit};
pub fn setrlimit() -> io::Result<()> {
let no_file_limit = getrlimit(Resource::NOFILE)?;
rlimit::setrlimit(Resource::NOFILE, no_file_limit.0.max(210_000), no_file_limit.1)?;
rlimit::setrlimit(
Resource::NOFILE,
no_file_limit.0.max(210_000),
no_file_limit.1,
)?;
// let no_stack = getrlimit(Resource::STACK)?;
// rlimit::setrlimit(Resource::STACK, no_stack.1, no_stack.1)?;
Ok(())
}
+1 -1
View File
@@ -8,5 +8,5 @@ repository.workspace = true
[dependencies]
brk_logger = { workspace = true }
ctrlc = { version = "3.4.6", features = ["termination"] }
ctrlc = { version = "3.4.7", features = ["termination"] }
log = { workspace = true }
+1 -1
View File
@@ -38,7 +38,7 @@ impl Kibo {
.unwrap()
.get(usize::from(height.checked_sub(key).unwrap()))
.cloned()
.ok_or(color_eyre::eyre::Error::msg("Couldn't find height in kibo"))
.ok_or(eyre!("Couldn't find height in kibo"))
}
fn fetch_height_prices(height: Height) -> color_eyre::Result<Vec<OHLCCents>> {
+12 -4
View File
@@ -35,8 +35,14 @@ impl Fetcher {
pub fn get_date(&mut self, date: Date) -> color_eyre::Result<OHLCCents> {
self.kraken
.get_from_1d(&date)
.or_else(|_| self.binance.get_from_1d(&date))
.or_else(|_| self.kibo.get_from_date(&date))
.or_else(|e| {
eprintln!("{e}");
self.binance.get_from_1d(&date)
})
.or_else(|e| {
eprintln!("{e}");
self.kibo.get_from_date(&date)
})
}
pub fn get_height(
@@ -56,10 +62,12 @@ impl Fetcher {
let ohlc = self
.kraken
.get_from_1mn(timestamp, previous_timestamp)
.unwrap_or_else(|_| {
.unwrap_or_else(|e| {
eprintln!("{e}");
self.binance
.get_from_1mn(timestamp, previous_timestamp)
.unwrap_or_else(|_| {
.unwrap_or_else(|e| {
eprintln!("{e}");
self.kibo.get_from_height(height).unwrap_or_else(|e| {
let date = Date::from(timestamp);
eprintln!("{e}");
+2 -2
View File
@@ -23,9 +23,9 @@ color-eyre = { workspace = true }
jiff = { workspace = true }
log = { workspace = true }
minreq = { workspace = true }
oxc = { version = "0.68.1", features = ["codegen", "minifier"] }
oxc = { version = "0.69.0", features = ["codegen", "minifier"] }
serde = { workspace = true }
tokio = { version = "1.45.0", features = ["full"] }
tower-http = { version = "0.6.3", features = ["compression-full", "trace"] }
tower-http = { version = "0.6.4", features = ["compression-full", "trace"] }
zip = "2.6.1"
tracing = "0.1.41"
+1 -8
View File
@@ -79,14 +79,7 @@ impl DTS for Query<'static> {
.collect::<Vec<_>>()
.join(", ");
contents += &format!(
" {}: [{indexes}],\n",
if id.contains("-") {
format!("\"{id}\"")
} else {
id.to_owned()
}
);
contents += &format!(" \"{id}\": [{indexes}],\n");
});
contents += " });\n";
+4
View File
@@ -20,6 +20,10 @@ impl Version {
pub const ONE: Self = Self(1);
pub const TWO: Self = Self(2);
pub const fn new(v: u32) -> Self {
Self(v)
}
pub fn write(&self, path: &Path) -> Result<(), io::Error> {
fs::write(path, self.as_bytes())
}
+1 -1
View File
@@ -11,7 +11,7 @@ where
fn collect_range(&self, from: Option<usize>, to: Option<usize>) -> Result<Vec<T>> {
let len = self.len();
let from = from.unwrap_or_default();
let to = to.map_or(len, |i| i.min(len));
let to = to.map_or(len, |to| to.min(len));
if from >= len || from >= to {
return Ok(vec![]);
+335 -2
View File
@@ -1,13 +1,16 @@
use core::error;
use std::{
cmp::Ordering,
f32,
fmt::Debug,
ops::Add,
ops::{Add, Div, Mul},
path::{Path, PathBuf},
time::Duration,
};
use brk_core::{Bitcoin, CheckedSub, Close, Dollars, Height, Sats, StoredUsize, TxIndex};
use brk_core::{
Bitcoin, CheckedSub, Close, DateIndex, Dollars, Height, Sats, StoredUsize, TxIndex,
};
use brk_exit::Exit;
use log::info;
@@ -20,6 +23,7 @@ use crate::{
const ONE_KIB: usize = 1024;
const ONE_MIB: usize = ONE_KIB * ONE_KIB;
const MAX_CACHE_SIZE: usize = 210 * ONE_MIB;
const DCA_AMOUNT: Dollars = Dollars::mint(100.0);
#[derive(Debug, Clone)]
pub struct EagerVec<I, T> {
@@ -88,6 +92,10 @@ where
self.inner.path()
}
pub fn inner_version(&self) -> Version {
self.inner.version()
}
#[inline]
fn path_computed_version(&self) -> PathBuf {
self.inner.path().join("computed_version")
@@ -171,6 +179,88 @@ where
self.safe_flush(exit)
}
pub fn compute_divide<T2, T3, T4>(
&mut self,
max_from: I,
divided: &impl AnyIterableVec<I, T2>,
divider: &impl AnyIterableVec<I, T3>,
exit: &Exit,
) -> Result<()>
where
T2: StoredType + Div<T3, Output = T4>,
T3: StoredType,
T4: Mul<usize, Output = T4> + CheckedSub<usize>,
T: From<T4>,
{
self.compute_divide_(max_from, divided, divider, exit, false, false)
}
pub fn compute_percentage<T2, T3, T4>(
&mut self,
max_from: I,
divided: &impl AnyIterableVec<I, T2>,
divider: &impl AnyIterableVec<I, T3>,
exit: &Exit,
) -> Result<()>
where
T2: StoredType + Div<T3, Output = T4>,
T3: StoredType,
T4: Mul<usize, Output = T4> + CheckedSub<usize>,
T: From<T4>,
{
self.compute_divide_(max_from, divided, divider, exit, true, false)
}
pub fn compute_percentage_difference<T2, T3, T4>(
&mut self,
max_from: I,
divided: &impl AnyIterableVec<I, T2>,
divider: &impl AnyIterableVec<I, T3>,
exit: &Exit,
) -> Result<()>
where
T2: StoredType + Div<T3, Output = T4>,
T3: StoredType,
T4: Mul<usize, Output = T4> + CheckedSub<usize>,
T: From<T4>,
{
self.compute_divide_(max_from, divided, divider, exit, true, true)
}
pub fn compute_divide_<T2, T3, T4>(
&mut self,
max_from: I,
divided: &impl AnyIterableVec<I, T2>,
divider: &impl AnyIterableVec<I, T3>,
exit: &Exit,
as_percentage: bool,
as_difference: bool,
) -> Result<()>
where
T2: StoredType + Div<T3, Output = T4>,
T3: StoredType,
T4: Mul<usize, Output = T4> + CheckedSub<usize>,
T: From<T4>,
{
self.validate_computed_version_or_reset_file(
Version::ZERO + self.inner.version() + divided.version() + divider.version(),
)?;
let index = max_from.min(I::from(self.len()));
let multiplier = if as_percentage { 100 } else { 1 };
let subtract = if as_difference { multiplier } else { 0 };
let mut divider_iter = divider.iter();
divided.iter_at(index).try_for_each(|(i, divided)| {
let v = (divided.into_inner() / divider_iter.unwrap_get_inner(i) * multiplier)
.checked_sub(subtract)
.unwrap();
self.forced_push_at(i, T::from(v), exit)
})?;
self.safe_flush(exit)
}
pub fn compute_inverse_more_to_less(
&mut self,
max_from: T,
@@ -406,6 +496,249 @@ where
self.safe_flush(exit)
}
pub fn compute_sma<T2>(
&mut self,
max_from: I,
source: &impl AnyIterableVec<I, T2>,
sma: usize,
exit: &Exit,
) -> Result<()>
where
T: Add<T, Output = T> + From<T2> + Div<usize, Output = T> + From<f32>,
T2: StoredType,
f32: From<T> + From<T2>,
{
self.compute_sma_(max_from, source, sma, exit, None)
}
pub fn compute_sma_<T2>(
&mut self,
max_from: I,
source: &impl AnyIterableVec<I, T2>,
sma: usize,
exit: &Exit,
min_i: Option<I>,
) -> Result<()>
where
T: Add<T, Output = T> + From<T2> + Div<usize, Output = T> + From<f32>,
T2: StoredType,
f32: From<T> + From<T2>,
{
self.validate_computed_version_or_reset_file(
Version::ZERO + self.inner.version() + source.version(),
)?;
let index = max_from.min(I::from(self.len()));
let mut prev = None;
let min_prev_i = min_i.unwrap_or_default().unwrap_to_usize();
source.iter_at(index).try_for_each(|(i, value)| {
let value = value.into_inner();
if min_i.is_none() || min_i.is_some_and(|min_i| min_i <= i) {
if prev.is_none() {
let i = i.unwrap_to_usize();
prev.replace(if i > min_prev_i {
self.into_iter().unwrap_get_inner_(i - 1)
} else {
T::from(0.0)
});
}
let len = (i.unwrap_to_usize() - min_prev_i + 1).min(sma);
let sma = T::from(
(f32::from(prev.clone().unwrap()) * (len - 1) as f32 + f32::from(value))
/ len as f32,
);
prev.replace(sma.clone());
self.forced_push_at(i, sma, exit)
} else {
self.forced_push_at(i, T::from(f32::NAN), exit)
}
})?;
self.safe_flush(exit)
}
pub fn compute_previous_value<T2>(
&mut self,
max_from: I,
source: &impl AnyIterableVec<I, T2>,
len: usize,
exit: &Exit,
) -> Result<()>
where
I: CheckedSub,
T2: StoredType + Default,
f32: From<T2>,
T: From<f32>,
{
self.validate_computed_version_or_reset_file(
Version::ZERO + self.inner.version() + source.version(),
)?;
let index = max_from.min(I::from(self.len()));
let mut source_iter = source.iter();
(index.to_usize()?..source.len()).try_for_each(|i| {
let i = I::from(i);
let previous_value = i
.checked_sub(I::from(len))
.map(|prev_i| f32::from(source_iter.unwrap_get_inner(prev_i)))
.unwrap_or(f32::NAN);
self.forced_push_at(i, T::from(previous_value), exit)
})?;
self.safe_flush(exit)
}
pub fn compute_percentage_change<T2>(
&mut self,
max_from: I,
source: &impl AnyIterableVec<I, T2>,
len: usize,
exit: &Exit,
) -> Result<()>
where
I: CheckedSub,
T2: StoredType + Default,
f32: From<T2>,
T: From<f32>,
{
self.validate_computed_version_or_reset_file(
Version::ZERO + self.inner.version() + source.version(),
)?;
let index = max_from.min(I::from(self.len()));
let mut source_iter = source.iter();
source.iter_at(index).try_for_each(|(i, b)| {
let previous_value = f32::from(
i.checked_sub(I::from(len))
.map(|prev_i| source_iter.unwrap_get_inner(prev_i))
.unwrap_or_default(),
);
let last_value = f32::from(b.into_inner());
let percentage_change = ((last_value / previous_value) - 1.0) * 100.0;
self.forced_push_at(i, T::from(percentage_change), exit)
})?;
self.safe_flush(exit)
}
pub fn compute_cagr<T2>(
&mut self,
max_from: I,
percentage_returns: &impl AnyIterableVec<I, T2>,
days: usize,
exit: &Exit,
) -> Result<()>
where
I: CheckedSub,
T2: StoredType + Default,
f32: From<T2>,
T: From<f32>,
{
self.validate_computed_version_or_reset_file(
Version::ZERO + self.inner.version() + percentage_returns.version(),
)?;
if days % 365 != 0 {
panic!("bad days");
}
let years = days / 365;
let index = max_from.min(I::from(self.len()));
percentage_returns
.iter_at(index)
.try_for_each(|(i, percentage)| {
let percentage = percentage.into_inner();
let cagr = (((f32::from(percentage) / 100.0 + 1.0).powf(1.0 / years as f32)) - 1.0)
* 100.0;
self.forced_push_at(i, T::from(cagr), exit)
})?;
self.safe_flush(exit)
}
}
impl EagerVec<DateIndex, Sats> {
pub fn compute_dca_stack(
&mut self,
max_from: DateIndex,
closes: &impl AnyIterableVec<DateIndex, Close<Dollars>>,
len: usize,
exit: &Exit,
) -> Result<()> {
self.validate_computed_version_or_reset_file(
Version::ZERO + self.inner.version() + closes.version(),
)?;
let mut other_iter = closes.iter();
let mut prev = None;
let index = max_from.min(DateIndex::from(self.len()));
closes.iter_at(index).try_for_each(|(i, closes)| {
let price = *closes.into_inner();
let i_usize = i.unwrap_to_usize();
if prev.is_none() {
if i_usize == 0 {
prev.replace(Sats::ZERO);
} else {
prev.replace(self.into_iter().unwrap_get_inner_(i_usize - 1));
}
}
let mut stack = Sats::ZERO;
if price != Dollars::ZERO {
stack = prev.unwrap() + Sats::from(Bitcoin::from(DCA_AMOUNT / price));
if i_usize >= len {
let prev_price = *other_iter.unwrap_get_inner_(i_usize - len);
if prev_price != Dollars::ZERO {
stack = stack
.checked_sub(Sats::from(Bitcoin::from(DCA_AMOUNT / prev_price)))
.unwrap();
}
}
}
prev.replace(stack);
self.forced_push_at(i, stack, exit)
})?;
self.safe_flush(exit)
}
}
impl EagerVec<DateIndex, Dollars> {
pub fn compute_dca_avg_price(
&mut self,
max_from: DateIndex,
stacks: &impl AnyIterableVec<DateIndex, Sats>,
len: usize,
exit: &Exit,
) -> Result<()> {
self.validate_computed_version_or_reset_file(
Version::ONE + self.inner.version() + stacks.version(),
)?;
let index = max_from.min(DateIndex::from(self.len()));
stacks.iter_at(index).try_for_each(|(i, stack)| {
let stack = stack.into_inner();
let avg_price = DCA_AMOUNT * len.min(i.unwrap_to_usize() + 1) / Bitcoin::from(stack);
self.forced_push_at(i, avg_price, exit)
})?;
self.safe_flush(exit)
}
}
impl<I> EagerVec<I, Bitcoin>
+7 -6
View File
@@ -990,16 +990,17 @@
display: flex;
align-items: center;
gap: 1.5rem;
margin-left: var(--negative-main-padding);
margin-right: var(--negative-main-padding);
padding-left: var(--main-padding);
padding-right: var(--main-padding);
padding-bottom: 1rem;
margin: -0.5rem var(--negative-main-padding);
padding: 1rem var(--main-padding);
overflow-x: auto;
min-width: 0;
font-size: var(--font-size-sm);
line-height: var(--line-height-sm);
height: 2rem;
scrollbar-width: thin;
&:empty {
display: none;
}
> div {
flex: 0;
@@ -1,6 +1,6 @@
// @ts-check
/** @import {IChartApi, ISeriesApi, SeriesDefinition, SingleValueData as _SingleValueData, CandlestickData as _CandlestickData, BaselineData, SeriesType, IPaneApi, LineSeriesOptions} from './v5.0.6-treeshaked/types' */
/** @import {IChartApi, ISeriesApi, SeriesDefinition, SingleValueData as _SingleValueData, CandlestickData as _CandlestickData, BaselineData, SeriesType, IPaneApi, BaselineStyleOptions} from './v5.0.6-treeshaked/types' */
/**
* @typedef {[number, number, number, number]} OHLCTuple
@@ -50,7 +50,6 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
autoSize: true,
layout: {
fontFamily: elements.style.fontFamily,
// fontSize: 13,
background: { color: "transparent" },
attributionLogo: false,
colorSpace: "display-p3",
@@ -71,17 +70,13 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
const chart = lc.createChart(element, options);
chart.priceScale("right").applyOptions({
// scaleMargins: {
// top: 0.15,
// bottom: 0.05,
// },
minimumWidth: 80,
});
signals.createEffect(
() => ({
defaultColor: colors.default(),
offColor: colors.off(),
offColor: colors.gray(),
borderColor: colors.border(),
}),
({ defaultColor, offColor, borderColor }) => {
@@ -161,16 +156,24 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
div.classList.add("chart");
parent.append(div);
const legend = createLegend({
const legendTop = createLegend({
parent: div,
utils,
signals,
paneIndex: 0,
});
const chartDiv = window.document.createElement("div");
chartDiv.classList.add("lightweight-chart");
div.append(chartDiv);
const legendBottom = createLegend({
parent: div,
utils,
signals,
paneIndex: 1,
});
let ichart = /** @type {IChartApi | null} */ (null);
let timeScaleSet = false;
@@ -220,7 +223,12 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
offset += 1;
}
const v = ohlcs[i];
if (typeof v === "number") {
if (v === null) {
data[i - offset] = {
time,
value: NaN,
};
} else if (typeof v === "number") {
data[i - offset] = {
time,
value: v,
@@ -363,7 +371,7 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
);
}
legend.add({
(paneIndex ? legendBottom : legendTop).add({
series,
name,
defaultActive,
@@ -396,7 +404,7 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
* @param {Color} [args.color]
* @param {number} [args.paneIndex]
* @param {boolean} [args.defaultActive]
* @param {DeepPartial<LineStyleOptions & SeriesOptionsCommon>} [args.options]
* @param {DeepPartial<LineStyleOptions & SeriesOptionsCommon & CreatePriceLineOptions>} [args.options]
*/
addLineSeries({
vecId,
@@ -426,6 +434,11 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
paneIndex,
);
const priceLineOptions = options?.createPriceLine;
if (priceLineOptions) {
createPriceLine(series, priceLineOptions, colors);
}
let url = /** @type {string | undefined} */ (undefined);
if (vecId) {
@@ -445,7 +458,7 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
);
}
legend.add({
(paneIndex ? legendBottom : legendTop).add({
series,
colors: [color],
name,
@@ -477,6 +490,7 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
* @param {VecId} [args.vecId]
* @param {number} [args.paneIndex]
* @param {boolean} [args.defaultActive]
* @param {DeepPartial<BaselineStyleOptions & SeriesOptionsCommon & CreatePriceLineOptions>} [args.options]
*/
addBaselineSeries({
vecId,
@@ -485,29 +499,40 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
paneIndex: _paneIndex,
defaultActive,
data,
options,
}) {
if (!ichart || !timeResource) throw Error("Chart not fully set");
const paneIndex = _paneIndex ?? 0;
console.log("OPTIONS", options);
const series = ichart.addSeries(
/** @type {SeriesDefinition<'Baseline'>} */ (lc.BaselineSeries),
{
lineWidth: /** @type {any} */ (1.5),
visible: defaultActive !== false,
topLineColor: colors.green(),
bottomLineColor: colors.red(),
baseValue: {
price: 0,
},
baseLineStyle: 0,
baseLineWidth: 1,
baseLineVisible: true,
...options,
topLineColor: options?.topLineColor ?? colors.green(),
bottomLineColor: options?.bottomLineColor ?? colors.red(),
priceLineVisible: false,
bottomFillColor1: "transparent",
bottomFillColor2: "transparent",
topFillColor1: "transparent",
topFillColor2: "transparent",
lineVisible: true,
},
paneIndex,
);
const priceLineOptions = options?.createPriceLine;
if (priceLineOptions) {
createPriceLine(series, priceLineOptions, colors);
}
let url = /** @type {string | undefined} */ (undefined);
if (vecId) {
@@ -528,9 +553,12 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
);
}
legend.add({
(paneIndex ? legendBottom : legendTop).add({
series,
colors: [colors.green, colors.red],
colors: [
() => options?.topLineColor ?? colors.green(),
() => options?.bottomLineColor ?? colors.red(),
],
name,
defaultActive,
url,
@@ -647,7 +675,8 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
ichart = null;
timeScaleSet = false;
activeResources.length = 0;
legend.reset();
legendTop.reset();
legendBottom.reset();
},
};
@@ -697,9 +726,10 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
* @param {Object} args
* @param {Element} args.parent
* @param {Signals} args.signals
* @param {number} args.paneIndex
* @param {Utilities} args.utils
*/
function createLegend({ parent, signals, utils }) {
function createLegend({ parent, signals, utils, paneIndex }) {
const legendElement = window.document.createElement("legend");
parent.append(legendElement);
@@ -721,7 +751,7 @@ function createLegend({ parent, signals, utils }) {
legendElement.append(div);
const nameId = utils.stringToId(name);
const nameId = `${utils.stringToId(name)}-${paneIndex}`;
const active = signals.createSignal(defaultActive ?? true, {
save: {
@@ -998,3 +1028,18 @@ function createPaneHeightObserver({ ichart, paneIndex, signals, utils }) {
callback();
}
/**
* @param {ISeriesApi<SeriesType>} series
* @param {DeepPartial<CreatePriceLine>} options
* @param {Colors} colors
*/
function createPriceLine(series, options, colors) {
series.createPriceLine({
price: options.value || 0,
color: colors.gray(),
axisLabelVisible: false,
lineWidth: 1,
lineStyle: 4,
});
}
+32 -8
View File
@@ -229,14 +229,38 @@ export function init({
vecIdToIndexes[blueprint.key]
);
if (indexes.includes(index)) {
chart.addLineSeries({
vecId: blueprint.key,
color: blueprint.color,
name: blueprint.title,
unit,
defaultActive: blueprint.defaultActive,
paneIndex,
});
switch (blueprint.type) {
case "Baseline": {
chart.addBaselineSeries({
vecId: blueprint.key,
// color: blueprint.color,
name: blueprint.title,
unit,
defaultActive: blueprint.defaultActive,
paneIndex,
options: {
...blueprint.options,
topLineColor: blueprint.colors?.[0](),
bottomLineColor: blueprint.colors?.[1](),
},
});
break;
}
case "Candlestick": {
throw Error("TODO");
break;
}
default:
chart.addLineSeries({
vecId: blueprint.key,
color: blueprint.color,
name: blueprint.title,
unit,
defaultActive: blueprint.defaultActive,
paneIndex,
options: blueprint.options,
});
}
}
});
});
+48 -10
View File
@@ -1,10 +1,10 @@
// @ts-check
/**
* @import { Option, PartialChartOption, ChartOption, AnyPartialOption, ProcessedOptionAddons, OptionsTree, SimulationOption, AnySeriesBlueprint, ChartableIndex } from "./options"
* @import { Option, PartialChartOption, ChartOption, AnyPartialOption, ProcessedOptionAddons, OptionsTree, SimulationOption, AnySeriesBlueprint, ChartableIndex,CreatePriceLineOptions, CreatePriceLine } from "./options"
* @import {Valued, SingleValueData, CandlestickData, ChartData, OHLCTuple} from "../packages/lightweight-charts/wrapper"
* @import * as _ from "../packages/ufuzzy/v1.0.14/types"
* @import { createChart as CreateClassicChart, LineStyleOptions, DeepPartial, ChartOptions, IChartApi, IHorzScaleBehavior, WhitespaceData, ISeriesApi, Time, LineData, LogicalRange, SeriesType, BaselineStyleOptions, SeriesOptionsCommon, BaselineData, CandlestickStyleOptions } from "../packages/lightweight-charts/v5.0.6-treeshaked/types"
* @import { createChart as CreateClassicChart, LineStyleOptions, DeepPartial, ChartOptions, IChartApi, IHorzScaleBehavior, WhitespaceData, ISeriesApi, Time, LineData, LogicalRange, BaselineStyleOptions, SeriesOptionsCommon, BaselineData, CandlestickStyleOptions } from "../packages/lightweight-charts/v5.0.6-treeshaked/types"
* @import { SignalOptions } from "../packages/solid-signals/v0.3.0-treeshaked/types/core/core"
* @import {Signal, Signals} from "../packages/solid-signals/types";
* @import { getOwner as GetOwner, onCleanup as OnCleanup, Owner } from "../packages/solid-signals/v0.3.0-treeshaked/types/core/owner"
@@ -41,7 +41,10 @@
* "Years" |
* "Locktime" |
* "sat/vB" |
* "vB"
* "constant" |
* "cagr" |
* "vB" |
* "performance"
* } Unit
*/
@@ -686,6 +689,16 @@ function createUtils() {
let unit;
if (id.includes("index") || id.includes("height") || id.includes("epoch")) {
unit = "Index";
} else if (id === "0" || id === "1" || id === "50" || id === "100") {
unit = "constant";
} else if (id.endsWith("cagr")) {
unit = "cagr";
} else if (id.endsWith("returns")) {
unit = "performance";
} else if (id === "drawdown" || id.endsWith("oscillator")) {
unit = "percentage";
} else if (id.endsWith("-as-price")) {
unit = "USD";
} else if (id.includes("type")) {
unit = "Type";
} else if (id.includes("days-")) {
@@ -711,6 +724,8 @@ function createUtils() {
unit = "Cents";
} else if (id.includes("in-usd")) {
unit = "USD";
} else if (id.includes("ratio")) {
unit = "Ratio";
} else if (id.includes("in-btc")) {
unit = "BTC";
} else if (
@@ -720,7 +735,8 @@ function createUtils() {
id.includes("output-value") ||
id.includes("fee") ||
id.includes("coinbase") ||
id.includes("subsidy")
id.includes("subsidy") ||
id.endsWith("stack")
) {
unit = "Sats";
} else if (
@@ -730,7 +746,10 @@ function createUtils() {
id.includes("close") ||
id.includes("ohlc") ||
id.includes("marketcap") ||
id.includes("ath")
id.includes("ath") ||
id.includes("-sma") ||
id.endsWith("-price") ||
id.startsWith("price-")
) {
unit = "USD";
} else if (id.includes("count") || id.match(/v[1-3]/g)) {
@@ -751,8 +770,6 @@ function createUtils() {
unit = "Version";
} else if (id === "value") {
unit = "Sats";
} else if (id === "drawdown") {
unit = "percentage";
} else {
console.log();
throw Error(`Unit not set for "${id}"`);
@@ -1082,7 +1099,13 @@ function createUtils() {
* @param {string} s
*/
function stringToId(s) {
return s.replace(/\W/g, " ").trim().replace(/ +/g, "-").toLowerCase();
return (
s
// .replace(/\W/g, " ")
.trim()
.replace(/ +/g, "-")
.toLowerCase()
);
}
const api = (() => {
@@ -1543,7 +1566,7 @@ function createColors(dark, elements) {
function rose() {
return getColor("rose");
}
function off() {
function gray() {
return getColor("gray");
}
@@ -1565,7 +1588,7 @@ function createColors(dark, elements) {
return {
default: textColor,
off,
gray,
border: borderColor,
lightBitcoin: yellow,
bitcoin: orange,
@@ -1580,6 +1603,7 @@ function createColors(dark, elements) {
red,
sky,
blue,
emerald,
rose,
green,
amber,
@@ -1607,6 +1631,20 @@ function createColors(dark, elements) {
_4y: purple,
_10y: fuchsia,
// r1d: pink,
// r1w: red,
// r1m: amber,
// r3m: yellow,
// r6m: lime,
// r1y: green,
// r2y: emerald,
// r3y: teal,
// r4y: blue,
// r5y: indigo,
// r6y: violet,
// r8y: purple,
// r10y: fuchsia,
p2pk: lime,
p2pkh: violet,
p2sh: emerald,
+617 -23
View File
@@ -16,10 +16,17 @@
* @property {string} title
* @property {boolean} [defaultActive]
*
* @typedef {Object} CreatePriceLine
* @property {number} value
*
* @typedef {Object} CreatePriceLineOptions
* @property {CreatePriceLine} createPriceLine
*
* @typedef {Object} BaselineSeriesBlueprintSpecific
* @property {"Baseline"} type
* @property {Color} [color]
* @property {DeepPartial<BaselineStyleOptions & SeriesOptionsCommon>} [options]
* @property {[Color, Color]} [colors]
* @property {DeepPartial<BaselineStyleOptions & SeriesOptionsCommon & CreatePriceLineOptions>} [options]
* @property {Accessor<BaselineData[]>} [data]
* @typedef {BaseSeriesBlueprint & BaselineSeriesBlueprintSpecific} BaselineSeriesBlueprint
*
@@ -33,13 +40,20 @@
* @typedef {Object} LineSeriesBlueprintSpecific
* @property {"Line"} [type]
* @property {Color} [color]
* @property {DeepPartial<LineStyleOptions & SeriesOptionsCommon>} [options]
* @property {DeepPartial<LineStyleOptions & SeriesOptionsCommon & CreatePriceLineOptions>} [options]
* @property {Accessor<LineData[]>} [data]
* @typedef {BaseSeriesBlueprint & LineSeriesBlueprintSpecific} LineSeriesBlueprint
*
* @typedef {BaselineSeriesBlueprint | CandlestickSeriesBlueprint | LineSeriesBlueprint} AnySeriesBlueprint
*
* @typedef {AnySeriesBlueprint & { key: ChartableVecId }} AnyFetchedSeriesBlueprint
* @typedef {AnySeriesBlueprint["type"]} SeriesType
*
* @typedef {{ key: ChartableVecId }} FetchedAnySeriesOptions
*
* @typedef {BaselineSeriesBlueprint & FetchedAnySeriesOptions} FetchedBaselineSeriesBlueprint
* @typedef {CandlestickSeriesBlueprint & FetchedAnySeriesOptions} FetchedCandlestickSeriesBlueprint
* @typedef {LineSeriesBlueprint & FetchedAnySeriesOptions} FetchedLineSeriesBlueprint
* @typedef {AnySeriesBlueprint & FetchedAnySeriesOptions} AnyFetchedSeriesBlueprint
*
* @typedef {Object} PartialOption
* @property {string} name
@@ -164,14 +178,38 @@ function createPartialOptions(colors) {
* @typedef {WithoutSuffix<VecIdMin, MinSuffix>} VecIdMinBase
*/
const averages = /** @type {const} */ ([
{ name: "1 Week", key: "1w", days: 7 },
{ name: "8 Days", key: "8d", days: 8 },
{ name: "13 Days", key: "13d", days: 13 },
{ name: "21 Days", key: "21d", days: 21 },
{ name: "1 Month", key: "1m", days: 30 },
{ name: "34 Days", key: "34d", days: 34 },
{ name: "55 Days", key: "55d", days: 55 },
{ name: "89 Days", key: "89d", days: 89 },
{ name: "144 Days", key: "144d", days: 144 },
{ name: "1 Year", key: "1y", days: 365 },
{ name: "2 Years", key: "2y", days: 2 * 365 },
{ name: "200 Weeks", key: "200w", days: 200 * 7 },
{ name: "4 Years", key: "4y", days: 4 * 365 },
]);
/**
* @param {Object} args
* @param {ChartableVecId} args.key
* @param {string} args.name
* @param {Color} [args.color]
* @param {boolean} [args.defaultActive]
* @param {DeepPartial<LineStyleOptions & SeriesOptionsCommon>} [args.options]
*/
function createBaseSeries({ key, name, color }) {
return { key, title: name, color };
function createBaseSeries({ key, name, color, defaultActive, options }) {
return /** @satisfies {AnyFetchedSeriesBlueprint} */ ({
key,
title: name,
color,
defaultActive,
options,
});
}
/**
@@ -510,8 +548,216 @@ function createPartialOptions(colors) {
// ],
// },
{
name: "By type",
tree: [],
name: "types",
tree: [
{
name: "p2pk",
title: "Pay To Public Key Outputs",
bottom: [
createBaseSeries({
key: "p2pk33-count",
name: "33B Count",
}),
createBaseSeries({
key: "p2pk33-count-sum",
name: "33B sum",
}),
createBaseSeries({
key: "total-p2pk33-count",
name: "33B total",
}),
createBaseSeries({
key: "p2pk65-count",
name: "65B Count",
}),
createBaseSeries({
key: "p2pk65-count-sum",
name: "65B sum",
}),
createBaseSeries({
key: "total-p2pk65-count",
name: "65B total",
}),
],
},
{
name: "p2pkh",
title: "Pay To Public Key Hash Outputs",
bottom: [
createBaseSeries({
key: "p2pkh-count",
name: "Count",
}),
createBaseSeries({
key: "p2pkh-count-sum",
name: "sum",
}),
createBaseSeries({
key: "total-p2pkh-count",
name: "total",
}),
],
},
{
name: "p2ms",
title: "Pay To Multisig Outputs",
bottom: [
createBaseSeries({
key: "p2ms-count",
name: "Count",
}),
createBaseSeries({
key: "p2ms-count-sum",
name: "sum",
}),
createBaseSeries({
key: "total-p2ms-count",
name: "total",
}),
],
},
{
name: "p2sh",
title: "Pay To Script Hash Outputs",
bottom: [
createBaseSeries({
key: "p2sh-count",
name: "Count",
}),
createBaseSeries({
key: "p2sh-count-sum",
name: "sum",
}),
createBaseSeries({
key: "total-p2sh-count",
name: "total",
}),
],
},
{
name: "op_return",
title: "op_return outputs",
bottom: [
createBaseSeries({ key: "opreturn-count", name: "Count" }),
createBaseSeries({
key: "opreturn-count-sum",
name: "sum",
}),
createBaseSeries({
key: "total-opreturn-count",
name: "total",
}),
],
},
{
name: "p2wpkh",
title: "Pay To Witness Public Key Hash Outputs",
bottom: [
createBaseSeries({
key: "p2wpkh-count",
name: "Count",
}),
createBaseSeries({
key: "p2wpkh-count-sum",
name: "sum",
}),
createBaseSeries({
key: "total-p2wpkh-count",
name: "total",
}),
],
},
{
name: "p2wsh",
title: "Pay To Witness Script Hash Outputs",
bottom: [
createBaseSeries({
key: "p2wsh-count",
name: "Count",
}),
createBaseSeries({
key: "p2wsh-count-sum",
name: "sum",
}),
createBaseSeries({
key: "total-p2wsh-count",
name: "total",
}),
],
},
{
name: "p2tr",
title: "Pay To Taproot Outputs",
bottom: [
createBaseSeries({
key: "p2tr-count",
name: "Count",
}),
createBaseSeries({
key: "p2tr-count-sum",
name: "sum",
}),
createBaseSeries({
key: "total-p2tr-count",
name: "total",
}),
],
},
{
name: "p2a",
title: "Pay To Anchor outputs",
bottom: [
createBaseSeries({
key: "p2a-count",
name: "Count",
}),
createBaseSeries({
key: "p2a-count-sum",
name: "sum",
}),
createBaseSeries({
key: "total-p2a-count",
name: "total",
}),
],
},
{
name: "empty",
title: "empty outputs",
bottom: [
createBaseSeries({
key: "emptyoutput-count",
name: "Count",
}),
createBaseSeries({
key: "emptyoutput-count-sum",
name: "sum",
}),
createBaseSeries({
key: "total-emptyoutput-count",
name: "total",
}),
],
},
{
name: "unknown",
title: "unknown outputs",
bottom: [
createBaseSeries({
key: "unknownoutput-count",
name: "Count",
}),
createBaseSeries({
key: "unknownoutput-count-sum",
name: "sum",
}),
createBaseSeries({
key: "total-unknownoutput-count",
name: "total",
}),
],
},
],
// title: "Transaction Output Value",
// bottom: [
// createAverageSeries({ concat: "output-value" }),
@@ -646,6 +892,370 @@ function createPartialOptions(colors) {
},
],
},
{
name: "Average",
tree: [
{
name: "Compare",
title: "Moving Averages",
top: averages.map(({ days, key, name }) =>
createBaseSeries({
key: `${key}-sma`,
name: key,
color: colors[`_${key}`],
}),
),
},
...averages.map(({ key, name }) => ({
name,
title: `${name} Market Price Moving Average`,
top: [
createBaseSeries({
key: `${key}-sma`,
name: "Average",
color: colors[`_${key}`],
}),
createBaseSeries({
key: `${key}-sma-ratio-p1sd-as-price`,
name: "+1σ",
color: colors.orange,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p2sd-as-price`,
name: "+2σ",
color: colors.red,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p3sd-as-price`,
name: "+3σ",
color: colors.pink,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-m1sd-as-price`,
name: "1σ",
color: colors.cyan,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-m2sd-as-price`,
name: "2σ",
color: colors.blue,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-m3sd-as-price`,
name: "3σ",
color: colors.violet,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p99-as-price`,
name: "p99",
color: colors.orange,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p99-5-as-price`,
name: "p99.5",
color: colors.red,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p99-9-as-price`,
name: "p99.9",
color: colors.pink,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p1-as-price`,
name: "p1",
color: colors.cyan,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p0-5-as-price`,
name: "p0.5",
color: colors.blue,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p0-1-as-price`,
name: "p0.1",
color: colors.violet,
defaultActive: false,
}),
],
bottom: [
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
key: `${key}-sma-ratio`,
title: "Ratio",
type: "Baseline",
options: {
baseValue: { price: 1 },
createPriceLine: {
value: 1,
},
},
}),
createBaseSeries({
key: `${key}-sma-ratio-sma`,
name: "sma",
color: colors.yellow,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p1sd`,
name: "+1σ",
color: colors.orange,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p2sd`,
name: "+2σ",
color: colors.red,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p3sd`,
name: "+3σ",
color: colors.pink,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-m1sd`,
name: "1σ",
color: colors.cyan,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-m2sd`,
name: "2σ",
color: colors.blue,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-m3sd`,
name: "3σ",
color: colors.violet,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p99`,
name: "p99",
color: colors.orange,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p99-5`,
name: "p99.5",
color: colors.red,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p99-9`,
name: "p99.9",
color: colors.pink,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p1`,
name: "p1",
color: colors.cyan,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p0-5`,
name: "p0.5",
color: colors.blue,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-p0-1`,
name: "p0.1",
color: colors.violet,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-1w-sma`,
name: "1w sma",
color: colors.fuchsia,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-1m-sma`,
name: "1m sma",
color: colors.pink,
defaultActive: false,
}),
createBaseSeries({
key: `${key}-sma-ratio-1y-sma`,
name: "1y sma",
color: colors.rose,
defaultActive: false,
}),
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
key: `${key}-sma-ratio-1y-sma-momentum-oscillator`,
title: "1Y Momentum",
type: "Baseline",
options: {
createPriceLine: {
value: 0,
},
},
}),
],
})),
],
},
{
name: "Returns",
tree: [
{
name: "1 Day",
title: `1 Day Returns`,
top: [
createBaseSeries({
key: `price-1d-ago`,
name: `Price 1d ago`,
}),
],
bottom: [
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
key: `1d-returns`,
title: "1d",
type: "Baseline",
options: {
createPriceLine: {
value: 0,
},
},
}),
],
},
.../** @type {const} */ ([
{ name: "1 Week", key: "1w" },
{ name: "1 Month", key: "1m" },
{ name: "3 Months", key: "3m" },
{ name: "6 Months", key: "6m" },
{ name: "1 Year", key: "1y" },
]).map(
({ name, key }) =>
/** @satisfies {PartialChartOption} */ ({
name,
title: `${name} Returns`,
top: [
createBaseSeries({
key: `price-${key}-ago`,
name: `lump sum`,
color: colors.cyan,
}),
createBaseSeries({
key: `${key}-dca-avg-price`,
name: `dca`,
color: colors.orange,
}),
],
bottom: [
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
key: `${key}-returns`,
title: "lump sum",
type: "Baseline",
options: {
createPriceLine: {
value: 0,
},
},
}),
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
key: `${key}-dca-returns`,
title: "dca",
type: "Baseline",
colors: [colors.yellow, colors.pink],
options: {
createPriceLine: {
value: 0,
},
},
}),
],
}),
),
.../** @type {const} */ ([
{ name: "2 Year", key: "2y" },
{ name: "3 Year", key: "3y" },
{ name: "4 Year", key: "4y" },
{ name: "5 Year", key: "5y" },
{ name: "6 Year", key: "6y" },
{ name: "8 Year", key: "8y" },
{ name: "10 Year", key: "10y" },
]).map(
({ name, key }) =>
/** @satisfies {PartialChartOption} */ ({
name,
title: `${name} Returns`,
top: [
createBaseSeries({
key: `price-${key}-ago`,
name: `lump sum price`,
color: colors.cyan,
}),
createBaseSeries({
key: `${key}-dca-avg-price`,
name: `dca avg. price`,
color: colors.orange,
}),
],
bottom: [
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
key: `${key}-returns`,
title: "lump sum",
type: "Baseline",
options: {
createPriceLine: {
value: 0,
},
},
}),
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
key: `${key}-cagr`,
title: "lump sum",
type: "Baseline",
options: {
createPriceLine: {
value: 0,
},
},
}),
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
key: `${key}-dca-returns`,
title: "dca",
type: "Baseline",
colors: [colors.yellow, colors.pink],
options: {
createPriceLine: {
value: 0,
},
},
}),
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
key: `${key}-dca-cagr`,
title: "dca",
type: "Baseline",
colors: [colors.yellow, colors.pink],
options: {
createPriceLine: {
value: 0,
},
},
}),
],
}),
),
],
},
],
},
],
@@ -1485,22 +2095,6 @@ export function initOptions({
// },
// ]);
// const averages = /** @type {const} */ ([
// { name: "1 Week", key: "1w", days: 7 },
// { name: "8 Days", key: "8d", days: 8 },
// { name: "13 Days", key: "13d", days: 13 },
// { name: "21 Days", key: "21d", days: 21 },
// { name: "1 Month", key: "1m", days: 30 },
// { name: "34 Days", key: "34d", days: 34 },
// { name: "55 Days", key: "55d", days: 55 },
// { name: "89 Days", key: "89d", days: 89 },
// { name: "144 Days", key: "144d", days: 144 },
// { name: "1 Year", key: "1y", days: 365 },
// { name: "2 Years", key: "2y", days: 2 * 365 },
// { name: "200 Weeks", key: "200w", days: 200 * 7 },
// { name: "4 Years", key: "4y", days: 4 * 365 },
// ]);
// const totalReturns = /** @type {const} */ ([
// { name: "1 Day", key: "1d" },
// { name: "1 Month", key: "1m" },
+1 -1
View File
@@ -832,7 +832,7 @@ export function init({
owner,
config: [
{
unit: "%",
unit: "percentage",
blueprints: [
{
title: "Profitable Days Ratio",
+554 -58
View File
@@ -56,7 +56,490 @@ export function createVecIdToIndexes() {
const YearIndex = /** @satisfies {YearIndex} */ (23);
return /** @type {const} */ ({
ath: [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"0": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"100": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"10y-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"10y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"10y-dca-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"10y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"10y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"10y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"13d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"144d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1d-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1m-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1w-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"1y-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"200w-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"21d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-dca-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"2y-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"34d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"3m-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"3m-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"3m-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"3m-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"3y-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"3y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"3y-dca-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"3y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"3y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"3y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-dca-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"4y-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"50": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"55d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"5y-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"5y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"5y-dca-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"5y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"5y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"5y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"6m-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"6m-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"6m-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"6m-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"6y-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"6y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"6y-dca-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"6y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"6y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"6y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"89d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8y-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8y-dca-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"8y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"ath": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"base-size": [TxIndex],
"block-count": [Height],
"block-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
@@ -71,11 +554,11 @@ export function createVecIdToIndexes() {
"block-size-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"block-vbytes-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"block-weight-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
blockhash: [Height],
close: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"blockhash": [Height],
"close": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"close-in-cents": [DateIndex, Height],
"close-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
coinbase: [Height],
"coinbase": [Height],
"coinbase-10p": [DateIndex],
"coinbase-25p": [DateIndex],
"coinbase-75p": [DateIndex],
@@ -105,15 +588,15 @@ export function createVecIdToIndexes() {
"coinbase-median": [DateIndex],
"coinbase-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"coinbase-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
date: [DateIndex, Height],
"date": [DateIndex, Height],
"date-fixed": [Height],
dateindex: [DateIndex, Height],
"dateindex": [DateIndex, Height],
"dateindex-count": [MonthIndex, WeekIndex],
"days-since-ath": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
decadeindex: [DecadeIndex, YearIndex],
difficulty: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
difficultyepoch: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
drawdown: [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"decadeindex": [DecadeIndex, YearIndex],
"difficulty": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"difficultyepoch": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"drawdown": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"emptyoutput-count": [Height],
"emptyoutput-count-10p": [DateIndex],
"emptyoutput-count-25p": [DateIndex],
@@ -124,8 +607,8 @@ export function createVecIdToIndexes() {
"emptyoutput-count-median": [DateIndex],
"emptyoutput-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"emptyoutput-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
emptyoutputindex: [EmptyOutputIndex],
fee: [TxIndex],
"emptyoutputindex": [EmptyOutputIndex],
"fee": [TxIndex],
"fee-10p": [Height],
"fee-25p": [Height],
"fee-75p": [Height],
@@ -153,7 +636,7 @@ export function createVecIdToIndexes() {
"fee-median": [Height],
"fee-min": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"fee-sum": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
feerate: [TxIndex],
"feerate": [TxIndex],
"feerate-10p": [Height],
"feerate-25p": [Height],
"feerate-75p": [Height],
@@ -181,10 +664,10 @@ export function createVecIdToIndexes() {
"first-txindex": [Height],
"first-unknownoutputindex": [Height],
"first-yearindex": [DecadeIndex],
halvingepoch: [DateIndex, DecadeIndex, HalvingEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
height: [Height, TxIndex],
"halvingepoch": [DateIndex, DecadeIndex, HalvingEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"height": [Height, TxIndex],
"height-count": [DateIndex, DifficultyEpoch],
high: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"high": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"high-in-cents": [DateIndex, Height],
"high-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"input-count": [TxIndex],
@@ -198,22 +681,22 @@ export function createVecIdToIndexes() {
"input-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"input-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"input-value": [TxIndex],
inputindex: [InputIndex],
interval: [Height],
"inputindex": [InputIndex],
"interval": [Height],
"is-coinbase": [TxIndex],
"is-explicitly-rbf": [TxIndex],
low: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"low": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"low-in-cents": [DateIndex, Height],
"low-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
marketcap: [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"marketcap": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"max-days-between-ath": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"max-years-between-ath": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
monthindex: [DateIndex, MonthIndex],
"monthindex": [DateIndex, MonthIndex],
"monthindex-count": [QuarterIndex, YearIndex],
ohlc: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"ohlc": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"ohlc-in-cents": [DateIndex, Height],
"ohlc-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
open: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"open": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"open-in-cents": [DateIndex, Height],
"open-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"opreturn-count": [Height],
@@ -226,7 +709,7 @@ export function createVecIdToIndexes() {
"opreturn-count-median": [DateIndex],
"opreturn-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"opreturn-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
opreturnindex: [OpReturnIndex],
"opreturnindex": [OpReturnIndex],
"output-count": [TxIndex],
"output-count-10p": [Height],
"output-count-25p": [Height],
@@ -238,9 +721,9 @@ export function createVecIdToIndexes() {
"output-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"output-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"output-value": [TxIndex],
outputindex: [InputIndex, OutputIndex],
outputtype: [OutputIndex],
outputtypeindex: [OutputIndex],
"outputindex": [InputIndex, OutputIndex],
"outputtype": [OutputIndex],
"outputtypeindex": [OutputIndex],
"p2a-count": [Height],
"p2a-count-10p": [DateIndex],
"p2a-count-25p": [DateIndex],
@@ -251,8 +734,8 @@ export function createVecIdToIndexes() {
"p2a-count-median": [DateIndex],
"p2a-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"p2a-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
p2abytes: [P2AIndex],
p2aindex: [P2AIndex],
"p2abytes": [P2AIndex],
"p2aindex": [P2AIndex],
"p2ms-count": [Height],
"p2ms-count-10p": [DateIndex],
"p2ms-count-25p": [DateIndex],
@@ -263,7 +746,7 @@ export function createVecIdToIndexes() {
"p2ms-count-median": [DateIndex],
"p2ms-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"p2ms-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
p2msindex: [P2MSIndex],
"p2msindex": [P2MSIndex],
"p2pk33-count": [Height],
"p2pk33-count-10p": [DateIndex],
"p2pk33-count-25p": [DateIndex],
@@ -274,8 +757,8 @@ export function createVecIdToIndexes() {
"p2pk33-count-median": [DateIndex],
"p2pk33-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"p2pk33-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
p2pk33bytes: [P2PK33Index],
p2pk33index: [P2PK33Index],
"p2pk33bytes": [P2PK33Index],
"p2pk33index": [P2PK33Index],
"p2pk65-count": [Height],
"p2pk65-count-10p": [DateIndex],
"p2pk65-count-25p": [DateIndex],
@@ -286,8 +769,8 @@ export function createVecIdToIndexes() {
"p2pk65-count-median": [DateIndex],
"p2pk65-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"p2pk65-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
p2pk65bytes: [P2PK65Index],
p2pk65index: [P2PK65Index],
"p2pk65bytes": [P2PK65Index],
"p2pk65index": [P2PK65Index],
"p2pkh-count": [Height],
"p2pkh-count-10p": [DateIndex],
"p2pkh-count-25p": [DateIndex],
@@ -298,8 +781,8 @@ export function createVecIdToIndexes() {
"p2pkh-count-median": [DateIndex],
"p2pkh-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"p2pkh-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
p2pkhbytes: [P2PKHIndex],
p2pkhindex: [P2PKHIndex],
"p2pkhbytes": [P2PKHIndex],
"p2pkhindex": [P2PKHIndex],
"p2sh-count": [Height],
"p2sh-count-10p": [DateIndex],
"p2sh-count-25p": [DateIndex],
@@ -310,8 +793,8 @@ export function createVecIdToIndexes() {
"p2sh-count-median": [DateIndex],
"p2sh-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"p2sh-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
p2shbytes: [P2SHIndex],
p2shindex: [P2SHIndex],
"p2shbytes": [P2SHIndex],
"p2shindex": [P2SHIndex],
"p2tr-count": [Height],
"p2tr-count-10p": [DateIndex],
"p2tr-count-25p": [DateIndex],
@@ -322,8 +805,8 @@ export function createVecIdToIndexes() {
"p2tr-count-median": [DateIndex],
"p2tr-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"p2tr-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
p2trbytes: [P2TRIndex],
p2trindex: [P2TRIndex],
"p2trbytes": [P2TRIndex],
"p2trindex": [P2TRIndex],
"p2wpkh-count": [Height],
"p2wpkh-count-10p": [DateIndex],
"p2wpkh-count-25p": [DateIndex],
@@ -334,8 +817,8 @@ export function createVecIdToIndexes() {
"p2wpkh-count-median": [DateIndex],
"p2wpkh-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"p2wpkh-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
p2wpkhbytes: [P2WPKHIndex],
p2wpkhindex: [P2WPKHIndex],
"p2wpkhbytes": [P2WPKHIndex],
"p2wpkhindex": [P2WPKHIndex],
"p2wsh-count": [Height],
"p2wsh-count-10p": [DateIndex],
"p2wsh-count-25p": [DateIndex],
@@ -346,11 +829,24 @@ export function createVecIdToIndexes() {
"p2wsh-count-median": [DateIndex],
"p2wsh-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"p2wsh-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
p2wshbytes: [P2WSHIndex],
p2wshindex: [P2WSHIndex],
quarterindex: [MonthIndex, QuarterIndex],
rawlocktime: [TxIndex],
subsidy: [Height],
"p2wshbytes": [P2WSHIndex],
"p2wshindex": [P2WSHIndex],
"price-10y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"price-1d-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"price-1m-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"price-1w-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"price-1y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"price-2y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"price-3m-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"price-3y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"price-4y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"price-5y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"price-6m-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"price-6y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"price-8y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"quarterindex": [MonthIndex, QuarterIndex],
"rawlocktime": [TxIndex],
"subsidy": [Height],
"subsidy-10p": [DateIndex],
"subsidy-25p": [DateIndex],
"subsidy-75p": [DateIndex],
@@ -380,7 +876,7 @@ export function createVecIdToIndexes() {
"subsidy-median": [DateIndex],
"subsidy-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"subsidy-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
timestamp: [DateIndex, DecadeIndex, DifficultyEpoch, HalvingEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"timestamp": [DateIndex, DecadeIndex, DifficultyEpoch, HalvingEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"timestamp-fixed": [Height],
"total-block-count": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"total-block-size": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
@@ -446,10 +942,10 @@ export function createVecIdToIndexes() {
"tx-weight-max": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"tx-weight-median": [Height],
"tx-weight-min": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
txid: [TxIndex],
txindex: [EmptyOutputIndex, OpReturnIndex, P2MSIndex, TxIndex, UnknownOutputIndex],
"txid": [TxIndex],
"txindex": [EmptyOutputIndex, OpReturnIndex, P2MSIndex, TxIndex, UnknownOutputIndex],
"txindex-count": [Height],
txversion: [TxIndex],
"txversion": [TxIndex],
"unknownoutput-count": [Height],
"unknownoutput-count-10p": [DateIndex],
"unknownoutput-count-25p": [DateIndex],
@@ -460,13 +956,13 @@ export function createVecIdToIndexes() {
"unknownoutput-count-median": [DateIndex],
"unknownoutput-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
"unknownoutput-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
unknownoutputindex: [UnknownOutputIndex],
value: [InputIndex, OutputIndex],
vbytes: [Height],
vsize: [TxIndex],
weekindex: [DateIndex, WeekIndex],
weight: [Height, TxIndex],
yearindex: [MonthIndex, YearIndex],
"unknownoutputindex": [UnknownOutputIndex],
"value": [InputIndex, OutputIndex],
"vbytes": [Height],
"vsize": [TxIndex],
"weekindex": [DateIndex, WeekIndex],
"weight": [Height, TxIndex],
"yearindex": [MonthIndex, YearIndex],
"yearindex-count": [DecadeIndex],
});
}