global: returns (lump sum vs dca)

This commit is contained in:
nym21
2025-05-13 01:27:21 +02:00
parent 5014e0ce3e
commit 88a0c9ea03
16 changed files with 1575 additions and 288 deletions

View File

@@ -108,7 +108,7 @@ pub fn run(config: RunConfig) -> color_eyre::Result<()> {
};
thread::Builder::new()
.stack_size(64 * 1024 * 1024)
.stack_size(128 * 1024 * 1024)
.spawn(f)?
.join()
.unwrap()

View File

@@ -333,7 +333,7 @@ impl ComputedRatioVecsFromDateIndex {
if price == Dollars::ZERO {
(i, StoredF32::from(1.0))
} else {
(i, *close / price)
(i, StoredF32::from(*close / price))
}
},
exit,

File diff suppressed because it is too large Load Diff

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

View File

@@ -81,3 +81,10 @@ impl Mul<Cents> for Cents {
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)
}
}

View File

@@ -7,7 +7,7 @@ use derive_deref::Deref;
use serde::Serialize;
use zerocopy_derive::{FromBytes, Immutable, IntoBytes, KnownLayout};
use super::{Bitcoin, Cents, Close, Sats, StoredF32};
use super::{Bitcoin, Cents, Close, Sats, StoredF32, StoredF64};
#[derive(
Debug,
@@ -27,6 +27,10 @@ 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 {
@@ -79,9 +83,23 @@ impl Add for Dollars {
}
impl Div<Dollars> for Dollars {
type Output = StoredF32;
type Output = StoredF64;
fn div(self, rhs: Dollars) -> Self::Output {
StoredF32::from((self.0 / rhs.0) as f32)
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)
}
}
@@ -92,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)]
@@ -121,6 +146,13 @@ impl Mul<StoredF32> for Dollars {
}
}
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))

View File

@@ -6,7 +6,7 @@ use zerocopy_derive::{FromBytes, Immutable, IntoBytes, KnownLayout};
use crate::CheckedSub;
use super::Dollars;
use super::{Dollars, StoredF64};
#[derive(
Debug,
@@ -36,6 +36,12 @@ impl From<f64> for StoredF32 {
}
}
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)

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))
}
}

View File

@@ -3,12 +3,14 @@ use std::{
cmp::Ordering,
f32,
fmt::Debug,
ops::{Add, Div},
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;
@@ -21,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> {
@@ -176,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,
@@ -474,6 +559,186 @@ where
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>

View File

@@ -990,12 +990,8 @@
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-top: 0.5rem;
padding-bottom: 0.5rem;
margin: -0.5rem var(--negative-main-padding);
padding: 1rem var(--main-padding);
overflow-x: auto;
min-width: 0;
font-size: var(--font-size-sm);

View File

@@ -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, LineSeriesOptions, BaselineStyleOptions} from './v5.0.6-treeshaked/types' */
/**
* @typedef {[number, number, number, number]} OHLCTuple
@@ -485,7 +485,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<LineStyleOptions & SeriesOptionsCommon>} [args.options]
* @param {DeepPartial<BaselineStyleOptions & SeriesOptionsCommon>} [args.options]
*/
addBaselineSeries({
vecId,
@@ -507,18 +507,18 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
{
lineWidth: /** @type {any} */ (1.5),
visible: defaultActive !== false,
topLineColor: colors.green(),
bottomLineColor: colors.red(),
...options,
topLineColor: options?.topLineColor ?? colors.green(),
bottomLineColor: options?.bottomLineColor ?? colors.red(),
priceLineVisible: false,
// bottomFillColor1: "transparent",
// bottomFillColor2: "transparent",
// topFillColor1: "transparent",
// topFillColor2: "transparent",
bottomFillColor1: "transparent",
bottomFillColor2: "transparent",
topFillColor1: "transparent",
topFillColor2: "transparent",
baseValue: {
price: 0,
},
lineVisible: true,
...options,
},
paneIndex,
);
@@ -545,7 +545,10 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
(paneIndex ? legendBottom : legendTop).add({
series,
colors: [colors.green, colors.red],
colors: [
() => options?.topLineColor ?? colors.green(),
() => options?.bottomLineColor ?? colors.red(),
],
name,
defaultActive,
url,

View File

@@ -238,7 +238,11 @@ export function init({
unit,
defaultActive: blueprint.defaultActive,
paneIndex,
options: blueprint.options,
options: {
...blueprint.options,
topLineColor: blueprint.colors?.[0](),
bottomLineColor: blueprint.colors?.[1](),
},
});
break;
}

View File

@@ -41,7 +41,9 @@
* "Years" |
* "Locktime" |
* "sat/vB" |
* "vB"
* "cagr" |
* "vB" |
* "performance" |
* } Unit
*/
@@ -686,6 +688,10 @@ function createUtils() {
let unit;
if (id.includes("index") || id.includes("height") || id.includes("epoch")) {
unit = "Index";
} 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")) {
@@ -726,7 +732,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 (
@@ -737,7 +744,9 @@ function createUtils() {
id.includes("ohlc") ||
id.includes("marketcap") ||
id.includes("ath") ||
id.includes("-sma")
id.includes("-sma") ||
id.endsWith("-price") ||
id.startsWith("price-")
) {
unit = "USD";
} else if (id.includes("count") || id.match(/v[1-3]/g)) {
@@ -1619,6 +1628,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,

View File

@@ -19,6 +19,7 @@
* @typedef {Object} BaselineSeriesBlueprintSpecific
* @property {"Baseline"} type
* @property {Color} [color]
* @property {[Color, Color]} [colors]
* @property {DeepPartial<BaselineStyleOptions & SeriesOptionsCommon>} [options]
* @property {Accessor<BaselineData[]>} [data]
* @typedef {BaseSeriesBlueprint & BaselineSeriesBlueprintSpecific} BaselineSeriesBlueprint
@@ -1093,6 +1094,117 @@ function createPartialOptions(colors) {
})),
],
},
{
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",
}),
],
},
.../** @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",
}),
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
key: `${key}-dca-returns`,
title: "dca",
type: "Baseline",
colors: [colors.yellow, colors.pink],
}),
],
}),
),
.../** @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`,
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",
}),
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
key: `${key}-cagr`,
title: "lump sum",
type: "Baseline",
}),
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
key: `${key}-dca-returns`,
title: "dca",
type: "Baseline",
colors: [colors.yellow, colors.pink],
}),
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
key: `${key}-dca-cagr`,
title: "dca",
type: "Baseline",
colors: [colors.yellow, colors.pink],
}),
],
}),
),
],
},
],
},
],

View File

@@ -832,7 +832,7 @@ export function init({
owner,
config: [
{
unit: "%",
unit: "percentage",
blueprints: [
{
title: "Profitable Days Ratio",

View File

@@ -56,6 +56,12 @@ export function createVecIdToIndexes() {
const YearIndex = /** @satisfies {YearIndex} */ (23);
return /** @type {const} */ ({
"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],
@@ -120,6 +126,11 @@ export function createVecIdToIndexes() {
"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],
@@ -152,6 +163,10 @@ export function createVecIdToIndexes() {
"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],
@@ -184,6 +199,10 @@ export function createVecIdToIndexes() {
"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],
@@ -280,6 +299,12 @@ export function createVecIdToIndexes() {
"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],
@@ -344,6 +369,22 @@ export function createVecIdToIndexes() {
"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],
@@ -408,6 +449,22 @@ export function createVecIdToIndexes() {
"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],
@@ -472,6 +529,12 @@ export function createVecIdToIndexes() {
"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],
@@ -764,6 +827,19 @@ export function createVecIdToIndexes() {
"p2wsh-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
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],