global: snapshot part 17

This commit is contained in:
nym21
2026-03-21 19:41:41 +01:00
parent 2991562234
commit 8859de5393
35 changed files with 567 additions and 360 deletions

View File

@@ -41,7 +41,8 @@ function volumeTree(tv, color, title) {
return [
...satsBtcUsdFullTree({
pattern: tv,
title: title("Transfer Volume"),
title,
metric: "Transfer Volume",
color,
}),
{
@@ -83,7 +84,8 @@ function volumeTree(tv, color, title) {
name: "In Profit",
tree: satsBtcUsdFullTree({
pattern: tv.inProfit,
title: title("Transfer Volume In Profit"),
title,
metric: "Transfer Volume In Profit",
color: colors.profit,
}),
},
@@ -91,7 +93,8 @@ function volumeTree(tv, color, title) {
name: "In Loss",
tree: satsBtcUsdFullTree({
pattern: tv.inLoss,
title: title("Transfer Volume In Loss"),
title,
metric: "Transfer Volume In Loss",
color: colors.loss,
}),
},
@@ -122,7 +125,7 @@ function volumeFolderWithAdjusted(activity, adjustedTransferVolume, color, title
name: "Volume",
tree: [
...volumeTree(activity.transferVolume, color, title),
{ name: "Adjusted", tree: chartsFromCount({ pattern: adjustedTransferVolume, title: title("Adjusted Transfer Volume"), unit: Unit.usd }) },
{ name: "Adjusted", tree: chartsFromCount({ pattern: adjustedTransferVolume, title, metric: "Adjusted Transfer Volume", unit: Unit.usd }) },
],
};
}
@@ -173,7 +176,7 @@ function singleRollingSoprTree(ratio, title, prefix = "") {
* @returns {PartialOptionsTree}
*/
function valueDestroyedTree(valueDestroyed, title) {
return chartsFromCount({ pattern: valueDestroyed, title: title("Value Destroyed"), unit: Unit.usd });
return chartsFromCount({ pattern: valueDestroyed, title, metric: "Value Destroyed", unit: Unit.usd });
}
/**
@@ -196,7 +199,7 @@ function valueDestroyedFolderWithAdjusted(valueDestroyed, adjusted, title) {
name: "Value Destroyed",
tree: [
...valueDestroyedTree(valueDestroyed, title),
{ name: "Adjusted", tree: chartsFromCount({ pattern: adjusted, title: title("Adjusted Value Destroyed"), unit: Unit.usd }) },
{ name: "Adjusted", tree: chartsFromCount({ pattern: adjusted, title, metric: "Adjusted Value Destroyed", unit: Unit.usd }) },
],
};
}
@@ -258,7 +261,8 @@ function singleFullActivityTree(cohort, title, volumeItem, soprFolder, valueDest
name: "Coindays Destroyed",
tree: chartsFromCount({
pattern: tree.activity.coindaysDestroyed,
title: title("Coindays Destroyed"),
title,
metric: "Coindays Destroyed",
unit: Unit.coindays,
color,
}),
@@ -267,7 +271,8 @@ function singleFullActivityTree(cohort, title, volumeItem, soprFolder, valueDest
name: "Dormancy",
tree: averagesArray({
windows: tree.activity.dormancy,
title: title("Dormancy"),
title,
metric: "Dormancy",
unit: Unit.days,
}),
},
@@ -341,7 +346,8 @@ export function createActivitySectionWithActivity({ cohort, title }) {
name: "Coindays Destroyed",
tree: chartsFromCount({
pattern: tree.activity.coindaysDestroyed,
title: title("Coindays Destroyed"),
title,
metric: "Coindays Destroyed",
unit: Unit.coindays,
color,
}),
@@ -360,7 +366,8 @@ export function createActivitySectionMinimal({ cohort, title }) {
name: "Activity",
tree: satsBtcUsdFullTree({
pattern: cohort.tree.activity.transferVolume,
title: title("Transfer Volume"),
title,
metric: "Transfer Volume",
}),
};
}

View File

@@ -52,12 +52,12 @@ function groupedUtxoCountFolder(list, all, title) {
tree: [
{
name: "Count",
title: title("UTXOs"),
title: title("UTXO Count"),
bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) =>
line({ series: tree.outputs.unspentCount.base, name, color, unit: Unit.count }),
),
},
...groupedDeltaItems(list, all, (c) => c.tree.outputs.unspentCount.delta, Unit.count, title, "UTXOs"),
...groupedDeltaItems(list, all, (c) => c.tree.outputs.unspentCount.delta, Unit.count, title, "UTXO Count"),
],
};
}
@@ -74,7 +74,8 @@ function singleDeltaItems(delta, unit, title, name) {
{
...sumsTreeBaseline({
windows: delta.absolute,
title: title(`${name} Change`),
title,
metric: `${name} Change`,
unit,
}),
name: "Change",
@@ -82,7 +83,8 @@ function singleDeltaItems(delta, unit, title, name) {
{
...rollingPercentRatioTree({
windows: delta.rate,
title: title(`${name} Growth Rate`),
title,
metric: `${name} Growth Rate`,
}),
name: "Growth Rate",
},
@@ -233,7 +235,7 @@ function countFolder(pattern, name, chartTitle, color, title) {
}),
],
},
...singleDeltaItems(pattern.delta, Unit.count, title, "Change"),
...singleDeltaItems(pattern.delta, Unit.count, title, chartTitle),
],
};
}
@@ -257,7 +259,7 @@ export function createHoldingsSection({ cohort, title }) {
title: title("Supply"),
bottom: simpleSupplySeries(supply),
},
...singleDeltaItems(supply.delta, Unit.sats, title, "Change"),
...singleDeltaItems(supply.delta, Unit.sats, title, "Supply"),
],
},
countFolder(cohort.tree.outputs.unspentCount, "UTXOs", "UTXO Count", cohort.color, title),
@@ -281,7 +283,7 @@ export function createHoldingsSectionAll({ cohort, title }) {
},
profitabilityChart(supply, title),
ownSupplyChart(supply, title),
...singleDeltaItems(supply.delta, Unit.sats, title, "Change"),
...singleDeltaItems(supply.delta, Unit.sats, title, "Supply"),
],
},
countFolder(cohort.tree.outputs.unspentCount, "UTXOs", "UTXO Count", cohort.color, title),
@@ -307,7 +309,7 @@ export function createHoldingsSectionWithRelative({ cohort, title }) {
profitabilityChart(supply, title),
circulatingChart(supply, title),
ownSupplyChart(supply, title),
...singleDeltaItems(supply.delta, Unit.sats, title, "Change"),
...singleDeltaItems(supply.delta, Unit.sats, title, "Supply"),
],
},
countFolder(cohort.tree.outputs.unspentCount, "UTXOs", "UTXO Count", cohort.color, title),
@@ -331,7 +333,7 @@ export function createHoldingsSectionWithOwnSupply({ cohort, title }) {
},
profitabilityChart(supply, title),
circulatingChart(supply, title),
...singleDeltaItems(supply.delta, Unit.sats, title, "Change"),
...singleDeltaItems(supply.delta, Unit.sats, title, "Supply"),
],
},
countFolder(cohort.tree.outputs.unspentCount, "UTXOs", "UTXO Count", cohort.color, title),
@@ -354,7 +356,7 @@ export function createHoldingsSectionWithProfitLoss({ cohort, title }) {
bottom: simpleSupplySeries(supply),
},
profitabilityChart(supply, title),
...singleDeltaItems(supply.delta, Unit.sats, title, "Change"),
...singleDeltaItems(supply.delta, Unit.sats, title, "Supply"),
],
},
countFolder(cohort.tree.outputs.unspentCount, "UTXOs", "UTXO Count", cohort.color, title),
@@ -377,7 +379,7 @@ export function createHoldingsSectionAddress({ cohort, title }) {
bottom: simpleSupplySeries(supply),
},
profitabilityChart(supply, title),
...singleDeltaItems(supply.delta, Unit.sats, title, "Change"),
...singleDeltaItems(supply.delta, Unit.sats, title, "Supply"),
],
},
countFolder(cohort.tree.outputs.unspentCount, "UTXOs", "UTXO Count", cohort.color, title),
@@ -400,7 +402,7 @@ export function createHoldingsSectionAddressAmount({ cohort, title }) {
title: title("Supply"),
bottom: simpleSupplySeries(supply),
},
...singleDeltaItems(supply.delta, Unit.sats, title, "Change"),
...singleDeltaItems(supply.delta, Unit.sats, title, "Supply"),
],
},
countFolder(cohort.tree.outputs.unspentCount, "UTXOs", "UTXO Count", cohort.color, title),
@@ -461,12 +463,12 @@ export function createGroupedHoldingsSectionAddress({ list, all, title }) {
tree: [
{
name: "Count",
title: title("Addresses"),
title: title("Address Count"),
bottom: mapCohortsWithAll(list, all, ({ name, color, addressCount }) =>
line({ series: addressCount.base, name, color, unit: Unit.count }),
),
},
...groupedDeltaItems(list, all, (c) => c.addressCount.delta, Unit.count, title, "Addresses"),
...groupedDeltaItems(list, all, (c) => c.addressCount.delta, Unit.count, title, "Address Count"),
],
},
];
@@ -492,12 +494,12 @@ export function createGroupedHoldingsSectionAddressAmount({ list, all, title })
tree: [
{
name: "Count",
title: title("Addresses"),
title: title("Address Count"),
bottom: mapCohortsWithAll(list, all, ({ name, color, addressCount }) =>
line({ series: addressCount.base, name, color, unit: Unit.count }),
),
},
...groupedDeltaItems(list, all, (c) => c.addressCount.delta, Unit.count, title, "Addresses"),
...groupedDeltaItems(list, all, (c) => c.addressCount.delta, Unit.count, title, "Address Count"),
],
},
];

View File

@@ -216,7 +216,8 @@ export function createCohortFolderAgeRangeWithMatured(cohort) {
name: "Matured",
tree: satsBtcUsdFullTree({
pattern: cohort.matured,
title: title("Matured Supply"),
title,
metric: "Matured Supply",
}),
});
return folder;
@@ -498,6 +499,7 @@ export function createGroupedAddressCohortFolder({
* @returns {PartialOptionsGroup}
*/
function singleBucketFolder({ name, color, pattern }) {
const title = formatCohortTitle(name);
return {
name,
tree: [
@@ -506,7 +508,7 @@ function singleBucketFolder({ name, color, pattern }) {
tree: [
{
name: "Value",
title: `${name}: Supply`,
title: title("Supply"),
bottom: [
...satsBtcUsd({ pattern: pattern.supply.all, name: "Total" }),
...satsBtcUsd({
@@ -522,7 +524,8 @@ function singleBucketFolder({ name, color, pattern }) {
{
...sumsTreeBaseline({
windows: pattern.supply.all.delta.absolute,
title: `${name}: Supply Change`,
title,
metric: "Supply Change",
unit: Unit.sats,
}),
name: "Change",
@@ -530,7 +533,8 @@ function singleBucketFolder({ name, color, pattern }) {
{
...rollingPercentRatioTree({
windows: pattern.supply.all.delta.rate,
title: `${name}: Supply Rate`,
title,
metric: "Supply Growth Rate",
}),
name: "Growth Rate",
},
@@ -540,7 +544,7 @@ function singleBucketFolder({ name, color, pattern }) {
},
{
name: "Realized Cap",
title: `${name}: Realized Cap`,
title: title("Realized Cap"),
bottom: [
line({
series: pattern.realizedCap.all,
@@ -557,7 +561,7 @@ function singleBucketFolder({ name, color, pattern }) {
},
{
name: "NUPL",
title: `${name}: NUPL`,
title: title("NUPL"),
bottom: [
line({ series: pattern.nupl.ratio, name, color, unit: Unit.ratio }),
],
@@ -568,24 +572,25 @@ function singleBucketFolder({ name, color, pattern }) {
/**
* @param {{ name: string, color: Color, pattern: RealizedSupplyPattern }[]} list
* @param {string} titlePrefix
* @param {string} groupTitle
* @returns {PartialOptionsTree}
*/
function groupedBucketCharts(list, titlePrefix) {
function groupedBucketCharts(list, groupTitle) {
const title = formatCohortTitle(groupTitle);
return [
{
name: "Supply",
tree: [
{
name: "All",
title: `${titlePrefix}: Supply`,
title: title("Supply"),
bottom: list.flatMap(({ name, color, pattern }) =>
satsBtcUsd({ pattern: pattern.supply.all, name, color }),
),
},
{
name: "STH",
title: `${titlePrefix}: STH Supply`,
title: title("STH Supply"),
bottom: list.flatMap(({ name, color, pattern }) =>
satsBtcUsd({ pattern: pattern.supply.sth, name, color }),
),
@@ -598,7 +603,7 @@ function groupedBucketCharts(list, titlePrefix) {
tree: [
{
name: "Compare",
title: `${titlePrefix}: Supply Change`,
title: title("Supply Change"),
bottom: ROLLING_WINDOWS.flatMap((w) =>
list.map(({ name, color, pattern }) =>
baseline({
@@ -612,7 +617,7 @@ function groupedBucketCharts(list, titlePrefix) {
},
...ROLLING_WINDOWS.map((w) => ({
name: w.name,
title: `${titlePrefix}: Supply Change (${w.title})`,
title: title(`Supply Change (${w.title})`),
bottom: list.map(({ name, color, pattern }) =>
baseline({
series: pattern.supply.all.delta.absolute[w.key],
@@ -629,7 +634,7 @@ function groupedBucketCharts(list, titlePrefix) {
tree: [
{
name: "Compare",
title: `${titlePrefix}: Supply Rate`,
title: title("Supply Growth Rate"),
bottom: ROLLING_WINDOWS.flatMap((w) =>
list.flatMap(({ name, color, pattern }) =>
percentRatio({
@@ -642,7 +647,7 @@ function groupedBucketCharts(list, titlePrefix) {
},
...ROLLING_WINDOWS.map((w) => ({
name: w.name,
title: `${titlePrefix}: Supply Rate (${w.title})`,
title: title(`Supply Growth Rate (${w.title})`),
bottom: list.flatMap(({ name, color, pattern }) =>
percentRatio({
pattern: pattern.supply.all.delta.rate[w.key],
@@ -662,7 +667,7 @@ function groupedBucketCharts(list, titlePrefix) {
tree: [
{
name: "All",
title: `${titlePrefix}: Realized Cap`,
title: title("Realized Cap"),
bottom: list.map(({ name, color, pattern }) =>
line({
series: pattern.realizedCap.all,
@@ -674,7 +679,7 @@ function groupedBucketCharts(list, titlePrefix) {
},
{
name: "STH",
title: `${titlePrefix}: STH Realized Cap`,
title: title("STH Realized Cap"),
bottom: list.map(({ name, color, pattern }) =>
line({
series: pattern.realizedCap.sth,
@@ -688,7 +693,7 @@ function groupedBucketCharts(list, titlePrefix) {
},
{
name: "NUPL",
title: `${titlePrefix}: NUPL`,
title: title("NUPL"),
bottom: list.map(({ name, color, pattern }) =>
line({ series: pattern.nupl.ratio, name, color, unit: Unit.ratio }),
),

View File

@@ -389,7 +389,8 @@ function realizedNetFolder({ netPnl, title, extraChange = [] }) {
{
...sumsTreeBaseline({
windows: mapWindows(netPnl.delta.absolute, (c) => c.usd),
title: title("Net Realized P&L Change"),
title,
metric: "Net Realized P&L Change",
unit: Unit.usd,
}),
name: "Change",
@@ -399,7 +400,8 @@ function realizedNetFolder({ netPnl, title, extraChange = [] }) {
tree: [
...rollingPercentRatioTree({
windows: netPnl.delta.rate,
title: title("Net Realized P&L Growth Rate"),
title,
metric: "Net Realized P&L Growth Rate",
}).tree,
...extraChange,
],

View File

@@ -19,8 +19,8 @@ import { ratioBottomSeries, mapCohortsWithAll, flatMapCohortsWithAll } from "../
*/
function singleDeltaItems(tree, title) {
return [
{ ...sumsTreeBaseline({ windows: mapWindows(tree.realized.cap.delta.absolute, (c) => c.usd), title: title("Realized Cap Change"), unit: Unit.usd }), name: "Change" },
{ ...rollingPercentRatioTree({ windows: tree.realized.cap.delta.rate, title: title("Realized Cap Growth Rate") }), name: "Growth Rate" },
{ ...sumsTreeBaseline({ windows: mapWindows(tree.realized.cap.delta.absolute, (c) => c.usd), title, metric: "Realized Cap Change", unit: Unit.usd }), name: "Change" },
{ ...rollingPercentRatioTree({ windows: tree.realized.cap.delta.rate, title, metric: "Realized Cap Growth Rate" }), name: "Growth Rate" },
];
}