mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-02 14:59:00 -07:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 18fb2e7d4d | |||
| a610fd53e2 | |||
| 16abce1f2d | |||
| f3b42f34a6 | |||
| 6483d324de | |||
| 5ab97050dd |
@@ -64,7 +64,7 @@ jobs:
|
|||||||
# we specify bash to get pipefail; it guards against the `curl` command
|
# we specify bash to get pipefail; it guards against the `curl` command
|
||||||
# failing. otherwise `sh` won't catch that `curl` returned non-0
|
# failing. otherwise `sh` won't catch that `curl` returned non-0
|
||||||
shell: bash
|
shell: bash
|
||||||
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.29.0/cargo-dist-installer.sh | sh"
|
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.30.0/cargo-dist-installer.sh | sh"
|
||||||
- name: Cache dist
|
- name: Cache dist
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
Generated
+41
-41
@@ -498,7 +498,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk"
|
name = "brk"
|
||||||
version = "0.0.103"
|
version = "0.0.106"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brk_bundler",
|
"brk_bundler",
|
||||||
"brk_cli",
|
"brk_cli",
|
||||||
@@ -517,7 +517,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_bundler"
|
name = "brk_bundler"
|
||||||
version = "0.0.103"
|
version = "0.0.106"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brk_rolldown",
|
"brk_rolldown",
|
||||||
"log",
|
"log",
|
||||||
@@ -528,7 +528,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_cli"
|
name = "brk_cli"
|
||||||
version = "0.0.103"
|
version = "0.0.106"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitcoincore-rpc",
|
"bitcoincore-rpc",
|
||||||
"brk_bundler",
|
"brk_bundler",
|
||||||
@@ -553,7 +553,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_computer"
|
name = "brk_computer"
|
||||||
version = "0.0.103"
|
version = "0.0.106"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"allocative",
|
"allocative",
|
||||||
"allocative_derive",
|
"allocative_derive",
|
||||||
@@ -582,7 +582,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_error"
|
name = "brk_error"
|
||||||
version = "0.0.103"
|
version = "0.0.106"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitcoincore-rpc",
|
"bitcoincore-rpc",
|
||||||
"fjall",
|
"fjall",
|
||||||
@@ -595,7 +595,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_fetcher"
|
name = "brk_fetcher"
|
||||||
version = "0.0.103"
|
version = "0.0.106"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brk_error",
|
"brk_error",
|
||||||
"brk_logger",
|
"brk_logger",
|
||||||
@@ -607,7 +607,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_indexer"
|
name = "brk_indexer"
|
||||||
version = "0.0.103"
|
version = "0.0.106"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitcoin",
|
"bitcoin",
|
||||||
"bitcoincore-rpc",
|
"bitcoincore-rpc",
|
||||||
@@ -624,7 +624,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_interface"
|
name = "brk_interface"
|
||||||
version = "0.0.103"
|
version = "0.0.106"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brk_computer",
|
"brk_computer",
|
||||||
"brk_error",
|
"brk_error",
|
||||||
@@ -643,7 +643,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_logger"
|
name = "brk_logger"
|
||||||
version = "0.0.103"
|
version = "0.0.106"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"env_logger",
|
"env_logger",
|
||||||
"jiff",
|
"jiff",
|
||||||
@@ -653,7 +653,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_mcp"
|
name = "brk_mcp"
|
||||||
version = "0.0.103"
|
version = "0.0.106"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum",
|
"axum",
|
||||||
"brk_interface",
|
"brk_interface",
|
||||||
@@ -663,7 +663,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_parser"
|
name = "brk_parser"
|
||||||
version = "0.0.103"
|
version = "0.0.106"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitcoin",
|
"bitcoin",
|
||||||
"bitcoincore-rpc",
|
"bitcoincore-rpc",
|
||||||
@@ -750,7 +750,7 @@ dependencies = [
|
|||||||
"css-module-lexer",
|
"css-module-lexer",
|
||||||
"dunce",
|
"dunce",
|
||||||
"futures",
|
"futures",
|
||||||
"indexmap 2.11.0",
|
"indexmap 2.11.1",
|
||||||
"itertools",
|
"itertools",
|
||||||
"itoa",
|
"itoa",
|
||||||
"memchr",
|
"memchr",
|
||||||
@@ -1020,7 +1020,7 @@ dependencies = [
|
|||||||
"fast-glob",
|
"fast-glob",
|
||||||
"form_urlencoded",
|
"form_urlencoded",
|
||||||
"futures",
|
"futures",
|
||||||
"indexmap 2.11.0",
|
"indexmap 2.11.1",
|
||||||
"infer",
|
"infer",
|
||||||
"itoa",
|
"itoa",
|
||||||
"memchr",
|
"memchr",
|
||||||
@@ -1054,7 +1054,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_server"
|
name = "brk_server"
|
||||||
version = "0.0.103"
|
version = "0.0.106"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum",
|
"axum",
|
||||||
"bitcoincore-rpc",
|
"bitcoincore-rpc",
|
||||||
@@ -1078,7 +1078,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_store"
|
name = "brk_store"
|
||||||
version = "0.0.103"
|
version = "0.0.106"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brk_error",
|
"brk_error",
|
||||||
"brk_structs",
|
"brk_structs",
|
||||||
@@ -1101,7 +1101,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_structs"
|
name = "brk_structs"
|
||||||
version = "0.0.103"
|
version = "0.0.106"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"allocative",
|
"allocative",
|
||||||
"allocative_derive",
|
"allocative_derive",
|
||||||
@@ -1772,12 +1772,12 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "errno"
|
name = "errno"
|
||||||
version = "0.3.13"
|
version = "0.3.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad"
|
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"windows-sys 0.60.2",
|
"windows-sys 0.61.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2349,9 +2349,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "indexmap"
|
name = "indexmap"
|
||||||
version = "2.11.0"
|
version = "2.11.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9"
|
checksum = "206a8042aec68fa4a62e8d3f7aa4ceb508177d9324faf261e1959e495b7a1921"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"equivalent",
|
"equivalent",
|
||||||
"hashbrown 0.15.5",
|
"hashbrown 0.15.5",
|
||||||
@@ -2379,7 +2379,7 @@ dependencies = [
|
|||||||
"crossbeam-utils",
|
"crossbeam-utils",
|
||||||
"dashmap",
|
"dashmap",
|
||||||
"env_logger",
|
"env_logger",
|
||||||
"indexmap 2.11.0",
|
"indexmap 2.11.1",
|
||||||
"itoa",
|
"itoa",
|
||||||
"log",
|
"log",
|
||||||
"num-format",
|
"num-format",
|
||||||
@@ -2595,9 +2595,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linux-raw-sys"
|
name = "linux-raw-sys"
|
||||||
version = "0.9.4"
|
version = "0.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12"
|
checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "litemap"
|
name = "litemap"
|
||||||
@@ -3218,7 +3218,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "0784392356fa78dd4c9047fce7c9046c141f8990736792d00310bf40935b1870"
|
checksum = "0784392356fa78dd4c9047fce7c9046c141f8990736792d00310bf40935b1870"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"indexmap 2.11.0",
|
"indexmap 2.11.1",
|
||||||
"json-strip-comments",
|
"json-strip-comments",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"papaya",
|
"papaya",
|
||||||
@@ -3311,7 +3311,7 @@ dependencies = [
|
|||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"compact_str",
|
"compact_str",
|
||||||
"cow-utils",
|
"cow-utils",
|
||||||
"indexmap 2.11.0",
|
"indexmap 2.11.1",
|
||||||
"itoa",
|
"itoa",
|
||||||
"memchr",
|
"memchr",
|
||||||
"oxc-browserslist",
|
"oxc-browserslist",
|
||||||
@@ -3504,7 +3504,7 @@ checksum = "54acf3a685220b533e437e264e4d932cfbdc4cc7ec0cd232ed73c08d03b8a7ca"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"fixedbitset",
|
"fixedbitset",
|
||||||
"hashbrown 0.15.5",
|
"hashbrown 0.15.5",
|
||||||
"indexmap 2.11.0",
|
"indexmap 2.11.1",
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -3965,15 +3965,15 @@ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustix"
|
name = "rustix"
|
||||||
version = "1.0.8"
|
version = "1.1.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8"
|
checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.9.4",
|
"bitflags 2.9.4",
|
||||||
"errno",
|
"errno",
|
||||||
"libc",
|
"libc",
|
||||||
"linux-raw-sys",
|
"linux-raw-sys",
|
||||||
"windows-sys 0.60.2",
|
"windows-sys 0.61.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -4118,9 +4118,9 @@ checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "seqdb"
|
name = "seqdb"
|
||||||
version = "0.2.11"
|
version = "0.2.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3078349d3b0b862848f518737b1228fdbaa725819688036db54363aa6c960ead"
|
checksum = "c97f1528725c4bb77e7f804440e353ef2c55dd73dceffc0ef856873b01a5216b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"allocative",
|
"allocative",
|
||||||
"allocative_derive",
|
"allocative_derive",
|
||||||
@@ -4179,7 +4179,7 @@ version = "1.0.143"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a"
|
checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap 2.11.0",
|
"indexmap 2.11.1",
|
||||||
"itoa",
|
"itoa",
|
||||||
"memchr",
|
"memchr",
|
||||||
"ryu",
|
"ryu",
|
||||||
@@ -4227,7 +4227,7 @@ dependencies = [
|
|||||||
"chrono",
|
"chrono",
|
||||||
"hex",
|
"hex",
|
||||||
"indexmap 1.9.3",
|
"indexmap 1.9.3",
|
||||||
"indexmap 2.11.0",
|
"indexmap 2.11.1",
|
||||||
"schemars 0.9.0",
|
"schemars 0.9.0",
|
||||||
"schemars 1.0.4",
|
"schemars 1.0.4",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -4629,7 +4629,7 @@ version = "0.9.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "75129e1dc5000bfbaa9fee9d1b21f974f9fbad9daec557a521ee6e080825f6e8"
|
checksum = "75129e1dc5000bfbaa9fee9d1b21f974f9fbad9daec557a521ee6e080825f6e8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap 2.11.0",
|
"indexmap 2.11.1",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_spanned",
|
"serde_spanned",
|
||||||
"toml_datetime 0.7.0",
|
"toml_datetime 0.7.0",
|
||||||
@@ -4659,7 +4659,7 @@ version = "0.22.27"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
|
checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap 2.11.0",
|
"indexmap 2.11.1",
|
||||||
"toml_datetime 0.6.11",
|
"toml_datetime 0.6.11",
|
||||||
"winnow",
|
"winnow",
|
||||||
]
|
]
|
||||||
@@ -4976,9 +4976,9 @@ checksum = "8f54a172d0620933a27a4360d3db3e2ae0dd6cceae9730751a036bbf182c4b23"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vecdb"
|
name = "vecdb"
|
||||||
version = "0.2.11"
|
version = "0.2.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9f3b3745eeee3b56f0db302a3ccaa2b400b5c881adf7319afde753b2fed83aae"
|
checksum = "f0f9d0664d3ddb92e67ecc155b748ba16bb2d0c04a92276a33be6eac1a38d533"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"allocative",
|
"allocative",
|
||||||
"allocative_derive",
|
"allocative_derive",
|
||||||
@@ -4998,9 +4998,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vecdb_derive"
|
name = "vecdb_derive"
|
||||||
version = "0.2.11"
|
version = "0.2.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cb14e5900ae8ba26112c438311b274de59e566a180d7795a584a83e3faa5cb9f"
|
checksum = "d263723d1fbfeed0a279d8983e6b7f58ece72a6fa2bf4772d630b72d1ba2b298"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.106",
|
"syn 2.0.106",
|
||||||
@@ -5524,7 +5524,7 @@ dependencies = [
|
|||||||
"arbitrary",
|
"arbitrary",
|
||||||
"crc32fast",
|
"crc32fast",
|
||||||
"flate2",
|
"flate2",
|
||||||
"indexmap 2.11.0",
|
"indexmap 2.11.1",
|
||||||
"memchr",
|
"memchr",
|
||||||
"zopfli",
|
"zopfli",
|
||||||
]
|
]
|
||||||
|
|||||||
+15
-15
@@ -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.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.license = "MIT"
|
||||||
package.edition = "2024"
|
package.edition = "2024"
|
||||||
package.version = "0.0.103"
|
package.version = "0.0.106"
|
||||||
package.homepage = "https://bitcoinresearchkit.org"
|
package.homepage = "https://bitcoinresearchkit.org"
|
||||||
package.repository = "https://github.com/bitcoinresearchkit/brk"
|
package.repository = "https://github.com/bitcoinresearchkit/brk"
|
||||||
package.readme = "README.md"
|
package.readme = "README.md"
|
||||||
@@ -28,19 +28,19 @@ allocative_derive = "0.3.3"
|
|||||||
axum = "0.8.4"
|
axum = "0.8.4"
|
||||||
bitcoin = { version = "0.32.7", features = ["serde"] }
|
bitcoin = { version = "0.32.7", features = ["serde"] }
|
||||||
bitcoincore-rpc = "0.19.0"
|
bitcoincore-rpc = "0.19.0"
|
||||||
brk_bundler = { version = "0.0.103", path = "crates/brk_bundler" }
|
brk_bundler = { version = "0.0.106", path = "crates/brk_bundler" }
|
||||||
brk_cli = { version = "0.0.103", path = "crates/brk_cli" }
|
brk_cli = { version = "0.0.106", path = "crates/brk_cli" }
|
||||||
brk_computer = { version = "0.0.103", path = "crates/brk_computer" }
|
brk_computer = { version = "0.0.106", path = "crates/brk_computer" }
|
||||||
brk_error = { version = "0.0.103", path = "crates/brk_error" }
|
brk_error = { version = "0.0.106", path = "crates/brk_error" }
|
||||||
brk_fetcher = { version = "0.0.103", path = "crates/brk_fetcher" }
|
brk_fetcher = { version = "0.0.106", path = "crates/brk_fetcher" }
|
||||||
brk_indexer = { version = "0.0.103", path = "crates/brk_indexer" }
|
brk_indexer = { version = "0.0.106", path = "crates/brk_indexer" }
|
||||||
brk_interface = { version = "0.0.103", path = "crates/brk_interface" }
|
brk_interface = { version = "0.0.106", path = "crates/brk_interface" }
|
||||||
brk_logger = { version = "0.0.103", path = "crates/brk_logger" }
|
brk_logger = { version = "0.0.106", path = "crates/brk_logger" }
|
||||||
brk_mcp = { version = "0.0.103", path = "crates/brk_mcp" }
|
brk_mcp = { version = "0.0.106", path = "crates/brk_mcp" }
|
||||||
brk_parser = { version = "0.0.103", path = "crates/brk_parser" }
|
brk_parser = { version = "0.0.106", path = "crates/brk_parser" }
|
||||||
brk_server = { version = "0.0.103", path = "crates/brk_server" }
|
brk_server = { version = "0.0.106", path = "crates/brk_server" }
|
||||||
brk_store = { version = "0.0.103", path = "crates/brk_store" }
|
brk_store = { version = "0.0.106", path = "crates/brk_store" }
|
||||||
brk_structs = { version = "0.0.103", path = "crates/brk_structs" }
|
brk_structs = { version = "0.0.106", path = "crates/brk_structs" }
|
||||||
byteview = "=0.6.1"
|
byteview = "=0.6.1"
|
||||||
derive_deref = "1.1.1"
|
derive_deref = "1.1.1"
|
||||||
fjall = "2.11.2"
|
fjall = "2.11.2"
|
||||||
@@ -56,7 +56,7 @@ serde_derive = "1.0.219"
|
|||||||
serde_json = { version = "1.0.143", features = ["float_roundtrip"] }
|
serde_json = { version = "1.0.143", features = ["float_roundtrip"] }
|
||||||
tokio = { version = "1.47.1", features = ["rt-multi-thread"] }
|
tokio = { version = "1.47.1", features = ["rt-multi-thread"] }
|
||||||
# vecdb = { path = "../seqdb/crates/vecdb", features = ["derive"]}
|
# vecdb = { path = "../seqdb/crates/vecdb", features = ["derive"]}
|
||||||
vecdb = { version = "0.2.11", features = ["derive"]}
|
vecdb = { version = "0.2.12", features = ["derive"]}
|
||||||
zerocopy = "0.8.27"
|
zerocopy = "0.8.27"
|
||||||
zerocopy-derive = "0.8.27"
|
zerocopy-derive = "0.8.27"
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use std::path::Path;
|
|||||||
|
|
||||||
use brk_error::Result;
|
use brk_error::Result;
|
||||||
use brk_indexer::Indexer;
|
use brk_indexer::Indexer;
|
||||||
use brk_structs::{StoredI16, StoredU16, Version};
|
use brk_structs::{StoredF32, StoredI16, StoredU16, Version};
|
||||||
use vecdb::{AnyCollectableVec, AnyVec, Database, Exit};
|
use vecdb::{AnyCollectableVec, AnyVec, Database, Exit};
|
||||||
|
|
||||||
use crate::grouped::Source;
|
use crate::grouped::Source;
|
||||||
@@ -24,7 +24,9 @@ pub struct Vecs {
|
|||||||
pub constant_2: ComputedVecsFromHeight<StoredU16>,
|
pub constant_2: ComputedVecsFromHeight<StoredU16>,
|
||||||
pub constant_3: ComputedVecsFromHeight<StoredU16>,
|
pub constant_3: ComputedVecsFromHeight<StoredU16>,
|
||||||
pub constant_4: ComputedVecsFromHeight<StoredU16>,
|
pub constant_4: ComputedVecsFromHeight<StoredU16>,
|
||||||
|
pub constant_38_2: ComputedVecsFromHeight<StoredF32>,
|
||||||
pub constant_50: ComputedVecsFromHeight<StoredU16>,
|
pub constant_50: ComputedVecsFromHeight<StoredU16>,
|
||||||
|
pub constant_61_8: ComputedVecsFromHeight<StoredF32>,
|
||||||
pub constant_100: ComputedVecsFromHeight<StoredU16>,
|
pub constant_100: ComputedVecsFromHeight<StoredU16>,
|
||||||
pub constant_600: ComputedVecsFromHeight<StoredU16>,
|
pub constant_600: ComputedVecsFromHeight<StoredU16>,
|
||||||
pub constant_minus_1: ComputedVecsFromHeight<StoredI16>,
|
pub constant_minus_1: ComputedVecsFromHeight<StoredI16>,
|
||||||
@@ -78,6 +80,14 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
VecBuilderOptions::default().add_last(),
|
VecBuilderOptions::default().add_last(),
|
||||||
)?,
|
)?,
|
||||||
|
constant_38_2: ComputedVecsFromHeight::forced_import(
|
||||||
|
&db,
|
||||||
|
"constant_38_2",
|
||||||
|
Source::Compute,
|
||||||
|
version + VERSION + Version::ZERO,
|
||||||
|
indexes,
|
||||||
|
VecBuilderOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
constant_50: ComputedVecsFromHeight::forced_import(
|
constant_50: ComputedVecsFromHeight::forced_import(
|
||||||
&db,
|
&db,
|
||||||
"constant_50",
|
"constant_50",
|
||||||
@@ -86,6 +96,14 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
VecBuilderOptions::default().add_last(),
|
VecBuilderOptions::default().add_last(),
|
||||||
)?,
|
)?,
|
||||||
|
constant_61_8: ComputedVecsFromHeight::forced_import(
|
||||||
|
&db,
|
||||||
|
"constant_61_8",
|
||||||
|
Source::Compute,
|
||||||
|
version + VERSION + Version::ZERO,
|
||||||
|
indexes,
|
||||||
|
VecBuilderOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
constant_100: ComputedVecsFromHeight::forced_import(
|
constant_100: ComputedVecsFromHeight::forced_import(
|
||||||
&db,
|
&db,
|
||||||
"constant_100",
|
"constant_100",
|
||||||
@@ -223,6 +241,30 @@ impl Vecs {
|
|||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
[
|
||||||
|
(&mut self.constant_38_2, 38.2),
|
||||||
|
(&mut self.constant_61_8, 61.8),
|
||||||
|
]
|
||||||
|
.into_iter()
|
||||||
|
.try_for_each(|(vec, value)| {
|
||||||
|
vec.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, StoredF32::from(value)),
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,7 +275,9 @@ impl Vecs {
|
|||||||
self.constant_2.vecs(),
|
self.constant_2.vecs(),
|
||||||
self.constant_3.vecs(),
|
self.constant_3.vecs(),
|
||||||
self.constant_4.vecs(),
|
self.constant_4.vecs(),
|
||||||
|
self.constant_38_2.vecs(),
|
||||||
self.constant_50.vecs(),
|
self.constant_50.vecs(),
|
||||||
|
self.constant_61_8.vecs(),
|
||||||
self.constant_100.vecs(),
|
self.constant_100.vecs(),
|
||||||
self.constant_600.vecs(),
|
self.constant_600.vecs(),
|
||||||
self.constant_minus_1.vecs(),
|
self.constant_minus_1.vecs(),
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ where
|
|||||||
pub average: Option<Box<EagerVec<I, T>>>,
|
pub average: Option<Box<EagerVec<I, T>>>,
|
||||||
pub sum: Option<Box<EagerVec<I, T>>>,
|
pub sum: Option<Box<EagerVec<I, T>>>,
|
||||||
pub max: Option<Box<EagerVec<I, T>>>,
|
pub max: Option<Box<EagerVec<I, T>>>,
|
||||||
pub p90: Option<Box<EagerVec<I, T>>>,
|
pub pct90: Option<Box<EagerVec<I, T>>>,
|
||||||
pub p75: Option<Box<EagerVec<I, T>>>,
|
pub pct75: Option<Box<EagerVec<I, T>>>,
|
||||||
pub median: Option<Box<EagerVec<I, T>>>,
|
pub median: Option<Box<EagerVec<I, T>>>,
|
||||||
pub p25: Option<Box<EagerVec<I, T>>>,
|
pub pct25: Option<Box<EagerVec<I, T>>>,
|
||||||
pub p10: Option<Box<EagerVec<I, T>>>,
|
pub pct10: Option<Box<EagerVec<I, T>>>,
|
||||||
pub min: Option<Box<EagerVec<I, T>>>,
|
pub min: Option<Box<EagerVec<I, T>>>,
|
||||||
pub last: Option<Box<EagerVec<I, T>>>,
|
pub last: Option<Box<EagerVec<I, T>>>,
|
||||||
pub cumulative: Option<Box<EagerVec<I, T>>>,
|
pub cumulative: Option<Box<EagerVec<I, T>>>,
|
||||||
@@ -152,44 +152,44 @@ where
|
|||||||
.unwrap(),
|
.unwrap(),
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
p90: options.p90.then(|| {
|
pct90: options.pct90.then(|| {
|
||||||
Box::new(
|
Box::new(
|
||||||
EagerVec::forced_import(
|
EagerVec::forced_import(
|
||||||
db,
|
db,
|
||||||
&maybe_suffix("p90"),
|
&maybe_suffix("pct90"),
|
||||||
version + VERSION + Version::ZERO,
|
version + VERSION + Version::ZERO,
|
||||||
format,
|
format,
|
||||||
)
|
)
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
p75: options.p75.then(|| {
|
pct75: options.pct75.then(|| {
|
||||||
Box::new(
|
Box::new(
|
||||||
EagerVec::forced_import(
|
EagerVec::forced_import(
|
||||||
db,
|
db,
|
||||||
&maybe_suffix("p75"),
|
&maybe_suffix("pct75"),
|
||||||
version + VERSION + Version::ZERO,
|
version + VERSION + Version::ZERO,
|
||||||
format,
|
format,
|
||||||
)
|
)
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
p25: options.p25.then(|| {
|
pct25: options.pct25.then(|| {
|
||||||
Box::new(
|
Box::new(
|
||||||
EagerVec::forced_import(
|
EagerVec::forced_import(
|
||||||
db,
|
db,
|
||||||
&maybe_suffix("p25"),
|
&maybe_suffix("pct25"),
|
||||||
version + VERSION + Version::ZERO,
|
version + VERSION + Version::ZERO,
|
||||||
format,
|
format,
|
||||||
)
|
)
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
p10: options.p10.then(|| {
|
pct10: options.pct10.then(|| {
|
||||||
Box::new(
|
Box::new(
|
||||||
EagerVec::forced_import(
|
EagerVec::forced_import(
|
||||||
db,
|
db,
|
||||||
&maybe_suffix("p10"),
|
&maybe_suffix("pct10"),
|
||||||
version + VERSION + Version::ZERO,
|
version + VERSION + Version::ZERO,
|
||||||
format,
|
format,
|
||||||
)
|
)
|
||||||
@@ -293,11 +293,11 @@ where
|
|||||||
let needs_average_sum_or_cumulative =
|
let needs_average_sum_or_cumulative =
|
||||||
needs_sum_or_cumulative || self.average.is_some();
|
needs_sum_or_cumulative || self.average.is_some();
|
||||||
let needs_sorted = self.max.is_some()
|
let needs_sorted = self.max.is_some()
|
||||||
|| self.p90.is_some()
|
|| self.pct90.is_some()
|
||||||
|| self.p75.is_some()
|
|| self.pct75.is_some()
|
||||||
|| self.median.is_some()
|
|| self.median.is_some()
|
||||||
|| self.p25.is_some()
|
|| self.pct25.is_some()
|
||||||
|| self.p10.is_some()
|
|| self.pct10.is_some()
|
||||||
|| self.min.is_some();
|
|| self.min.is_some();
|
||||||
let needs_values = needs_sorted || needs_average_sum_or_cumulative;
|
let needs_values = needs_sorted || needs_average_sum_or_cumulative;
|
||||||
|
|
||||||
@@ -334,24 +334,24 @@ where
|
|||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(p90) = self.p90.as_mut() {
|
if let Some(pct90) = self.pct90.as_mut() {
|
||||||
p90.forced_push_at(index, get_percentile(&values, 0.90), exit)?;
|
pct90.forced_push_at(index, get_percentile(&values, 0.90), exit)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(p75) = self.p75.as_mut() {
|
if let Some(pct75) = self.pct75.as_mut() {
|
||||||
p75.forced_push_at(index, get_percentile(&values, 0.75), exit)?;
|
pct75.forced_push_at(index, get_percentile(&values, 0.75), exit)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(median) = self.median.as_mut() {
|
if let Some(median) = self.median.as_mut() {
|
||||||
median.forced_push_at(index, get_percentile(&values, 0.50), exit)?;
|
median.forced_push_at(index, get_percentile(&values, 0.50), exit)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(p25) = self.p25.as_mut() {
|
if let Some(pct25) = self.pct25.as_mut() {
|
||||||
p25.forced_push_at(index, get_percentile(&values, 0.25), exit)?;
|
pct25.forced_push_at(index, get_percentile(&values, 0.25), exit)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(p10) = self.p10.as_mut() {
|
if let Some(pct10) = self.pct10.as_mut() {
|
||||||
p10.forced_push_at(index, get_percentile(&values, 0.10), exit)?;
|
pct10.forced_push_at(index, get_percentile(&values, 0.10), exit)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(min) = self.min.as_mut() {
|
if let Some(min) = self.min.as_mut() {
|
||||||
@@ -402,11 +402,11 @@ where
|
|||||||
where
|
where
|
||||||
I2: StoredIndex + StoredRaw + CheckedSub<I2>,
|
I2: StoredIndex + StoredRaw + CheckedSub<I2>,
|
||||||
{
|
{
|
||||||
if self.p90.is_some()
|
if self.pct90.is_some()
|
||||||
|| self.p75.is_some()
|
|| self.pct75.is_some()
|
||||||
|| self.median.is_some()
|
|| self.median.is_some()
|
||||||
|| self.p25.is_some()
|
|| self.pct25.is_some()
|
||||||
|| self.p10.is_some()
|
|| self.pct10.is_some()
|
||||||
{
|
{
|
||||||
panic!("unsupported");
|
panic!("unsupported");
|
||||||
}
|
}
|
||||||
@@ -559,24 +559,24 @@ where
|
|||||||
self.max.as_ref().unwrap()
|
self.max.as_ref().unwrap()
|
||||||
}
|
}
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn unwrap_p90(&self) -> &EagerVec<I, T> {
|
pub fn unwrap_pct90(&self) -> &EagerVec<I, T> {
|
||||||
self.p90.as_ref().unwrap()
|
self.pct90.as_ref().unwrap()
|
||||||
}
|
}
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn unwrap_p75(&self) -> &EagerVec<I, T> {
|
pub fn unwrap_pct75(&self) -> &EagerVec<I, T> {
|
||||||
self.p75.as_ref().unwrap()
|
self.pct75.as_ref().unwrap()
|
||||||
}
|
}
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn unwrap_median(&self) -> &EagerVec<I, T> {
|
pub fn unwrap_median(&self) -> &EagerVec<I, T> {
|
||||||
self.median.as_ref().unwrap()
|
self.median.as_ref().unwrap()
|
||||||
}
|
}
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn unwrap_p25(&self) -> &EagerVec<I, T> {
|
pub fn unwrap_pct25(&self) -> &EagerVec<I, T> {
|
||||||
self.p25.as_ref().unwrap()
|
self.pct25.as_ref().unwrap()
|
||||||
}
|
}
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn unwrap_p10(&self) -> &EagerVec<I, T> {
|
pub fn unwrap_pct10(&self) -> &EagerVec<I, T> {
|
||||||
self.p10.as_ref().unwrap()
|
self.pct10.as_ref().unwrap()
|
||||||
}
|
}
|
||||||
pub fn unwrap_min(&self) -> &EagerVec<I, T> {
|
pub fn unwrap_min(&self) -> &EagerVec<I, T> {
|
||||||
self.min.as_ref().unwrap()
|
self.min.as_ref().unwrap()
|
||||||
@@ -616,17 +616,17 @@ where
|
|||||||
if let Some(cumulative) = self.cumulative.as_ref() {
|
if let Some(cumulative) = self.cumulative.as_ref() {
|
||||||
v.push(cumulative.as_ref());
|
v.push(cumulative.as_ref());
|
||||||
}
|
}
|
||||||
if let Some(p90) = self.p90.as_ref() {
|
if let Some(pct90) = self.pct90.as_ref() {
|
||||||
v.push(p90.as_ref());
|
v.push(pct90.as_ref());
|
||||||
}
|
}
|
||||||
if let Some(p75) = self.p75.as_ref() {
|
if let Some(pct75) = self.pct75.as_ref() {
|
||||||
v.push(p75.as_ref());
|
v.push(pct75.as_ref());
|
||||||
}
|
}
|
||||||
if let Some(p25) = self.p25.as_ref() {
|
if let Some(pct25) = self.pct25.as_ref() {
|
||||||
v.push(p25.as_ref());
|
v.push(pct25.as_ref());
|
||||||
}
|
}
|
||||||
if let Some(p10) = self.p10.as_ref() {
|
if let Some(pct10) = self.pct10.as_ref() {
|
||||||
v.push(p10.as_ref());
|
v.push(pct10.as_ref());
|
||||||
}
|
}
|
||||||
|
|
||||||
v
|
v
|
||||||
@@ -657,17 +657,17 @@ where
|
|||||||
if let Some(cumulative) = self.cumulative.as_mut() {
|
if let Some(cumulative) = self.cumulative.as_mut() {
|
||||||
cumulative.safe_flush(exit)?;
|
cumulative.safe_flush(exit)?;
|
||||||
}
|
}
|
||||||
if let Some(p90) = self.p90.as_mut() {
|
if let Some(pct90) = self.pct90.as_mut() {
|
||||||
p90.safe_flush(exit)?;
|
pct90.safe_flush(exit)?;
|
||||||
}
|
}
|
||||||
if let Some(p75) = self.p75.as_mut() {
|
if let Some(pct75) = self.pct75.as_mut() {
|
||||||
p75.safe_flush(exit)?;
|
pct75.safe_flush(exit)?;
|
||||||
}
|
}
|
||||||
if let Some(p25) = self.p25.as_mut() {
|
if let Some(pct25) = self.pct25.as_mut() {
|
||||||
p25.safe_flush(exit)?;
|
pct25.safe_flush(exit)?;
|
||||||
}
|
}
|
||||||
if let Some(p10) = self.p10.as_mut() {
|
if let Some(pct10) = self.pct10.as_mut() {
|
||||||
p10.safe_flush(exit)?;
|
pct10.safe_flush(exit)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -698,17 +698,17 @@ where
|
|||||||
if let Some(cumulative) = self.cumulative.as_mut() {
|
if let Some(cumulative) = self.cumulative.as_mut() {
|
||||||
cumulative.validate_computed_version_or_reset(Version::ZERO + version)?;
|
cumulative.validate_computed_version_or_reset(Version::ZERO + version)?;
|
||||||
}
|
}
|
||||||
if let Some(p90) = self.p90.as_mut() {
|
if let Some(pct90) = self.pct90.as_mut() {
|
||||||
p90.validate_computed_version_or_reset(Version::ZERO + version)?;
|
pct90.validate_computed_version_or_reset(Version::ZERO + version)?;
|
||||||
}
|
}
|
||||||
if let Some(p75) = self.p75.as_mut() {
|
if let Some(pct75) = self.pct75.as_mut() {
|
||||||
p75.validate_computed_version_or_reset(Version::ZERO + version)?;
|
pct75.validate_computed_version_or_reset(Version::ZERO + version)?;
|
||||||
}
|
}
|
||||||
if let Some(p25) = self.p25.as_mut() {
|
if let Some(pct25) = self.pct25.as_mut() {
|
||||||
p25.validate_computed_version_or_reset(Version::ZERO + version)?;
|
pct25.validate_computed_version_or_reset(Version::ZERO + version)?;
|
||||||
}
|
}
|
||||||
if let Some(p10) = self.p10.as_mut() {
|
if let Some(pct10) = self.pct10.as_mut() {
|
||||||
p10.validate_computed_version_or_reset(Version::ZERO + version)?;
|
pct10.validate_computed_version_or_reset(Version::ZERO + version)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -720,11 +720,11 @@ pub struct VecBuilderOptions {
|
|||||||
average: bool,
|
average: bool,
|
||||||
sum: bool,
|
sum: bool,
|
||||||
max: bool,
|
max: bool,
|
||||||
p90: bool,
|
pct90: bool,
|
||||||
p75: bool,
|
pct75: bool,
|
||||||
median: bool,
|
median: bool,
|
||||||
p25: bool,
|
pct25: bool,
|
||||||
p10: bool,
|
pct10: bool,
|
||||||
min: bool,
|
min: bool,
|
||||||
first: bool,
|
first: bool,
|
||||||
last: bool,
|
last: bool,
|
||||||
@@ -744,24 +744,24 @@ impl VecBuilderOptions {
|
|||||||
self.max
|
self.max
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn p90(&self) -> bool {
|
pub fn pct90(&self) -> bool {
|
||||||
self.p90
|
self.pct90
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn p75(&self) -> bool {
|
pub fn pct75(&self) -> bool {
|
||||||
self.p75
|
self.pct75
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn median(&self) -> bool {
|
pub fn median(&self) -> bool {
|
||||||
self.median
|
self.median
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn p25(&self) -> bool {
|
pub fn pct25(&self) -> bool {
|
||||||
self.p25
|
self.pct25
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn p10(&self) -> bool {
|
pub fn pct10(&self) -> bool {
|
||||||
self.p10
|
self.pct10
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn min(&self) -> bool {
|
pub fn min(&self) -> bool {
|
||||||
@@ -817,26 +817,26 @@ impl VecBuilderOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn add_p90(mut self) -> Self {
|
pub fn add_pct90(mut self) -> Self {
|
||||||
self.p90 = true;
|
self.pct90 = true;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn add_p75(mut self) -> Self {
|
pub fn add_pct75(mut self) -> Self {
|
||||||
self.p75 = true;
|
self.pct75 = true;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn add_p25(mut self) -> Self {
|
pub fn add_pct25(mut self) -> Self {
|
||||||
self.p25 = true;
|
self.pct25 = true;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn add_p10(mut self) -> Self {
|
pub fn add_pct10(mut self) -> Self {
|
||||||
self.p10 = true;
|
self.pct10 = true;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -876,26 +876,26 @@ impl VecBuilderOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn rm_p90(mut self) -> Self {
|
pub fn rm_pct90(mut self) -> Self {
|
||||||
self.p90 = false;
|
self.pct90 = false;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn rm_p75(mut self) -> Self {
|
pub fn rm_pct75(mut self) -> Self {
|
||||||
self.p75 = false;
|
self.pct75 = false;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn rm_p25(mut self) -> Self {
|
pub fn rm_pct25(mut self) -> Self {
|
||||||
self.p25 = false;
|
self.pct25 = false;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn rm_p10(mut self) -> Self {
|
pub fn rm_pct10(mut self) -> Self {
|
||||||
self.p10 = false;
|
self.pct10 = false;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -912,20 +912,20 @@ impl VecBuilderOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_percentiles(mut self) -> Self {
|
pub fn add_percentiles(mut self) -> Self {
|
||||||
self.p90 = true;
|
self.pct90 = true;
|
||||||
self.p75 = true;
|
self.pct75 = true;
|
||||||
self.median = true;
|
self.median = true;
|
||||||
self.p25 = true;
|
self.pct25 = true;
|
||||||
self.p10 = true;
|
self.pct10 = true;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn remove_percentiles(mut self) -> Self {
|
pub fn remove_percentiles(mut self) -> Self {
|
||||||
self.p90 = false;
|
self.pct90 = false;
|
||||||
self.p75 = false;
|
self.pct75 = false;
|
||||||
self.median = false;
|
self.median = false;
|
||||||
self.p25 = false;
|
self.pct25 = false;
|
||||||
self.p10 = false;
|
self.pct10 = false;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -934,11 +934,11 @@ impl VecBuilderOptions {
|
|||||||
self.average,
|
self.average,
|
||||||
self.sum,
|
self.sum,
|
||||||
self.max,
|
self.max,
|
||||||
self.p90,
|
self.pct90,
|
||||||
self.p75,
|
self.pct75,
|
||||||
self.median,
|
self.median,
|
||||||
self.p25,
|
self.pct25,
|
||||||
self.p10,
|
self.pct10,
|
||||||
self.min,
|
self.min,
|
||||||
self.first,
|
self.first,
|
||||||
self.last,
|
self.last,
|
||||||
|
|||||||
@@ -320,24 +320,24 @@ impl ComputedVecsFromTxindex<Bitcoin> {
|
|||||||
exit,
|
exit,
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
if let Some(_90p) = self.height.p90.as_mut() {
|
if let Some(pct90) = self.height.pct90.as_mut() {
|
||||||
_90p.forced_push_at(
|
pct90.forced_push_at(
|
||||||
height,
|
height,
|
||||||
Bitcoin::from(
|
Bitcoin::from(
|
||||||
sats.height
|
sats.height
|
||||||
.unwrap_p90()
|
.unwrap_pct90()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.unwrap_get_inner(height),
|
.unwrap_get_inner(height),
|
||||||
),
|
),
|
||||||
exit,
|
exit,
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
if let Some(_75p) = self.height.p75.as_mut() {
|
if let Some(pct75) = self.height.pct75.as_mut() {
|
||||||
_75p.forced_push_at(
|
pct75.forced_push_at(
|
||||||
height,
|
height,
|
||||||
Bitcoin::from(
|
Bitcoin::from(
|
||||||
sats.height
|
sats.height
|
||||||
.unwrap_p75()
|
.unwrap_pct75()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.unwrap_get_inner(height),
|
.unwrap_get_inner(height),
|
||||||
),
|
),
|
||||||
@@ -356,24 +356,24 @@ impl ComputedVecsFromTxindex<Bitcoin> {
|
|||||||
exit,
|
exit,
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
if let Some(_25p) = self.height.p25.as_mut() {
|
if let Some(pct25) = self.height.pct25.as_mut() {
|
||||||
_25p.forced_push_at(
|
pct25.forced_push_at(
|
||||||
height,
|
height,
|
||||||
Bitcoin::from(
|
Bitcoin::from(
|
||||||
sats.height
|
sats.height
|
||||||
.unwrap_p25()
|
.unwrap_pct25()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.unwrap_get_inner(height),
|
.unwrap_get_inner(height),
|
||||||
),
|
),
|
||||||
exit,
|
exit,
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
if let Some(_10p) = self.height.p10.as_mut() {
|
if let Some(pct10) = self.height.pct10.as_mut() {
|
||||||
_10p.forced_push_at(
|
pct10.forced_push_at(
|
||||||
height,
|
height,
|
||||||
Bitcoin::from(
|
Bitcoin::from(
|
||||||
sats.height
|
sats.height
|
||||||
.unwrap_p10()
|
.unwrap_pct10()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.unwrap_get_inner(height),
|
.unwrap_get_inner(height),
|
||||||
),
|
),
|
||||||
@@ -503,25 +503,25 @@ impl ComputedVecsFromTxindex<Dollars> {
|
|||||||
exit,
|
exit,
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
if let Some(_90p) = self.height.p90.as_mut() {
|
if let Some(pct90) = self.height.pct90.as_mut() {
|
||||||
_90p.forced_push_at(
|
pct90.forced_push_at(
|
||||||
height,
|
height,
|
||||||
price
|
price
|
||||||
* bitcoin
|
* bitcoin
|
||||||
.height
|
.height
|
||||||
.unwrap_p90()
|
.unwrap_pct90()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.unwrap_get_inner(height),
|
.unwrap_get_inner(height),
|
||||||
exit,
|
exit,
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
if let Some(_75p) = self.height.p75.as_mut() {
|
if let Some(pct75) = self.height.pct75.as_mut() {
|
||||||
_75p.forced_push_at(
|
pct75.forced_push_at(
|
||||||
height,
|
height,
|
||||||
price
|
price
|
||||||
* bitcoin
|
* bitcoin
|
||||||
.height
|
.height
|
||||||
.unwrap_p75()
|
.unwrap_pct75()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.unwrap_get_inner(height),
|
.unwrap_get_inner(height),
|
||||||
exit,
|
exit,
|
||||||
@@ -539,25 +539,25 @@ impl ComputedVecsFromTxindex<Dollars> {
|
|||||||
exit,
|
exit,
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
if let Some(_25p) = self.height.p25.as_mut() {
|
if let Some(pct25) = self.height.pct25.as_mut() {
|
||||||
_25p.forced_push_at(
|
pct25.forced_push_at(
|
||||||
height,
|
height,
|
||||||
price
|
price
|
||||||
* bitcoin
|
* bitcoin
|
||||||
.height
|
.height
|
||||||
.unwrap_p25()
|
.unwrap_pct25()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.unwrap_get_inner(height),
|
.unwrap_get_inner(height),
|
||||||
exit,
|
exit,
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
if let Some(_10p) = self.height.p10.as_mut() {
|
if let Some(pct10) = self.height.pct10.as_mut() {
|
||||||
_10p.forced_push_at(
|
pct10.forced_push_at(
|
||||||
height,
|
height,
|
||||||
price
|
price
|
||||||
* bitcoin
|
* bitcoin
|
||||||
.height
|
.height
|
||||||
.unwrap_p10()
|
.unwrap_pct10()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.unwrap_get_inner(height),
|
.unwrap_get_inner(height),
|
||||||
exit,
|
exit,
|
||||||
|
|||||||
@@ -35,9 +35,20 @@ pub struct Vecs {
|
|||||||
pub indexes_to_price_1w_volatility: ComputedVecsFromDateIndex<StoredF32>,
|
pub indexes_to_price_1w_volatility: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
pub indexes_to_price_1m_volatility: ComputedVecsFromDateIndex<StoredF32>,
|
pub indexes_to_price_1m_volatility: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
pub indexes_to_price_1y_volatility: ComputedVecsFromDateIndex<StoredF32>,
|
pub indexes_to_price_1y_volatility: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
// pub indexes_to_price_true_range: ComputedVecsFromDateIndex<StoredF32>,
|
|
||||||
// pub indexes_to_price_2w_choppiness_index: ComputedVecsFromDateIndex<StoredF32>,
|
pub indexes_to_price_1w_min: ComputedVecsFromDateIndex<Dollars>,
|
||||||
//
|
pub indexes_to_price_1w_max: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub indexes_to_price_2w_min: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub indexes_to_price_2w_max: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub indexes_to_price_1m_min: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub indexes_to_price_1m_max: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub indexes_to_price_1y_min: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub indexes_to_price_1y_max: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
|
||||||
|
pub dateindex_to_price_true_range: EagerVec<DateIndex, StoredF32>,
|
||||||
|
pub dateindex_to_price_true_range_2w_sum: EagerVec<DateIndex, StoredF32>,
|
||||||
|
pub indexes_to_price_2w_choppiness_index: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
|
||||||
pub indexes_to_price_1w_sma: ComputedRatioVecsFromDateIndex,
|
pub indexes_to_price_1w_sma: ComputedRatioVecsFromDateIndex,
|
||||||
pub indexes_to_price_8d_sma: ComputedRatioVecsFromDateIndex,
|
pub indexes_to_price_8d_sma: ComputedRatioVecsFromDateIndex,
|
||||||
pub indexes_to_price_13d_sma: ComputedRatioVecsFromDateIndex,
|
pub indexes_to_price_13d_sma: ComputedRatioVecsFromDateIndex,
|
||||||
@@ -1420,22 +1431,88 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
VecBuilderOptions::default().add_last(),
|
VecBuilderOptions::default().add_last(),
|
||||||
)?,
|
)?,
|
||||||
// indexes_to_price_true_range: ComputedVecsFromDateIndex::forced_import(
|
dateindex_to_price_true_range: EagerVec::forced_import_compressed(
|
||||||
// &db,
|
&db,
|
||||||
// "price_true_range",
|
"price_true_range",
|
||||||
// Source::Compute,
|
version + Version::ZERO,
|
||||||
// version + Version::ZERO,
|
)?,
|
||||||
// indexes,
|
dateindex_to_price_true_range_2w_sum: EagerVec::forced_import_compressed(
|
||||||
// VecBuilderOptions::default().add_last(),
|
&db,
|
||||||
// )?,
|
"price_true_range_2w_sum",
|
||||||
// indexes_to_price_2w_choppiness_index: ComputedVecsFromDateIndex::forced_import(
|
version + Version::ZERO,
|
||||||
// &db,
|
)?,
|
||||||
// "price_2w_choppiness_index",
|
indexes_to_price_1w_min: ComputedVecsFromDateIndex::forced_import(
|
||||||
// Source::Compute,
|
&db,
|
||||||
// version + Version::ZERO,
|
"price_1w_min",
|
||||||
// indexes,
|
Source::Compute,
|
||||||
// VecBuilderOptions::default().add_last(),
|
version + Version::ONE,
|
||||||
// )?,
|
indexes,
|
||||||
|
VecBuilderOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_price_1w_max: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
&db,
|
||||||
|
"price_1w_max",
|
||||||
|
Source::Compute,
|
||||||
|
version + Version::ONE,
|
||||||
|
indexes,
|
||||||
|
VecBuilderOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_price_2w_min: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
&db,
|
||||||
|
"price_2w_min",
|
||||||
|
Source::Compute,
|
||||||
|
version + Version::ONE,
|
||||||
|
indexes,
|
||||||
|
VecBuilderOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_price_2w_max: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
&db,
|
||||||
|
"price_2w_max",
|
||||||
|
Source::Compute,
|
||||||
|
version + Version::ONE,
|
||||||
|
indexes,
|
||||||
|
VecBuilderOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_price_1m_min: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
&db,
|
||||||
|
"price_1m_min",
|
||||||
|
Source::Compute,
|
||||||
|
version + Version::ONE,
|
||||||
|
indexes,
|
||||||
|
VecBuilderOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_price_1m_max: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
&db,
|
||||||
|
"price_1m_max",
|
||||||
|
Source::Compute,
|
||||||
|
version + Version::ONE,
|
||||||
|
indexes,
|
||||||
|
VecBuilderOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_price_1y_min: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
&db,
|
||||||
|
"price_1y_min",
|
||||||
|
Source::Compute,
|
||||||
|
version + Version::ONE,
|
||||||
|
indexes,
|
||||||
|
VecBuilderOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_price_1y_max: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
&db,
|
||||||
|
"price_1y_max",
|
||||||
|
Source::Compute,
|
||||||
|
version + Version::ONE,
|
||||||
|
indexes,
|
||||||
|
VecBuilderOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_price_2w_choppiness_index: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
&db,
|
||||||
|
"price_2w_choppiness_index",
|
||||||
|
Source::Compute,
|
||||||
|
version + Version::ONE,
|
||||||
|
indexes,
|
||||||
|
VecBuilderOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
db,
|
db,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1470,7 +1547,7 @@ impl Vecs {
|
|||||||
starting_indexes: &Indexes,
|
starting_indexes: &Indexes,
|
||||||
exit: &Exit,
|
exit: &Exit,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
self.height_to_price_ath.compute_max(
|
self.height_to_price_ath.compute_all_time_high(
|
||||||
starting_indexes.height,
|
starting_indexes.height,
|
||||||
&price.chainindexes_to_price_high.height,
|
&price.chainindexes_to_price_high.height,
|
||||||
exit,
|
exit,
|
||||||
@@ -1488,7 +1565,7 @@ impl Vecs {
|
|||||||
starting_indexes,
|
starting_indexes,
|
||||||
exit,
|
exit,
|
||||||
|v, _, _, starting_indexes, exit| {
|
|v, _, _, starting_indexes, exit| {
|
||||||
v.compute_max(
|
v.compute_all_time_high(
|
||||||
starting_indexes.dateindex,
|
starting_indexes.dateindex,
|
||||||
price.timeindexes_to_price_high.dateindex.as_ref().unwrap(),
|
price.timeindexes_to_price_high.dateindex.as_ref().unwrap(),
|
||||||
exit,
|
exit,
|
||||||
@@ -2251,6 +2328,182 @@ impl Vecs {
|
|||||||
},
|
},
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
self.dateindex_to_price_true_range.compute_transform3(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
price.timeindexes_to_price_open.dateindex.as_ref().unwrap(),
|
||||||
|
price.timeindexes_to_price_high.dateindex.as_ref().unwrap(),
|
||||||
|
price.timeindexes_to_price_low.dateindex.as_ref().unwrap(),
|
||||||
|
|(i, open, high, low, ..)| {
|
||||||
|
let high_min_low = **high - **low;
|
||||||
|
let high_min_open = (**high - **open).abs();
|
||||||
|
let low_min_open = (**low - **open).abs();
|
||||||
|
(i, high_min_low.max(high_min_open).max(low_min_open).into())
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.dateindex_to_price_true_range_2w_sum.compute_sum(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.dateindex_to_price_true_range,
|
||||||
|
14,
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.indexes_to_price_1w_max.compute_all(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_max(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
price.timeindexes_to_price_high.dateindex.as_ref().unwrap(),
|
||||||
|
7,
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.indexes_to_price_1w_min.compute_all(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_min(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
price.timeindexes_to_price_low.dateindex.as_ref().unwrap(),
|
||||||
|
7,
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.indexes_to_price_2w_max.compute_all(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_max(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
price.timeindexes_to_price_high.dateindex.as_ref().unwrap(),
|
||||||
|
14,
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.indexes_to_price_2w_min.compute_all(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_min(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
price.timeindexes_to_price_low.dateindex.as_ref().unwrap(),
|
||||||
|
14,
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.indexes_to_price_1m_max.compute_all(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_max(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
price.timeindexes_to_price_high.dateindex.as_ref().unwrap(),
|
||||||
|
30,
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.indexes_to_price_1m_min.compute_all(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_min(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
price.timeindexes_to_price_low.dateindex.as_ref().unwrap(),
|
||||||
|
30,
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.indexes_to_price_1y_max.compute_all(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_max(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
price.timeindexes_to_price_high.dateindex.as_ref().unwrap(),
|
||||||
|
365,
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.indexes_to_price_1y_min.compute_all(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_min(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
price.timeindexes_to_price_low.dateindex.as_ref().unwrap(),
|
||||||
|
365,
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.indexes_to_price_2w_choppiness_index.compute_all(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
let n = 14;
|
||||||
|
let log10n = (n as f32).log10();
|
||||||
|
v.compute_transform3(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.dateindex_to_price_true_range_2w_sum,
|
||||||
|
self.indexes_to_price_2w_max.dateindex.as_ref().unwrap(),
|
||||||
|
self.indexes_to_price_2w_min.dateindex.as_ref().unwrap(),
|
||||||
|
|(i, tr_sum, max, min, ..)| {
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
StoredF32::from(
|
||||||
|
100.0 * (*tr_sum / (*max - *min) as f32).log10() / log10n,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2406,7 +2659,21 @@ impl Vecs {
|
|||||||
self.indexes_to_price_1w_volatility.vecs(),
|
self.indexes_to_price_1w_volatility.vecs(),
|
||||||
self.indexes_to_price_1m_volatility.vecs(),
|
self.indexes_to_price_1m_volatility.vecs(),
|
||||||
self.indexes_to_price_1y_volatility.vecs(),
|
self.indexes_to_price_1y_volatility.vecs(),
|
||||||
vec![&self.height_to_price_ath, &self.height_to_price_drawdown],
|
self.indexes_to_price_2w_choppiness_index.vecs(),
|
||||||
|
self.indexes_to_price_1w_min.vecs(),
|
||||||
|
self.indexes_to_price_1w_max.vecs(),
|
||||||
|
self.indexes_to_price_2w_min.vecs(),
|
||||||
|
self.indexes_to_price_2w_max.vecs(),
|
||||||
|
self.indexes_to_price_1m_min.vecs(),
|
||||||
|
self.indexes_to_price_1m_max.vecs(),
|
||||||
|
self.indexes_to_price_1y_min.vecs(),
|
||||||
|
self.indexes_to_price_1y_max.vecs(),
|
||||||
|
vec![
|
||||||
|
&self.height_to_price_ath,
|
||||||
|
&self.height_to_price_drawdown,
|
||||||
|
&self.dateindex_to_price_true_range,
|
||||||
|
&self.dateindex_to_price_true_range_2w_sum,
|
||||||
|
],
|
||||||
]
|
]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.flatten()
|
.flatten()
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ use serde::{Deserialize, Serialize};
|
|||||||
use vecdb::{CheckedSub, StoredCompressed};
|
use vecdb::{CheckedSub, StoredCompressed};
|
||||||
use zerocopy_derive::{FromBytes, Immutable, IntoBytes, KnownLayout};
|
use zerocopy_derive::{FromBytes, Immutable, IntoBytes, KnownLayout};
|
||||||
|
|
||||||
|
use crate::{Low, Open};
|
||||||
|
|
||||||
use super::{Bitcoin, Cents, Close, High, Sats, StoredF32, StoredF64};
|
use super::{Bitcoin, Cents, Close, High, Sats, StoredF32, StoredF64};
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
@@ -80,8 +82,8 @@ impl From<Dollars> for f64 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<Close<Dollars>> for Dollars {
|
impl From<Open<Dollars>> for Dollars {
|
||||||
fn from(value: Close<Dollars>) -> Self {
|
fn from(value: Open<Dollars>) -> Self {
|
||||||
Self(value.0)
|
Self(value.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -92,6 +94,18 @@ impl From<High<Dollars>> for Dollars {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<Low<Dollars>> for Dollars {
|
||||||
|
fn from(value: Low<Dollars>) -> Self {
|
||||||
|
Self(value.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<Close<Dollars>> for Dollars {
|
||||||
|
fn from(value: Close<Dollars>) -> Self {
|
||||||
|
Self(value.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<usize> for Dollars {
|
impl From<usize> for Dollars {
|
||||||
fn from(value: usize) -> Self {
|
fn from(value: usize) -> Self {
|
||||||
Self(value as f64)
|
Self(value as f64)
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[toolchain]
|
||||||
|
channel = "1.89.0"
|
||||||
@@ -367,7 +367,7 @@ export function init({
|
|||||||
case null:
|
case null:
|
||||||
case CANDLE: {
|
case CANDLE: {
|
||||||
series = chart.addCandlestickSeries({
|
series = chart.addCandlestickSeries({
|
||||||
vecId: "ohlc_in_sats",
|
vecId: "price_ohlc_in_sats",
|
||||||
name: "Price",
|
name: "Price",
|
||||||
unit: topUnit,
|
unit: topUnit,
|
||||||
inverse: true,
|
inverse: true,
|
||||||
@@ -378,7 +378,7 @@ export function init({
|
|||||||
}
|
}
|
||||||
case LINE: {
|
case LINE: {
|
||||||
series = chart.addLineSeries({
|
series = chart.addLineSeries({
|
||||||
vecId: "close_in_sats",
|
vecId: "price_close_in_sats",
|
||||||
name: "Price",
|
name: "Price",
|
||||||
unit: topUnit,
|
unit: topUnit,
|
||||||
color: colors.default,
|
color: colors.default,
|
||||||
|
|||||||
@@ -783,11 +783,14 @@ function createUtils() {
|
|||||||
id === "price_open" ||
|
id === "price_open" ||
|
||||||
id === "price_ath" ||
|
id === "price_ath" ||
|
||||||
id === "market_cap" ||
|
id === "market_cap" ||
|
||||||
|
id.startsWith("price_true_range") ||
|
||||||
id.includes("_usd") ||
|
id.includes("_usd") ||
|
||||||
id.includes("cointime_value") ||
|
id.includes("cointime_value") ||
|
||||||
id.endsWith("_ago") ||
|
id.endsWith("_ago") ||
|
||||||
id.endsWith("price_paid") ||
|
id.endsWith("price_paid") ||
|
||||||
id.endsWith("_price") ||
|
id.endsWith("_price") ||
|
||||||
|
(id.startsWith("price") &&
|
||||||
|
(id.endsWith("min") || id.endsWith("max"))) ||
|
||||||
(id.endsWith("_cap") && !id.includes("rel_to")) ||
|
(id.endsWith("_cap") && !id.includes("rel_to")) ||
|
||||||
id.endsWith("value_created") ||
|
id.endsWith("value_created") ||
|
||||||
id.endsWith("value_destroyed") ||
|
id.endsWith("value_destroyed") ||
|
||||||
|
|||||||
@@ -163,18 +163,18 @@ function createPartialOptions({ env, colors, vecIdToIndexes, pools }) {
|
|||||||
* @typedef {"_median"} MedianSuffix
|
* @typedef {"_median"} MedianSuffix
|
||||||
* @typedef {EndsWith<MedianSuffix>} VecIdMedian
|
* @typedef {EndsWith<MedianSuffix>} VecIdMedian
|
||||||
* @typedef {WithoutSuffix<VecIdMedian, MedianSuffix>} VecIdMedianBase
|
* @typedef {WithoutSuffix<VecIdMedian, MedianSuffix>} VecIdMedianBase
|
||||||
* @typedef {"_p90"} _p90Suffix
|
* @typedef {"_pct90"} _pct90Suffix
|
||||||
* @typedef {EndsWith<_p90Suffix>} VecIdp90
|
* @typedef {EndsWith<_pct90Suffix>} VecIdpct90
|
||||||
* @typedef {WithoutSuffix<VecIdp90, _p90Suffix>} VecIdp90Base
|
* @typedef {WithoutSuffix<VecIdpct90, _pct90Suffix>} VecIdpct90Base
|
||||||
* @typedef {"_p75"} _p75Suffix
|
* @typedef {"_pct75"} _pct75Suffix
|
||||||
* @typedef {EndsWith<_p75Suffix>} VecIdp75
|
* @typedef {EndsWith<_pct75Suffix>} VecIdpct75
|
||||||
* @typedef {WithoutSuffix<VecIdp75, _p75Suffix>} VecIdp75Base
|
* @typedef {WithoutSuffix<VecIdpct75, _pct75Suffix>} VecIdpct75Base
|
||||||
* @typedef {"_p25"} _p25Suffix
|
* @typedef {"_pct25"} _pct25Suffix
|
||||||
* @typedef {EndsWith<_p25Suffix>} VecIdp25
|
* @typedef {EndsWith<_pct25Suffix>} VecIdpct25
|
||||||
* @typedef {WithoutSuffix<VecIdp25, _p25Suffix>} VecIdp25Base
|
* @typedef {WithoutSuffix<VecIdpct25, _pct25Suffix>} VecIdpct25Base
|
||||||
* @typedef {"_p10"} _p10Suffix
|
* @typedef {"_pct10"} _pct10Suffix
|
||||||
* @typedef {EndsWith<_p10Suffix>} VecIdp10
|
* @typedef {EndsWith<_pct10Suffix>} VecIdpct10
|
||||||
* @typedef {WithoutSuffix<VecIdp10, _p10Suffix>} VecIdp10Base
|
* @typedef {WithoutSuffix<VecIdpct10, _pct10Suffix>} VecIdpct10Base
|
||||||
* @typedef {"_max"} MaxSuffix
|
* @typedef {"_max"} MaxSuffix
|
||||||
* @typedef {EndsWith<MaxSuffix>} VecIdMax
|
* @typedef {EndsWith<MaxSuffix>} VecIdMax
|
||||||
* @typedef {WithoutSuffix<VecIdMax, MaxSuffix>} VecIdMaxBase
|
* @typedef {WithoutSuffix<VecIdMax, MaxSuffix>} VecIdMaxBase
|
||||||
@@ -1094,7 +1094,10 @@ function createPartialOptions({ env, colors, vecIdToIndexes, pools }) {
|
|||||||
lineStyle,
|
lineStyle,
|
||||||
}) {
|
}) {
|
||||||
return /** @satisfies {FetchedLineSeriesBlueprint} */ ({
|
return /** @satisfies {FetchedLineSeriesBlueprint} */ ({
|
||||||
key: `constant_${number >= 0 ? number : `minus_${Math.abs(number)}`}`,
|
key: `constant_${number >= 0 ? number : `minus_${Math.abs(number)}`}`.replace(
|
||||||
|
".",
|
||||||
|
"_",
|
||||||
|
),
|
||||||
title: name ?? `${number}`,
|
title: name ?? `${number}`,
|
||||||
unit,
|
unit,
|
||||||
defaultActive,
|
defaultActive,
|
||||||
@@ -1229,7 +1232,7 @@ function createPartialOptions({ env, colors, vecIdToIndexes, pools }) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Object} args
|
* @param {Object} args
|
||||||
* @param {VecIdMinBase & VecIdMaxBase & VecIdp90Base & VecIdp75Base & VecIdMedianBase & VecIdp25Base & VecIdp10Base} args.concat
|
* @param {VecIdMinBase & VecIdMaxBase & VecIdpct90Base & VecIdpct75Base & VecIdMedianBase & VecIdpct25Base & VecIdpct10Base} args.concat
|
||||||
* @param {string} [args.title]
|
* @param {string} [args.title]
|
||||||
*/
|
*/
|
||||||
function createMinMaxPercentilesSeries({ concat, title = "" }) {
|
function createMinMaxPercentilesSeries({ concat, title = "" }) {
|
||||||
@@ -1253,26 +1256,26 @@ function createPartialOptions({ env, colors, vecIdToIndexes, pools }) {
|
|||||||
defaultActive: false,
|
defaultActive: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: `${concat}_p75`,
|
key: `${concat}_pct75`,
|
||||||
title: `p75 ${title}`,
|
title: `pct75 ${title}`,
|
||||||
color: colors.red,
|
color: colors.red,
|
||||||
defaultActive: false,
|
defaultActive: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: `${concat}_p25`,
|
key: `${concat}_pct25`,
|
||||||
title: `p25 ${title}`,
|
title: `pct25 ${title}`,
|
||||||
color: colors.yellow,
|
color: colors.yellow,
|
||||||
defaultActive: false,
|
defaultActive: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: `${concat}_p90`,
|
key: `${concat}_pct90`,
|
||||||
title: `p90 ${title}`,
|
title: `pct90 ${title}`,
|
||||||
color: colors.rose,
|
color: colors.rose,
|
||||||
defaultActive: false,
|
defaultActive: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: `${concat}_p10`,
|
key: `${concat}_pct10`,
|
||||||
title: `p10 ${title}`,
|
title: `pct10 ${title}`,
|
||||||
color: colors.lime,
|
color: colors.lime,
|
||||||
defaultActive: false,
|
defaultActive: false,
|
||||||
},
|
},
|
||||||
@@ -1280,7 +1283,7 @@ function createPartialOptions({ env, colors, vecIdToIndexes, pools }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {VecIdAverageBase & CumulativeVecIdBase & VecIdMinBase & VecIdMaxBase & VecIdp90Base & VecIdp75Base & VecIdMedianBase & VecIdp25Base & VecIdp10Base} key
|
* @param {VecIdAverageBase & CumulativeVecIdBase & VecIdMinBase & VecIdMaxBase & VecIdpct90Base & VecIdpct75Base & VecIdMedianBase & VecIdpct25Base & VecIdpct10Base} key
|
||||||
*/
|
*/
|
||||||
function createSumCumulativeMinMaxPercentilesSeries(key) {
|
function createSumCumulativeMinMaxPercentilesSeries(key) {
|
||||||
return [
|
return [
|
||||||
@@ -1290,7 +1293,7 @@ function createPartialOptions({ env, colors, vecIdToIndexes, pools }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {VecIdAverageBase & CumulativeVecIdBase & VecIdMinBase & VecIdMaxBase & VecIdp90Base & VecIdp75Base & VecIdMedianBase & VecIdp25Base & VecIdp10Base} key
|
* @param {VecIdAverageBase & CumulativeVecIdBase & VecIdMinBase & VecIdMaxBase & VecIdpct90Base & VecIdpct75Base & VecIdMedianBase & VecIdpct25Base & VecIdpct10Base} key
|
||||||
*/
|
*/
|
||||||
function createAverageSumCumulativeMinMaxPercentilesSeries(key) {
|
function createAverageSumCumulativeMinMaxPercentilesSeries(key) {
|
||||||
return [
|
return [
|
||||||
@@ -1301,7 +1304,7 @@ function createPartialOptions({ env, colors, vecIdToIndexes, pools }) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Object} args
|
* @param {Object} args
|
||||||
* @param {VecId & VecIdAverageBase & CumulativeVecIdBase & VecIdMinBase & VecIdMaxBase & VecIdp90Base & VecIdp75Base & VecIdMedianBase & VecIdp25Base & VecIdp10Base} args.key
|
* @param {VecId & VecIdAverageBase & CumulativeVecIdBase & VecIdMinBase & VecIdMaxBase & VecIdpct90Base & VecIdpct75Base & VecIdMedianBase & VecIdpct25Base & VecIdpct10Base} args.key
|
||||||
* @param {string} args.name
|
* @param {string} args.name
|
||||||
*/
|
*/
|
||||||
function createBaseAverageSumCumulativeMinMaxPercentilesSeries({
|
function createBaseAverageSumCumulativeMinMaxPercentilesSeries({
|
||||||
@@ -3170,6 +3173,72 @@ function createPartialOptions({ env, colors, vecIdToIndexes, pools }) {
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "MinMax",
|
||||||
|
tree: [
|
||||||
|
{
|
||||||
|
key: "1w",
|
||||||
|
title: "1 Week",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "2w",
|
||||||
|
title: "2 Week",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "1m",
|
||||||
|
title: "1 Month",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "1y",
|
||||||
|
title: "1 Year",
|
||||||
|
},
|
||||||
|
].map(({ key, title }) => ({
|
||||||
|
name: key,
|
||||||
|
title: `Bitcoin Price ${title} MinMax Bands`,
|
||||||
|
top: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: `price_${key}_min`,
|
||||||
|
name: "min",
|
||||||
|
color: colors.red,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `price_${key}_max`,
|
||||||
|
name: "max",
|
||||||
|
color: colors.green,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
})),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "True range",
|
||||||
|
title: "Bitcoin Price True Range",
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "price_true_range",
|
||||||
|
name: "value",
|
||||||
|
color: colors.yellow,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Choppiness",
|
||||||
|
title: "Bitcoin Price Choppiness Index",
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "price_2w_choppiness_index",
|
||||||
|
name: "2w",
|
||||||
|
color: colors.red,
|
||||||
|
}),
|
||||||
|
createPriceLine({
|
||||||
|
unit: "Index",
|
||||||
|
number: 61.8,
|
||||||
|
}),
|
||||||
|
createPriceLine({
|
||||||
|
unit: "Index",
|
||||||
|
number: 38.2,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "Mayer multiple",
|
name: "Mayer multiple",
|
||||||
title: "Mayer multiple",
|
title: "Mayer multiple",
|
||||||
|
|||||||
@@ -520,7 +520,9 @@ function createIndexToVecIds(vecIdToIndexes) {
|
|||||||
*/
|
*/
|
||||||
function serializeValue({ value, unit }) {
|
function serializeValue({ value, unit }) {
|
||||||
const t = typeof value;
|
const t = typeof value;
|
||||||
if (typeof value === "string") {
|
if (value === null) {
|
||||||
|
return "null";
|
||||||
|
} else if (typeof value === "string") {
|
||||||
return value;
|
return value;
|
||||||
} else if (t !== "number") {
|
} else if (t !== "number") {
|
||||||
return JSON.stringify(value).replaceAll('"', "").slice(1, -1);
|
return JSON.stringify(value).replaceAll('"', "").slice(1, -1);
|
||||||
|
|||||||
Reference in New Issue
Block a user