global: snapshot

This commit is contained in:
nym21
2026-01-31 17:39:48 +01:00
parent 8dd350264a
commit ff5bb770d7
116 changed files with 13312 additions and 9530 deletions

View File

@@ -26,7 +26,13 @@ import {
createSingleSupplyRelativeOptions,
createSingleSellSideRiskSeries,
createSingleValueCreatedDestroyedSeries,
createSingleValueFlowBreakdownSeries,
createSingleCapitulationProfitFlowSeries,
createSingleSoprSeries,
createSingleInvestorPriceSeries,
createSingleInvestorPriceRatioSeries,
createInvestorPriceSeries,
createInvestorPriceRatioSeries,
} from "./shared.js";
/**
@@ -41,7 +47,7 @@ export function createAddressCohortFolder(ctx, args) {
const useGroupName = "list" in args;
const isSingle = !("list" in args);
const title = formatCohortTitle(args.title);
const title = formatCohortTitle(args.name);
return {
name: args.name || "all",
@@ -96,6 +102,21 @@ export function createAddressCohortFolder(ctx, args) {
title: title("Realized Price Ratio"),
bottom: createRealizedPriceRatioSeries(list),
},
{
name: "Investor Price",
tree: [
{
name: "Price",
title: title("Investor Price"),
top: createInvestorPriceSeries(list),
},
{
name: "Ratio",
title: title("Investor Price Ratio"),
bottom: createInvestorPriceRatioSeries(list),
},
],
},
]
: createRealizedPriceOptions(
/** @type {AddressCohortObject} */ (args),
@@ -161,6 +182,21 @@ function createRealizedPriceOptions(args, title) {
}),
],
},
{
name: "Investor Price",
tree: [
{
name: "Price",
title: title("Investor Price"),
top: createSingleInvestorPriceSeries(tree, color),
},
{
name: "Ratio",
title: title("Investor Price Ratio"),
bottom: createSingleInvestorPriceRatioSeries(tree, color),
},
],
},
];
}
@@ -365,8 +401,23 @@ function createRealizedPnlSection(ctx, args, title) {
},
{
name: "Value",
title: title("Value Created & Destroyed"),
bottom: createSingleValueCreatedDestroyedSeries(colors, args.tree),
tree: [
{
name: "Created & Destroyed",
title: title("Value Created & Destroyed"),
bottom: createSingleValueCreatedDestroyedSeries(colors, args.tree),
},
{
name: "Breakdown",
title: title("Value Flow Breakdown"),
bottom: createSingleValueFlowBreakdownSeries(colors, args.tree),
},
{
name: "Flow",
title: title("Capitulation & Profit Flow"),
bottom: createSingleCapitulationProfitFlowSeries(colors, args.tree),
},
],
},
];
}
@@ -434,6 +485,35 @@ function createUnrealizedSection(ctx, list, useGroupName, title) {
}),
]),
},
{
name: "Invested Capital",
tree: [
{
name: "In Profit",
title: title("Invested Capital In Profit"),
bottom: list.flatMap(({ color, name, tree }) => [
line({
metric: tree.unrealized.investedCapitalInProfit,
name: useGroupName ? name : "In Profit",
color: useGroupName ? color : colors.green,
unit: Unit.usd,
}),
]),
},
{
name: "In Loss",
title: title("Invested Capital In Loss"),
bottom: list.flatMap(({ color, name, tree }) => [
line({
metric: tree.unrealized.investedCapitalInLoss,
name: useGroupName ? name : "In Loss",
color: useGroupName ? color : colors.red,
unit: Unit.usd,
}),
]),
},
],
},
{
name: "Relative",
tree: [
@@ -498,6 +578,30 @@ function createUnrealizedSection(ctx, list, useGroupName, title) {
}),
]),
},
{
name: "Invested Capital In Profit",
title: title("Invested Capital In Profit"),
bottom: list.flatMap(({ color, name, tree }) => [
baseline({
metric: tree.relative.investedCapitalInProfitPct,
name: useGroupName ? name : "In Profit",
color: useGroupName ? color : colors.green,
unit: Unit.pctRcap,
}),
]),
},
{
name: "Invested Capital In Loss",
title: title("Invested Capital In Loss"),
bottom: list.flatMap(({ color, name, tree }) => [
baseline({
metric: tree.relative.investedCapitalInLossPct,
name: useGroupName ? name : "In Loss",
color: useGroupName ? color : colors.red,
unit: Unit.pctRcap,
}),
]),
},
],
},
{