mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-06-14 00:33:36 -07:00
global: cointime ratios
This commit is contained in:
+29
@@ -1,5 +1,6 @@
|
||||
import { colors } from "../../utils/colors";
|
||||
import { SeriesType } from "../enums";
|
||||
import { createRatioFolder } from "../templates/ratio";
|
||||
|
||||
export function createPresets(scale: ResourceScale) {
|
||||
return {
|
||||
@@ -59,6 +60,13 @@ export function createPresets(scale: ResourceScale) {
|
||||
},
|
||||
],
|
||||
},
|
||||
createRatioFolder({
|
||||
color: colors.liveliness,
|
||||
ratioDatasetPath: `/${scale}-to-market-price-to-active-price-ratio`,
|
||||
scale,
|
||||
title: "Active Price",
|
||||
valueDatasetPath: `/${scale}-to-active-price`,
|
||||
}),
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -78,6 +86,13 @@ export function createPresets(scale: ResourceScale) {
|
||||
},
|
||||
],
|
||||
},
|
||||
createRatioFolder({
|
||||
color: colors.vaultedness,
|
||||
ratioDatasetPath: `/${scale}-to-market-price-to-vaulted-price-ratio`,
|
||||
scale,
|
||||
title: "Vaulted Price",
|
||||
valueDatasetPath: `/${scale}-to-vaulted-price`,
|
||||
}),
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -97,6 +112,13 @@ export function createPresets(scale: ResourceScale) {
|
||||
},
|
||||
],
|
||||
},
|
||||
createRatioFolder({
|
||||
color: colors.liveliness,
|
||||
ratioDatasetPath: `/${scale}-to-market-price-to-true-market-mean-ratio`,
|
||||
scale,
|
||||
title: "True Market Mean",
|
||||
valueDatasetPath: `/${scale}-to-true-market-mean`,
|
||||
}),
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -116,6 +138,13 @@ export function createPresets(scale: ResourceScale) {
|
||||
},
|
||||
],
|
||||
},
|
||||
createRatioFolder({
|
||||
color: colors.cointimePrice,
|
||||
ratioDatasetPath: `/${scale}-to-market-price-to-cointime-price-ratio`,
|
||||
scale,
|
||||
title: "Cointime",
|
||||
valueDatasetPath: `/${scale}-to-cointime-price`,
|
||||
}),
|
||||
],
|
||||
},
|
||||
],
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
createLiquidityFolder,
|
||||
} from "./addresses";
|
||||
import { createPresets as createBlocksPresets } from "./blocks";
|
||||
import { createPresets as createCoinblocksPresets } from "./coinblocks";
|
||||
import { createPresets as createCoinblocksPresets } from "./cointime";
|
||||
import { createPresets as createHodlersPresets } from "./hodlers";
|
||||
import { createPresets as createMarketPresets } from "./market";
|
||||
import { createPresets as createMinersPresets } from "./miners";
|
||||
|
||||
@@ -2,6 +2,7 @@ import { averages } from "/src/scripts/datasets/date";
|
||||
import { colors } from "/src/scripts/utils/colors";
|
||||
|
||||
import { SeriesType } from "../../enums";
|
||||
import { createRatioFolder } from "../../templates/ratio";
|
||||
|
||||
export function createPresets(scale: ResourceScale): PartialPresetFolder {
|
||||
return {
|
||||
@@ -59,218 +60,256 @@ function createPresetFolder({
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Ratio",
|
||||
tree: [
|
||||
{
|
||||
scale,
|
||||
name: "Basic",
|
||||
description: "",
|
||||
icon: IconTablerMathXDivideY,
|
||||
title: `Market Price To ${name} Moving Average Ratio`,
|
||||
top: [
|
||||
{
|
||||
title: `SMA`,
|
||||
color,
|
||||
datasetPath: `/${scale}-to-price-${key}-sma`,
|
||||
},
|
||||
],
|
||||
bottom: [
|
||||
{
|
||||
title: `Ratio`,
|
||||
seriesType: SeriesType.Based,
|
||||
datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio`,
|
||||
options: {
|
||||
base: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: `Even`,
|
||||
color: colors.white,
|
||||
datasetPath: `/${scale}-to-1`,
|
||||
options: {
|
||||
lineStyle: 3,
|
||||
lastValueVisible: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
scale,
|
||||
name: "Averages",
|
||||
description: "",
|
||||
icon: IconTablerMathAvg,
|
||||
title: `Market Price To ${name} Moving Average Ratio Averages`,
|
||||
top: [
|
||||
{
|
||||
title: `SMA`,
|
||||
color,
|
||||
datasetPath: `/${scale}-to-price-${key}-sma`,
|
||||
},
|
||||
],
|
||||
bottom: [
|
||||
{
|
||||
title: `1Y`,
|
||||
color: colors._1y,
|
||||
datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-1y-sma`,
|
||||
},
|
||||
{
|
||||
title: `1M`,
|
||||
color: colors._1m,
|
||||
datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-1m-sma`,
|
||||
},
|
||||
{
|
||||
title: `1W`,
|
||||
color: colors._1w,
|
||||
datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-1w-sma`,
|
||||
},
|
||||
{
|
||||
title: `Raw`,
|
||||
color: colors.white,
|
||||
datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio`,
|
||||
options: {
|
||||
base: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: `Even`,
|
||||
color: colors.gray,
|
||||
datasetPath: `/${scale}-to-1`,
|
||||
options: {
|
||||
lineStyle: 3,
|
||||
lastValueVisible: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
scale,
|
||||
name: "Momentum Oscillator",
|
||||
description: "",
|
||||
icon: IconTablerWaveSine,
|
||||
title: `Market Price To ${name} Moving Average Ratio 1Y SMA Momentum Oscillator`,
|
||||
top: [
|
||||
{
|
||||
title: `SMA`,
|
||||
color,
|
||||
datasetPath: `/${scale}-to-price-${key}-sma`,
|
||||
},
|
||||
],
|
||||
bottom: [
|
||||
{
|
||||
title: `Momentum`,
|
||||
seriesType: SeriesType.Based,
|
||||
datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-1y-sma-momentum-oscillator`,
|
||||
},
|
||||
// {
|
||||
// title: `Raw`,
|
||||
// color: colors.white,
|
||||
// datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio`,
|
||||
// options: {
|
||||
// base: 1,
|
||||
// },
|
||||
// },
|
||||
{
|
||||
title: `Base`,
|
||||
color: colors.white,
|
||||
datasetPath: `/${scale}-to-0`,
|
||||
options: {
|
||||
lineStyle: 3,
|
||||
lastValueVisible: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
scale,
|
||||
name: "Percentiles",
|
||||
description: "",
|
||||
icon: IconTablerPercentage,
|
||||
title: `Market Price To ${name} Moving Average Ratio Percentiles`,
|
||||
top: [
|
||||
{
|
||||
title: `SMA`,
|
||||
color,
|
||||
datasetPath: `/${scale}-to-price-${key}-sma`,
|
||||
},
|
||||
],
|
||||
bottom: [
|
||||
{
|
||||
title: `99.9%`,
|
||||
color: colors.extremeMax,
|
||||
datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-99-9p`,
|
||||
},
|
||||
{
|
||||
title: `99.5%`,
|
||||
color: colors.extremeMiddle,
|
||||
datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-99-5p`,
|
||||
},
|
||||
{
|
||||
title: `99%`,
|
||||
color: colors.extremeMin,
|
||||
datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-99p`,
|
||||
},
|
||||
{
|
||||
title: `1%`,
|
||||
color: colors.extremeMin,
|
||||
datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-1p`,
|
||||
},
|
||||
// {
|
||||
// name: "Ratio",
|
||||
// tree: [
|
||||
// {
|
||||
// scale,
|
||||
// name: "Basic",
|
||||
// description: "",
|
||||
// icon: IconTablerMathXDivideY,
|
||||
// title: `Market Price To ${name} Moving Average Ratio`,
|
||||
// top: [
|
||||
// {
|
||||
// title: `SMA`,
|
||||
// color,
|
||||
// datasetPath: `/${scale}-to-price-${key}-sma`,
|
||||
// },
|
||||
// ],
|
||||
// bottom: [
|
||||
// {
|
||||
// title: `Ratio`,
|
||||
// seriesType: SeriesType.Based,
|
||||
// datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio`,
|
||||
// options: {
|
||||
// base: 1,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// title: `Even`,
|
||||
// color: colors.white,
|
||||
// datasetPath: `/${scale}-to-1`,
|
||||
// options: {
|
||||
// lineStyle: 3,
|
||||
// lastValueVisible: false,
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// scale,
|
||||
// name: "Averages",
|
||||
// description: "",
|
||||
// icon: IconTablerMathAvg,
|
||||
// title: `Market Price To ${name} Moving Average Ratio Averages`,
|
||||
// top: [
|
||||
// {
|
||||
// title: `SMA`,
|
||||
// color,
|
||||
// datasetPath: `/${scale}-to-price-${key}-sma`,
|
||||
// },
|
||||
// ],
|
||||
// bottom: [
|
||||
// {
|
||||
// title: `1Y`,
|
||||
// color: colors._1y,
|
||||
// datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-1y-sma`,
|
||||
// },
|
||||
// {
|
||||
// title: `1M`,
|
||||
// color: colors._1m,
|
||||
// datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-1m-sma`,
|
||||
// },
|
||||
// {
|
||||
// title: `1W`,
|
||||
// color: colors._1w,
|
||||
// datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-1w-sma`,
|
||||
// },
|
||||
// {
|
||||
// title: `Raw`,
|
||||
// color: colors.white,
|
||||
// datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio`,
|
||||
// options: {
|
||||
// base: 1,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// title: `Even`,
|
||||
// color: colors.gray,
|
||||
// datasetPath: `/${scale}-to-1`,
|
||||
// options: {
|
||||
// lineStyle: 3,
|
||||
// lastValueVisible: false,
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// scale,
|
||||
// name: "Momentum Oscillator",
|
||||
// description: "",
|
||||
// icon: IconTablerWaveSine,
|
||||
// title: `Market Price To ${name} Moving Average Ratio 1Y SMA Momentum Oscillator`,
|
||||
// top: [
|
||||
// {
|
||||
// title: `SMA`,
|
||||
// color,
|
||||
// datasetPath: `/${scale}-to-price-${key}-sma`,
|
||||
// },
|
||||
// ],
|
||||
// bottom: [
|
||||
// {
|
||||
// title: `Momentum`,
|
||||
// seriesType: SeriesType.Based,
|
||||
// datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-1y-sma-momentum-oscillator`,
|
||||
// },
|
||||
// {
|
||||
// title: `Base`,
|
||||
// color: colors.white,
|
||||
// datasetPath: `/${scale}-to-0`,
|
||||
// options: {
|
||||
// lineStyle: 3,
|
||||
// lastValueVisible: false,
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// scale,
|
||||
// name: "Top Percentiles",
|
||||
// description: "",
|
||||
// icon: IconTablerFlame,
|
||||
// title: `Market Price To ${name} Moving Average Ratio Top Percentiles`,
|
||||
// top: [
|
||||
// {
|
||||
// title: `SMA`,
|
||||
// color,
|
||||
// datasetPath: `/${scale}-to-price-${key}-sma`,
|
||||
// },
|
||||
// ],
|
||||
// bottom: [
|
||||
// {
|
||||
// title: `99.9%`,
|
||||
// color: colors.extremeMax,
|
||||
// datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-99-9p`,
|
||||
// },
|
||||
// {
|
||||
// title: `99.5%`,
|
||||
// color: colors.extremeMiddle,
|
||||
// datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-99-5p`,
|
||||
// },
|
||||
// {
|
||||
// title: `99%`,
|
||||
// color: colors.extremeMin,
|
||||
// datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-99p`,
|
||||
// },
|
||||
// {
|
||||
// title: `Raw`,
|
||||
// color: colors.white,
|
||||
// datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio`,
|
||||
// options: {
|
||||
// base: 1,
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// scale,
|
||||
// name: "Bottom Percentiles",
|
||||
// description: "",
|
||||
// icon: IconTablerIceCream,
|
||||
// title: `Market Price To ${name} Moving Average Ratio Bottom Percentiles`,
|
||||
// top: [
|
||||
// {
|
||||
// title: `SMA`,
|
||||
// color,
|
||||
// datasetPath: `/${scale}-to-price-${key}-sma`,
|
||||
// },
|
||||
// ],
|
||||
// bottom: [
|
||||
// {
|
||||
// title: `1%`,
|
||||
// color: colors.extremeMin,
|
||||
// datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-1p`,
|
||||
// },
|
||||
// {
|
||||
// title: `0.5%`,
|
||||
// color: colors.extremeMiddle,
|
||||
// datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-0-5p`,
|
||||
// },
|
||||
// {
|
||||
// title: `0.1%`,
|
||||
// color: colors.extremeMax,
|
||||
// datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-0-1p`,
|
||||
// },
|
||||
// {
|
||||
// title: `Raw`,
|
||||
// color: colors.white,
|
||||
// datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio`,
|
||||
// options: {
|
||||
// base: 1,
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// scale,
|
||||
// name: "Extreme Tops",
|
||||
// description: "",
|
||||
// icon: IconTablerRocket,
|
||||
// title: `${name} Moving Average Extreme Tops`,
|
||||
// top: [
|
||||
// {
|
||||
// title: `99.9%`,
|
||||
// color: colors.extremeMax,
|
||||
// datasetPath: `/${scale}-to-price-${key}-sma-99-9p`,
|
||||
// },
|
||||
// {
|
||||
// title: `99.5%`,
|
||||
// color: colors.extremeMiddle,
|
||||
// datasetPath: `/${scale}-to-price-${key}-sma-99-5p`,
|
||||
// },
|
||||
// {
|
||||
// title: `99%`,
|
||||
// color: colors.extremeMin,
|
||||
// datasetPath: `/${scale}-to-price-${key}-sma-99p`,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// scale,
|
||||
// name: "Extreme Bottoms",
|
||||
// description: "",
|
||||
// icon: IconTablerSubmarine,
|
||||
// title: `${name} Moving Average Extreme Bottoms`,
|
||||
// top: [
|
||||
// {
|
||||
// title: `0.1%`,
|
||||
// color: colors.extremeMax,
|
||||
// datasetPath: `/${scale}-to-price-${key}-sma-0-1p`,
|
||||
// },
|
||||
// {
|
||||
// title: `0.5%`,
|
||||
// color: colors.extremeMiddle,
|
||||
// datasetPath: `/${scale}-to-price-${key}-sma-0-5p`,
|
||||
// },
|
||||
// {
|
||||
// title: `1%`,
|
||||
// color: colors.extremeMin,
|
||||
// datasetPath: `/${scale}-to-price-${key}-sma-1p`,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
|
||||
{
|
||||
title: `0.5%`,
|
||||
color: colors.extremeMiddle,
|
||||
datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-0-5p`,
|
||||
},
|
||||
{
|
||||
title: `0.1%`,
|
||||
color: colors.extremeMax,
|
||||
datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio-0-1p`,
|
||||
},
|
||||
{
|
||||
title: `Raw`,
|
||||
color: colors.white,
|
||||
datasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio`,
|
||||
options: {
|
||||
base: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: `Even`,
|
||||
color: colors.gray,
|
||||
datasetPath: `/${scale}-to-1`,
|
||||
options: {
|
||||
lineStyle: 3,
|
||||
lastValueVisible: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
scale,
|
||||
name: "Extreme Tops",
|
||||
description: "",
|
||||
icon: IconTablerRocket,
|
||||
title: `${name} Moving Average Extreme Tops`,
|
||||
top: [
|
||||
{
|
||||
title: `99.9%`,
|
||||
color: colors.extremeMax,
|
||||
datasetPath: `/${scale}-to-price-${key}-sma-99-9p`,
|
||||
},
|
||||
{
|
||||
title: `99.5%`,
|
||||
color: colors.extremeMiddle,
|
||||
datasetPath: `/${scale}-to-price-${key}-sma-99-5p`,
|
||||
},
|
||||
{
|
||||
title: `99%`,
|
||||
color: colors.extremeMin,
|
||||
datasetPath: `/${scale}-to-price-${key}-sma-99p`,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
createRatioFolder({
|
||||
scale,
|
||||
color,
|
||||
ratioDatasetPath: `/${scale}-to-market-price-to-price-${key}-sma-ratio`,
|
||||
valueDatasetPath: `/${scale}-to-price-${key}-sma`,
|
||||
title: `${name} Moving Average`,
|
||||
}),
|
||||
],
|
||||
} satisfies PartialPresetFolder;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { colors } from "/src/scripts/utils/colors";
|
||||
|
||||
import { SeriesType } from "../../enums";
|
||||
import { createRatioFolder } from "../ratio";
|
||||
import { datasetIdToPrefix } from "./utils";
|
||||
|
||||
export function createCohortPresetRealizedFolder({
|
||||
@@ -33,6 +34,13 @@ export function createCohortPresetRealizedFolder({
|
||||
},
|
||||
],
|
||||
},
|
||||
createRatioFolder({
|
||||
scale,
|
||||
color,
|
||||
ratioDatasetPath: `/${scale}-to-market-price-to-${datasetPrefix}realized-price-ratio`,
|
||||
valueDatasetPath: `/${scale}-to-${datasetPrefix}realized-price`,
|
||||
title: `${title} Realized Price`,
|
||||
}),
|
||||
{
|
||||
scale,
|
||||
name: `Capitalization`,
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
// SeriesType,
|
||||
// } from "/src/scripts";
|
||||
|
||||
import { colors } from "../../utils/colors";
|
||||
import { SeriesType } from "../enums";
|
||||
|
||||
// // type HeightRatioKey =
|
||||
// // | `${AnyPossibleCohortKey}RealizedPrice`
|
||||
// // | "activePrice"
|
||||
@@ -14,276 +17,259 @@
|
||||
// // // type DateRatioKey = HeightRatioKey;
|
||||
// // type DateRatioKey = HeightRatioKey | `price${AverageName}MA`;
|
||||
|
||||
// export function createRatioPresetFolder<
|
||||
// Scale extends ResourceScale,
|
||||
// Key extends string,
|
||||
// >({
|
||||
// datasets,
|
||||
// scale,
|
||||
// id,
|
||||
// title,
|
||||
// datasetId,
|
||||
// color,
|
||||
// }: {
|
||||
// datasets: Record<`${Key}${RatioKey}`, Dataset<ResourceScale>>;
|
||||
// scale: Scale;
|
||||
// id: string;
|
||||
// title: string;
|
||||
// color: string;
|
||||
// datasetId: Key;
|
||||
// }): PartialPresetFolder {
|
||||
// return {
|
||||
// id: `${scale}-${id}-ratio`,
|
||||
// name: "Ratio",
|
||||
// tree: [
|
||||
// {
|
||||
// id: `${scale}-${id}-ratio-value`,
|
||||
// name: `Value`,
|
||||
// title: `Bitcoin Price to ${title} Ratio`,
|
||||
// icon: () => IconTablerDivide,
|
||||
// applyPreset(params) {
|
||||
// return applyMultipleSeries({
|
||||
// scale,
|
||||
// ...params,
|
||||
// priceScaleOptions: {
|
||||
// halved: true,
|
||||
// },
|
||||
// list: [
|
||||
// {
|
||||
// title: "Ratio",
|
||||
// seriesType: SeriesType.Based,
|
||||
// dataset: datasets[`${datasetId}Ratio`],
|
||||
// options: {
|
||||
// base: 1,
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// });
|
||||
// },
|
||||
// description: "",
|
||||
// },
|
||||
// {
|
||||
// id: `${scale}-${id}-ratio-1y-average`,
|
||||
// name: "Averages",
|
||||
// tree: [
|
||||
// {
|
||||
// id: `${scale}-${id}-ratio-averages`,
|
||||
// name: `7 Day VS. 1 Year`,
|
||||
// title: `Bitcoin Price to ${title} Ratio Moving Averages`,
|
||||
// icon: () => IconTablerSwords,
|
||||
// applyPreset(params) {
|
||||
// return applyMultipleSeries({
|
||||
// scale,
|
||||
// ...params,
|
||||
// priceScaleOptions: {
|
||||
// halved: true,
|
||||
// },
|
||||
// list: [
|
||||
// {
|
||||
// title: "Ratio",
|
||||
// seriesType: SeriesType.Based,
|
||||
// color: colors.gray,
|
||||
// dataset: datasets[`${datasetId}Ratio`],
|
||||
// options: {
|
||||
// base: 1,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// title: "7 Day Moving Average",
|
||||
// color: colors.closes7DMA,
|
||||
// dataset: datasets[`${datasetId}Ratio7DayMovingAverage`],
|
||||
// },
|
||||
// {
|
||||
// title: "1 Year Moving Average",
|
||||
// color: colors.closes1YMA,
|
||||
// dataset: datasets[`${datasetId}Ratio1YearMovingAverage`],
|
||||
// },
|
||||
// ],
|
||||
// });
|
||||
// },
|
||||
// description: "",
|
||||
// },
|
||||
// createMomentumPresetFolder({
|
||||
// datasets,
|
||||
// scale,
|
||||
// id: `${scale}-${id}-ratio-averages`,
|
||||
// title: `${title} Ratio Moving Averages`,
|
||||
// datasetId: `${datasetId}Ratio`,
|
||||
// }),
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// id: `${scale}-${id}-ratio-extremes`,
|
||||
// name: "Extremes",
|
||||
// tree: [
|
||||
// {
|
||||
// id: `${scale}-${id}-extreme-top-ratios`,
|
||||
// name: "Top Ratios",
|
||||
// description: "",
|
||||
// icon: () => IconTablerJetpack,
|
||||
// title: `${title} Extreme Top Ratios`,
|
||||
// applyPreset(params) {
|
||||
// return applyMultipleSeries({
|
||||
// scale,
|
||||
// ...params,
|
||||
// priceScaleOptions: {
|
||||
// halved: true,
|
||||
// },
|
||||
// list: [
|
||||
// {
|
||||
// id: "ratio",
|
||||
// title: "Ratio",
|
||||
// color: colors.white,
|
||||
// seriesType: SeriesType.Based,
|
||||
// dataset: datasets[`${datasetId}Ratio`],
|
||||
// options: {
|
||||
// base: 1,
|
||||
// options: {
|
||||
// baseLineColor: color,
|
||||
// baseLineVisible: true,
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// id: "99.9-percentile",
|
||||
// title: "99.9th Percentile",
|
||||
// dataset: datasets[`${datasetId}Ratio99.9Percentile`],
|
||||
// color: colors.extremeMax,
|
||||
// },
|
||||
// {
|
||||
// id: "99.5-percentile",
|
||||
// title: "99.5th Percentile",
|
||||
// color: colors.extremeMiddle,
|
||||
// dataset: datasets[`${datasetId}Ratio99.5Percentile`],
|
||||
// },
|
||||
// {
|
||||
// id: "99-percentile",
|
||||
// title: "99th Percentile",
|
||||
// color: colors.extremeMin,
|
||||
// dataset: datasets[`${datasetId}Ratio99Percentile`],
|
||||
// },
|
||||
// ],
|
||||
// });
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// id: `${scale}-${id}-extreme-bottom-ratios`,
|
||||
// name: "Bottom Ratios",
|
||||
// description: "",
|
||||
// icon: () => IconTablerScubaMask,
|
||||
// title: `${title} Extreme Bottom Ratios`,
|
||||
// applyPreset(params) {
|
||||
// return applyMultipleSeries({
|
||||
// scale,
|
||||
// ...params,
|
||||
// priceScaleOptions: {
|
||||
// halved: true,
|
||||
// },
|
||||
// list: [
|
||||
// {
|
||||
// id: "ratio",
|
||||
// title: "Ratio",
|
||||
// color: colors.white,
|
||||
// seriesType: SeriesType.Based,
|
||||
// dataset: datasets[`${datasetId}Ratio`],
|
||||
// options: {
|
||||
// base: 1,
|
||||
// options: {
|
||||
// baseLineColor: color,
|
||||
// baseLineVisible: true,
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// id: "1-percentile",
|
||||
// title: "1st Percentile",
|
||||
// color: colors.extremeMin,
|
||||
// dataset: datasets[`${datasetId}Ratio1Percentile`],
|
||||
// },
|
||||
// {
|
||||
// id: "0.5-percentile",
|
||||
// title: "0.5th Percentile",
|
||||
// color: colors.extremeMiddle,
|
||||
// dataset: datasets[`${datasetId}Ratio0.5Percentile`],
|
||||
// },
|
||||
// {
|
||||
// id: "0.1-percentile",
|
||||
// title: "0.1th Percentile",
|
||||
// color: colors.extremeMax,
|
||||
// dataset: datasets[`${datasetId}Ratio0.1Percentile`],
|
||||
// },
|
||||
// ],
|
||||
// });
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// id: `${scale}-${id}-extreme-top-prices`,
|
||||
// name: "Top Prices",
|
||||
// description: "",
|
||||
// icon: () => IconTablerRocket,
|
||||
// title: `${title} Extreme Top Prices`,
|
||||
// applyPreset(params) {
|
||||
// return applyMultipleSeries({
|
||||
// scale,
|
||||
// ...params,
|
||||
// list: [
|
||||
// {
|
||||
// id: "99.9-percentile",
|
||||
// title: "99.9th Percentile",
|
||||
// color: colors.extremeMax,
|
||||
// dataset: datasets[`${datasetId}Ratio99.9Price`],
|
||||
// },
|
||||
// {
|
||||
// id: "99.5-percentile",
|
||||
// title: "99.5th Percentile",
|
||||
// color: colors.extremeMiddle,
|
||||
// dataset: datasets[`${datasetId}Ratio99.5Price`],
|
||||
// },
|
||||
// {
|
||||
// id: "99-percentile",
|
||||
// title: "99th Percentile",
|
||||
// color: colors.extremeMin,
|
||||
// dataset: datasets[`${datasetId}Ratio99Price`],
|
||||
// },
|
||||
// ],
|
||||
// });
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// id: `${scale}-${id}-extreme-bottom-prices`,
|
||||
// name: "Bottom Prices",
|
||||
// description: "",
|
||||
// icon: () => IconTablerSubmarine,
|
||||
// title: `${title} Extreme Bottom Prices`,
|
||||
// applyPreset(params) {
|
||||
// return applyMultipleSeries({
|
||||
// scale,
|
||||
// ...params,
|
||||
// list: [
|
||||
// {
|
||||
// id: "1-percentile",
|
||||
// title: "1st Percentile",
|
||||
// color: colors.extremeMin,
|
||||
// dataset: datasets[`${datasetId}Ratio1Price`],
|
||||
// },
|
||||
// {
|
||||
// id: "0.5-percentile",
|
||||
// title: "0.5th Percentile",
|
||||
// color: colors.extremeMiddle,
|
||||
// dataset: datasets[`${datasetId}Ratio0.5Price`],
|
||||
// },
|
||||
// {
|
||||
// id: "0.1-percentile",
|
||||
// title: "0.1th Percentile",
|
||||
// color: colors.extremeMax,
|
||||
// dataset: datasets[`${datasetId}Ratio0.1Price`],
|
||||
// },
|
||||
// ],
|
||||
// });
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// ],
|
||||
// };
|
||||
// }
|
||||
export function createRatioFolder({
|
||||
scale,
|
||||
color,
|
||||
valueDatasetPath,
|
||||
ratioDatasetPath,
|
||||
title,
|
||||
}: {
|
||||
scale: ResourceScale;
|
||||
color: Color;
|
||||
valueDatasetPath: AnyDatasetPath;
|
||||
ratioDatasetPath: AnyDatasetPath;
|
||||
title: string;
|
||||
}): PartialPresetFolder {
|
||||
return {
|
||||
name: "Ratio",
|
||||
tree: [
|
||||
{
|
||||
scale,
|
||||
name: "Basic",
|
||||
description: "",
|
||||
icon: IconTablerMathXDivideY,
|
||||
title: `Market Price To ${title} Ratio`,
|
||||
top: [
|
||||
{
|
||||
title: `SMA`,
|
||||
color,
|
||||
datasetPath: valueDatasetPath,
|
||||
},
|
||||
],
|
||||
bottom: [
|
||||
{
|
||||
title: `Ratio`,
|
||||
seriesType: SeriesType.Based,
|
||||
datasetPath: ratioDatasetPath,
|
||||
options: {
|
||||
base: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: `Even`,
|
||||
color: colors.white,
|
||||
datasetPath: `/${scale}-to-1`,
|
||||
options: {
|
||||
lineStyle: 3,
|
||||
lastValueVisible: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
scale,
|
||||
name: "Averages",
|
||||
description: "",
|
||||
icon: IconTablerMathAvg,
|
||||
title: `Market Price To ${title} Ratio Averages`,
|
||||
top: [
|
||||
{
|
||||
title: `SMA`,
|
||||
color,
|
||||
datasetPath: valueDatasetPath,
|
||||
},
|
||||
],
|
||||
bottom: [
|
||||
{
|
||||
title: `1Y`,
|
||||
color: colors._1y,
|
||||
datasetPath: `${ratioDatasetPath}-1y-sma`,
|
||||
},
|
||||
{
|
||||
title: `1M`,
|
||||
color: colors._1m,
|
||||
datasetPath: `${ratioDatasetPath}-1m-sma`,
|
||||
},
|
||||
{
|
||||
title: `1W`,
|
||||
color: colors._1w,
|
||||
datasetPath: `${ratioDatasetPath}-1w-sma`,
|
||||
},
|
||||
{
|
||||
title: `Raw`,
|
||||
color: colors.white,
|
||||
datasetPath: ratioDatasetPath,
|
||||
options: {
|
||||
base: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: `Even`,
|
||||
color: colors.gray,
|
||||
datasetPath: `/${scale}-to-1`,
|
||||
options: {
|
||||
lineStyle: 3,
|
||||
lastValueVisible: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
scale,
|
||||
name: "Momentum Oscillator",
|
||||
description: "",
|
||||
icon: IconTablerWaveSine,
|
||||
title: `Market Price To ${title} Ratio 1Y SMA Momentum Oscillator`,
|
||||
top: [
|
||||
{
|
||||
title: `SMA`,
|
||||
color,
|
||||
datasetPath: valueDatasetPath,
|
||||
},
|
||||
],
|
||||
bottom: [
|
||||
{
|
||||
title: `Momentum`,
|
||||
seriesType: SeriesType.Based,
|
||||
datasetPath: `${ratioDatasetPath}-1y-sma-momentum-oscillator`,
|
||||
},
|
||||
{
|
||||
title: `Base`,
|
||||
color: colors.white,
|
||||
datasetPath: `/${scale}-to-0`,
|
||||
options: {
|
||||
lineStyle: 3,
|
||||
lastValueVisible: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
scale,
|
||||
name: "Top Percentiles",
|
||||
description: "",
|
||||
icon: IconTablerJetpack,
|
||||
title: `Market Price To ${title} Ratio Top Percentiles`,
|
||||
top: [
|
||||
{
|
||||
title: `SMA`,
|
||||
color,
|
||||
datasetPath: valueDatasetPath,
|
||||
},
|
||||
],
|
||||
bottom: [
|
||||
{
|
||||
title: `99.9%`,
|
||||
color: colors.extremeMax,
|
||||
datasetPath: `${ratioDatasetPath}-99-9p`,
|
||||
},
|
||||
{
|
||||
title: `99.5%`,
|
||||
color: colors.extremeMiddle,
|
||||
datasetPath: `${ratioDatasetPath}-99-5p`,
|
||||
},
|
||||
{
|
||||
title: `99%`,
|
||||
color: colors.extremeMin,
|
||||
datasetPath: `${ratioDatasetPath}-99p`,
|
||||
},
|
||||
{
|
||||
title: `Raw`,
|
||||
color: colors.white,
|
||||
datasetPath: ratioDatasetPath,
|
||||
options: {
|
||||
base: 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
scale,
|
||||
name: "Bottom Percentiles",
|
||||
description: "",
|
||||
icon: IconTablerScubaMask,
|
||||
title: `Market Price To ${title} Ratio Bottom Percentiles`,
|
||||
top: [
|
||||
{
|
||||
title: `SMA`,
|
||||
color,
|
||||
datasetPath: valueDatasetPath,
|
||||
},
|
||||
],
|
||||
bottom: [
|
||||
{
|
||||
title: `1%`,
|
||||
color: colors.extremeMin,
|
||||
datasetPath: `${ratioDatasetPath}-1p`,
|
||||
},
|
||||
{
|
||||
title: `0.5%`,
|
||||
color: colors.extremeMiddle,
|
||||
datasetPath: `${ratioDatasetPath}-0-5p`,
|
||||
},
|
||||
{
|
||||
title: `0.1%`,
|
||||
color: colors.extremeMax,
|
||||
datasetPath: `${ratioDatasetPath}-0-1p`,
|
||||
},
|
||||
{
|
||||
title: `Raw`,
|
||||
color: colors.white,
|
||||
datasetPath: ratioDatasetPath,
|
||||
options: {
|
||||
base: 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
scale,
|
||||
name: "Extreme Tops",
|
||||
description: "",
|
||||
icon: IconTablerRocket,
|
||||
title: `${title} Extreme Tops`,
|
||||
top: [
|
||||
{
|
||||
title: `99.9%`,
|
||||
color: colors.extremeMax,
|
||||
datasetPath: `${valueDatasetPath}-99-9p`,
|
||||
},
|
||||
{
|
||||
title: `99.5%`,
|
||||
color: colors.extremeMiddle,
|
||||
datasetPath: `${valueDatasetPath}-99-5p`,
|
||||
},
|
||||
{
|
||||
title: `99%`,
|
||||
color: colors.extremeMin,
|
||||
datasetPath: `${valueDatasetPath}-99p`,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
scale,
|
||||
name: "Extreme Bottoms",
|
||||
description: "",
|
||||
icon: IconTablerSubmarine,
|
||||
title: `${title} Extreme Bottoms`,
|
||||
top: [
|
||||
{
|
||||
title: `0.1%`,
|
||||
color: colors.extremeMax,
|
||||
datasetPath: `${valueDatasetPath}-0-1p`,
|
||||
},
|
||||
{
|
||||
title: `0.5%`,
|
||||
color: colors.extremeMiddle,
|
||||
datasetPath: `${valueDatasetPath}-0-5p`,
|
||||
},
|
||||
{
|
||||
title: `1%`,
|
||||
color: colors.extremeMin,
|
||||
datasetPath: `${valueDatasetPath}-1p`,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
Vendored
+3
@@ -128,6 +128,8 @@ declare global {
|
||||
const IconTablerFile: typeof import('~icons/tabler/file.jsx')['default']
|
||||
const IconTablerFileDescription: (typeof import("~icons/tabler/file-description.jsx"))["default"]
|
||||
const IconTablerFileShredder: typeof import('~icons/tabler/file-shredder.jsx')['default']
|
||||
const IconTablerFire: typeof import('~icons/tabler/fire.jsx')['default']
|
||||
const IconTablerFlame: typeof import('~icons/tabler/flame.jsx')['default']
|
||||
const IconTablerFolder: typeof import('~icons/tabler/folder.jsx')['default']
|
||||
const IconTablerFolderFilled: typeof import('~icons/tabler/folder-filled.jsx')['default']
|
||||
const IconTablerFolderOpen: typeof import('~icons/tabler/folder-open.jsx')['default']
|
||||
@@ -143,6 +145,7 @@ declare global {
|
||||
const IconTablerHome: typeof import('~icons/tabler/home.jsx')['default']
|
||||
const IconTablerHome2: typeof import('~icons/tabler/home2.jsx')['default']
|
||||
const IconTablerHourglassEmpty: (typeof import("~icons/tabler/hourglass-empty.jsx"))["default"]
|
||||
const IconTablerIceCream: typeof import('~icons/tabler/ice-cream.jsx')['default']
|
||||
const IconTablerInfinity: typeof import('~icons/tabler/infinity.jsx')['default']
|
||||
const IconTablerInfo: (typeof import("~icons/tabler/info.jsx"))["default"]
|
||||
const IconTablerInfoCircle: (typeof import("~icons/tabler/info-circle.jsx"))["default"]
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::{
|
||||
utils::{ONE_DAY_IN_DAYS, ONE_YEAR_IN_DAYS, THREE_MONTHS_IN_DAYS, TWO_WEEK_IN_DAYS},
|
||||
};
|
||||
|
||||
use super::{AnyDataset, ComputeData, InsertData, MinInitialStates};
|
||||
use super::{AnyDataset, ComputeData, InsertData, MinInitialStates, RatioDataset};
|
||||
|
||||
#[derive(Allocative)]
|
||||
pub struct CointimeDataset {
|
||||
@@ -17,6 +17,7 @@ pub struct CointimeDataset {
|
||||
// Computed
|
||||
pub active_cap: BiMap<f32>,
|
||||
pub active_price: BiMap<f32>,
|
||||
pub active_price_ratio: RatioDataset,
|
||||
pub active_supply: BiMap<f32>,
|
||||
pub active_supply_3m_net_change: BiMap<f32>,
|
||||
pub active_supply_net_change: BiMap<f32>,
|
||||
@@ -27,6 +28,7 @@ pub struct CointimeDataset {
|
||||
pub cointime_adjusted_yearly_inflation_rate: BiMap<f32>,
|
||||
pub cointime_cap: BiMap<f32>,
|
||||
pub cointime_price: BiMap<f32>,
|
||||
pub cointime_price_ratio: RatioDataset,
|
||||
pub cointime_value_created: BiMap<f32>,
|
||||
pub cointime_value_destroyed: BiMap<f32>,
|
||||
pub cointime_value_stored: BiMap<f32>,
|
||||
@@ -48,9 +50,11 @@ pub struct CointimeDataset {
|
||||
pub total_cointime_value_stored: BiMap<f32>,
|
||||
pub true_market_deviation: BiMap<f32>,
|
||||
pub true_market_mean: BiMap<f32>,
|
||||
pub true_market_mean_ratio: RatioDataset,
|
||||
pub true_market_net_unrealized_profit_and_loss: BiMap<f32>,
|
||||
pub vaulted_cap: BiMap<f32>,
|
||||
pub vaulted_price: BiMap<f32>,
|
||||
pub vaulted_price_ratio: RatioDataset,
|
||||
pub vaulted_supply: BiMap<f32>,
|
||||
pub vaulted_supply_net_change: BiMap<f32>,
|
||||
pub vaulted_supply_3m_net_change: BiMap<f32>,
|
||||
@@ -67,6 +71,7 @@ impl CointimeDataset {
|
||||
|
||||
active_cap: BiMap::new_bin(1, &f("active_cap")),
|
||||
active_price: BiMap::new_bin(1, &f("active_price")),
|
||||
active_price_ratio: RatioDataset::import(parent_path, "active_price")?,
|
||||
active_supply: BiMap::new_bin(1, &f("active_supply")),
|
||||
active_supply_3m_net_change: BiMap::new_bin(1, &f("active_supply_3m_net_change")),
|
||||
active_supply_net_change: BiMap::new_bin(1, &f("active_supply_net_change")),
|
||||
@@ -81,6 +86,7 @@ impl CointimeDataset {
|
||||
),
|
||||
cointime_cap: BiMap::new_bin(1, &f("cointime_cap")),
|
||||
cointime_price: BiMap::new_bin(1, &f("cointime_price")),
|
||||
cointime_price_ratio: RatioDataset::import(parent_path, "cointime_price")?,
|
||||
cointime_value_created: BiMap::new_bin(1, &f("cointime_value_created")),
|
||||
cointime_value_destroyed: BiMap::new_bin(1, &f("cointime_value_destroyed")),
|
||||
cointime_value_stored: BiMap::new_bin(1, &f("cointime_value_stored")),
|
||||
@@ -114,12 +120,14 @@ impl CointimeDataset {
|
||||
total_cointime_value_stored: BiMap::new_bin(1, &f("total_cointime_value_stored")),
|
||||
true_market_deviation: BiMap::new_bin(1, &f("true_market_deviation")),
|
||||
true_market_mean: BiMap::new_bin(1, &f("true_market_mean")),
|
||||
true_market_mean_ratio: RatioDataset::import(parent_path, "true_market_mean")?,
|
||||
true_market_net_unrealized_profit_and_loss: BiMap::new_bin(
|
||||
1,
|
||||
&f("true_market_net_unrealized_profit_and_loss"),
|
||||
),
|
||||
vaulted_cap: BiMap::new_bin(1, &f("vaulted_cap")),
|
||||
vaulted_price: BiMap::new_bin(1, &f("vaulted_price")),
|
||||
vaulted_price_ratio: RatioDataset::import(parent_path, "vaulted_price")?,
|
||||
vaulted_supply: BiMap::new_bin(1, &f("vaulted_supply")),
|
||||
vaulted_supply_3m_net_change: BiMap::new_bin(1, &f("vaulted_supply_3m_net_change")),
|
||||
vaulted_supply_net_change: BiMap::new_bin(1, &f("vaulted_supply_net_change")),
|
||||
@@ -493,8 +501,8 @@ impl AnyDataset for CointimeDataset {
|
||||
}
|
||||
|
||||
fn to_computed_bi_map_vec(&self) -> Vec<&(dyn AnyBiMap + Send + Sync)> {
|
||||
vec![
|
||||
&self.active_cap,
|
||||
let mut v = vec![
|
||||
&self.active_cap as &(dyn AnyBiMap + Send + Sync),
|
||||
&self.active_price,
|
||||
&self.active_supply,
|
||||
&self.active_supply_3m_net_change,
|
||||
@@ -535,12 +543,19 @@ impl AnyDataset for CointimeDataset {
|
||||
&self.vaulted_supply_3m_net_change,
|
||||
&self.vaultedness,
|
||||
&self.vaulting_rate,
|
||||
]
|
||||
];
|
||||
|
||||
v.append(&mut self.active_price_ratio.to_computed_bi_map_vec());
|
||||
v.append(&mut self.cointime_price_ratio.to_computed_bi_map_vec());
|
||||
v.append(&mut self.true_market_mean_ratio.to_computed_bi_map_vec());
|
||||
v.append(&mut self.vaulted_price_ratio.to_computed_bi_map_vec());
|
||||
|
||||
v
|
||||
}
|
||||
|
||||
fn to_computed_mut_bi_map_vec(&mut self) -> Vec<&mut dyn AnyBiMap> {
|
||||
vec![
|
||||
&mut self.active_cap,
|
||||
let mut v = vec![
|
||||
&mut self.active_cap as &mut dyn AnyBiMap,
|
||||
&mut self.active_price,
|
||||
&mut self.active_supply,
|
||||
&mut self.active_supply_3m_net_change,
|
||||
@@ -581,7 +596,14 @@ impl AnyDataset for CointimeDataset {
|
||||
&mut self.vaulted_supply_3m_net_change,
|
||||
&mut self.vaultedness,
|
||||
&mut self.vaulting_rate,
|
||||
]
|
||||
];
|
||||
|
||||
v.append(&mut self.active_price_ratio.to_computed_mut_bi_map_vec());
|
||||
v.append(&mut self.cointime_price_ratio.to_computed_mut_bi_map_vec());
|
||||
v.append(&mut self.true_market_mean_ratio.to_computed_mut_bi_map_vec());
|
||||
v.append(&mut self.vaulted_price_ratio.to_computed_mut_bi_map_vec());
|
||||
|
||||
v
|
||||
}
|
||||
|
||||
fn get_min_initial_states(&self) -> &MinInitialStates {
|
||||
|
||||
Reference in New Issue
Block a user