global: snapshot

This commit is contained in:
nym21
2025-04-04 18:31:10 +02:00
parent 9f16379b41
commit 0767b3156d
9 changed files with 71 additions and 16 deletions
-1
View File
@@ -29,7 +29,6 @@ docker/kibo
# Types
paths.d.ts
vecid-to-indexes.d.ts
# Outputs
_outputs
@@ -39,8 +39,23 @@ where
let name = path.file_name().unwrap().to_str().unwrap().to_string();
let key = I::to_string().split("::").last().unwrap().to_lowercase();
let prefix = |s: &str| path.with_file_name(format!("{key}_to_{s}_{name}"));
let suffix = |s: &str| path.with_file_name(format!("{key}_to_{name}_{s}"));
let only_one_active = options.is_only_one_active();
let prefix = |s: &str| {
if only_one_active {
path.with_file_name(format!("{key}_to_{name}"))
} else {
path.with_file_name(format!("{key}_to_{s}_{name}"))
}
};
let suffix = |s: &str| {
if only_one_active {
path.with_file_name(format!("{key}_to_{name}"))
} else {
path.with_file_name(format!("{key}_to_{name}_{s}"))
}
};
let s = Self {
first: options.first.then(|| {
@@ -563,4 +578,24 @@ impl StorableVecGeneatorOptions {
self._10p = false;
self
}
pub fn is_only_one_active(&self) -> bool {
[
self.average,
self.sum,
self.max,
self._90p,
self._75p,
self.median,
self._25p,
self._10p,
self.min,
self.first,
self.last,
]
.iter()
.filter(|b| **b)
.count()
== 1
}
}
+1 -1
View File
@@ -82,7 +82,7 @@ impl Binance {
}
pub fn get_from_1d(&mut self, date: &Date) -> color_eyre::Result<OHLCCents> {
if self._1d.is_none() || self._1d.as_ref().unwrap().last_key_value().unwrap().0 < date {
if self._1d.is_none() || self._1d.as_ref().unwrap().last_key_value().unwrap().0 <= date {
self._1d.replace(Self::fetch_1d()?);
}
+1 -1
View File
@@ -81,7 +81,7 @@ impl Kibo {
.last_key_value()
.unwrap()
.0
< date
<= date
{
self.year_to_date_to_ohlc
.insert(year, Self::fetch_date_prices(year)?);
+1 -1
View File
@@ -43,7 +43,7 @@ impl Kraken {
}
pub fn get_from_1d(&mut self, date: &Date) -> color_eyre::Result<OHLCCents> {
if self._1d.is_none() || self._1d.as_ref().unwrap().last_key_value().unwrap().0 < date {
if self._1d.is_none() || self._1d.as_ref().unwrap().last_key_value().unwrap().0 <= date {
self._1d.replace(Kraken::fetch_1d()?);
}
self._1d
+6 -1
View File
@@ -31,7 +31,12 @@ impl DTS for Query<'static> {
let indexes = Index::all();
let mut contents = indexes
let mut contents = "//
// File auto-generated, any modification will be overwritten
//\n\n"
.to_string();
contents += &indexes
.iter()
.enumerate()
.map(|(i_of_i, i)| {
+17 -2
View File
@@ -61,7 +61,7 @@
* @typedef {Object} PartialChartOptionSpecific
* @property {"chart"} [kind]
* @property {Unit} [unit]
* @property {string} [title]
* @property {string} title
* @property {AnyFetchedSeriesBlueprint[]} [top]
* @property {AnyFetchedSeriesBlueprint[]} [bottom]
* @typedef {PartialOption & PartialChartOptionSpecific} PartialChartOption
@@ -668,7 +668,20 @@ function createPartialOptions(colors) {
name: "Blocks",
tree: [
{
name: "Block Interval",
name: "Count",
title: "Block Count",
bottom: [
{ key: "block-count", title: "Count", color: colors.bitcoin },
{
key: "total-block-count",
title: "Total",
color: colors.bitcoin,
},
],
},
{
name: "Interval",
title: "Block Interval",
bottom: [
{
key: "block-interval",
@@ -1066,6 +1079,8 @@ export function initOptions({
anyPartial.unit = "Seconds";
} else if (key.startsWith("sats-")) {
anyPartial.unit = "Satoshis";
} else if (key.includes("count")) {
anyPartial.unit = "Count";
} else {
console.log(anyPartial);
throw Error("Unit not set");
+1 -1
View File
@@ -945,7 +945,7 @@ export function init({
p3.innerHTML = `You would've been ${serProfitableDaysRatio} of the time profitable and ${serUnprofitableDaysRatio} of the time unprofitable.`;
signals.createEffect(
() => 0.2368,
() => 0.073,
(lowestAnnual4YReturn) => {
const serLowestAnnual4YReturn = c(
"cyan",
@@ -1,3 +1,7 @@
//
// File auto-generated, any modification will be overwritten
//
/** @typedef {0} Height */
/** @typedef {1} Dateindex */
/** @typedef {2} Weekindex */
@@ -72,7 +76,6 @@ export function createVecIdToIndexes() {
"first-height": [Dateindex, Difficultyepoch, Halvingepoch],
"first-monthindex": [Quarterindex, Yearindex],
"first-multisigindex": [Height],
"first-open": [Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"first-opreturnindex": [Height],
"first-p2pk33index": [Height],
"first-p2pk65index": [Height],
@@ -91,9 +94,8 @@ export function createVecIdToIndexes() {
"fixed-timestamp": [Height],
halvingepoch: [Height, Halvingepoch],
height: [Addressindex, Height, Txindex],
high: [Dateindex, Height],
high: [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"high-in-cents": [Dateindex, Height],
"high-max": [Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"inputs-count": [Txindex],
"is-coinbase": [Txindex],
"is-explicitly-rbf": [Txindex],
@@ -105,13 +107,12 @@ export function createVecIdToIndexes() {
"last-txoutindex": [Txindex],
"last-yearindex": [Decadeindex],
locktime: [Txindex],
low: [Dateindex, Height],
low: [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"low-in-cents": [Dateindex, Height],
"low-min": [Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
monthindex: [Dateindex, Monthindex],
ohlc: [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"ohlc-in-cents": [Dateindex, Height],
open: [Dateindex, Height],
open: [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"open-in-cents": [Dateindex, Height],
"outputs-count": [Txindex],
p2pk33addressbytes: [P2PK33index],