global: address -> addr rename

This commit is contained in:
nym21
2026-03-17 11:01:21 +01:00
parent 5609e6c010
commit f62943199c
141 changed files with 3788 additions and 3754 deletions

View File

@@ -21,7 +21,7 @@ import { colors } from "../../utils/colors.js";
// ============================================================================
/**
* @param {{ sent: Brk.BaseCumulativeInSumPattern, coindaysDestroyed: Brk.BaseCumulativeSumPattern<number> }} activity
* @param {{ transferVolume: TransferVolumePattern, coindaysDestroyed: CountPattern<number> }} activity
* @param {Color} color
* @param {(name: string) => string} title
* @returns {PartialOptionsTree}
@@ -35,18 +35,18 @@ function volumeAndCoinsTree(activity, color, title) {
name: "Sum",
title: title("Sent Volume"),
bottom: [
line({ series: activity.sent.base, name: "Sum", color, unit: Unit.sats }),
line({ series: activity.sent.sum._24h, name: "24h", color: colors.time._24h, unit: Unit.sats, defaultActive: false }),
line({ series: activity.sent.sum._1w, name: "1w", color: colors.time._1w, unit: Unit.sats, defaultActive: false }),
line({ series: activity.sent.sum._1m, name: "1m", color: colors.time._1m, unit: Unit.sats, defaultActive: false }),
line({ series: activity.sent.sum._1y, name: "1y", color: colors.time._1y, unit: Unit.sats, defaultActive: false }),
line({ series: activity.transferVolume.base.sats, name: "Sum", color, unit: Unit.sats }),
line({ series: activity.transferVolume.sum._24h.sats, name: "24h", color: colors.time._24h, unit: Unit.sats, defaultActive: false }),
line({ series: activity.transferVolume.sum._1w.sats, name: "1w", color: colors.time._1w, unit: Unit.sats, defaultActive: false }),
line({ series: activity.transferVolume.sum._1m.sats, name: "1m", color: colors.time._1m, unit: Unit.sats, defaultActive: false }),
line({ series: activity.transferVolume.sum._1y.sats, name: "1y", color: colors.time._1y, unit: Unit.sats, defaultActive: false }),
],
},
{
name: "Cumulative",
title: title("Sent Volume (Total)"),
bottom: [
line({ series: activity.sent.cumulative, name: "All-time", color, unit: Unit.sats }),
line({ series: activity.transferVolume.cumulative.sats, name: "All-time", color, unit: Unit.sats }),
],
},
],
@@ -79,7 +79,7 @@ function volumeAndCoinsTree(activity, color, title) {
/**
* Sent in profit/loss breakdown tree (shared by full and mid-level activity)
* @param {Brk.BaseCumulativeInSumPattern} sent
* @param {TransferVolumePattern} sent
* @param {(name: string) => string} title
* @returns {PartialOptionsTree}
*/
@@ -176,7 +176,7 @@ function sentProfitLossTree(sent, title) {
/**
* Volume and coins tree with coinyears, dormancy, and sent in profit/loss (All/STH/LTH)
* @param {Brk.CoindaysCoinyearsDormancySentPattern} activity
* @param {FullActivityPattern} activity
* @param {Color} color
* @param {(name: string) => string} title
* @returns {PartialOptionsTree}
@@ -184,7 +184,7 @@ function sentProfitLossTree(sent, title) {
function fullVolumeTree(activity, color, title) {
return [
...volumeAndCoinsTree(activity, color, title),
...sentProfitLossTree(activity.sent, title),
...sentProfitLossTree(activity.transferVolume, title),
{
name: "Coinyears Destroyed",
title: title("Coinyears Destroyed"),
@@ -203,7 +203,7 @@ function fullVolumeTree(activity, color, title) {
// ============================================================================
/**
* @param {Brk._1m1w1y24hPattern<number>} ratio
* @param {RollingWindowPattern<number>} ratio
* @param {(name: string) => string} title
* @param {string} [prefix]
* @returns {PartialOptionsTree}
@@ -248,7 +248,7 @@ function singleRollingSoprTree(ratio, title, prefix = "") {
// ============================================================================
/**
* @param {Brk._1m1w1y24hPattern6} sellSideRisk
* @param {SellSideRiskPattern} sellSideRisk
* @param {(name: string) => string} title
* @returns {PartialOptionsTree}
*/
@@ -292,8 +292,8 @@ function singleSellSideRiskTree(sellSideRisk, title) {
// ============================================================================
/**
* @param {Brk.BaseCumulativeSumPattern<number>} valueCreated
* @param {Brk.BaseCumulativeSumPattern<number>} valueDestroyed
* @param {CountPattern<number>} valueCreated
* @param {CountPattern<number>} valueDestroyed
* @param {(name: string) => string} title
* @param {string} [prefix]
* @returns {PartialOptionsTree}
@@ -370,10 +370,10 @@ function singleRollingValueTree(valueCreated, valueDestroyed, title, prefix = ""
/**
* Value section for cohorts with full realized (flows + breakdown)
* @param {Brk.BaseCumulativeDistributionRelSumValuePattern} profit
* @param {Brk.BaseCapitulationCumulativeNegativeRelSumValuePattern} loss
* @param {Brk.BaseCumulativeSumPattern<number>} valueCreated
* @param {Brk.BaseCumulativeSumPattern<number>} valueDestroyed
* @param {ProfitDetailPattern} profit
* @param {LossDetailPattern} loss
* @param {CountPattern<number>} valueCreated
* @param {CountPattern<number>} valueDestroyed
* @param {AnyFetchedSeriesBlueprint[]} extraValueSeries
* @param {PartialOptionsTree} rollingTree
* @param {(name: string) => string} title
@@ -428,8 +428,8 @@ function fullValueSection(profit, loss, valueCreated, valueDestroyed, extraValue
/**
* Simple value section (created & destroyed + rolling)
* @param {Brk.BaseCumulativeSumPattern<number>} valueCreated
* @param {Brk.BaseCumulativeSumPattern<number>} valueDestroyed
* @param {CountPattern<number>} valueCreated
* @param {CountPattern<number>} valueDestroyed
* @param {(name: string) => string} title
* @returns {PartialOptionsGroup}
*/
@@ -551,7 +551,7 @@ export function createActivitySectionWithActivity({ cohort, title }) {
name: "Activity",
tree: [
...volumeAndCoinsTree(tree.activity, color, title),
...sentProfitLossTree(tree.activity.sent, title),
...sentProfitLossTree(tree.activity.transferVolume, title),
{
name: "SOPR",
title: title("SOPR (24h)"),
@@ -564,7 +564,7 @@ export function createActivitySectionWithActivity({ cohort, title }) {
/**
* Minimal activity section for cohorts without activity field (value only)
* @param {{ cohort: CohortBasicWithMarketCap | CohortBasicWithoutMarketCap | CohortWithoutRelative | CohortAddress | AddressCohortObject, title: (name: string) => string }} args
* @param {{ cohort: CohortBasicWithMarketCap | CohortBasicWithoutMarketCap | CohortWithoutRelative | CohortAddr | AddrCohortObject, title: (name: string) => string }} args
* @returns {PartialOptionsGroup}
*/
export function createActivitySectionMinimal({ cohort, title }) {
@@ -734,7 +734,7 @@ export function createGroupedActivitySectionWithAdjusted({ list, all, title }) {
name: "Volume",
title: title("Sent Volume"),
bottom: flatMapCohortsWithAll(list, all, ({ name, color, tree }) => [
line({ series: tree.activity.sent.sum._24h, name, color, unit: Unit.sats }),
line({ series: tree.activity.transferVolume.sum._24h.sats, name, color, unit: Unit.sats }),
]),
},
{
@@ -860,7 +860,7 @@ export function createGroupedActivitySection({ list, all, title }) {
name: "Volume",
title: title("Sent Volume"),
bottom: flatMapCohortsWithAll(list, all, ({ name, color, tree }) => [
line({ series: tree.activity.sent.sum._24h, name, color, unit: Unit.sats }),
line({ series: tree.activity.transferVolume.sum._24h.sats, name, color, unit: Unit.sats }),
]),
},
{
@@ -937,7 +937,7 @@ export function createGroupedActivitySectionWithActivity({ list, all, title }) {
name: "Volume",
title: title("Sent Volume"),
bottom: flatMapCohortsWithAll(list, all, ({ name, color, tree }) => [
line({ series: tree.activity.sent.sum._24h, name, color, unit: Unit.sats }),
line({ series: tree.activity.transferVolume.sum._24h.sats, name, color, unit: Unit.sats }),
]),
},
{
@@ -967,7 +967,7 @@ export function createGroupedActivitySectionWithActivity({ list, all, title }) {
/**
* Grouped minimal activity (value only, no activity field)
* @param {{ list: readonly (UtxoCohortObject | CohortWithoutRelative | CohortAddress | AddressCohortObject)[], all: CohortAll, title: (name: string) => string }} args
* @param {{ list: readonly (UtxoCohortObject | CohortWithoutRelative | CohortAddr | AddrCohortObject)[], all: CohortAll, title: (name: string) => string }} args
* @returns {PartialOptionsGroup}
*/
export function createGroupedActivitySectionMinimal({ list, all, title }) {

View File

@@ -20,8 +20,8 @@ const isAddressable = (key) =>
export function buildCohortData() {
const utxoCohorts = brk.series.cohorts.utxo;
const addressCohorts = brk.series.cohorts.address;
const { addresses } = brk.series;
const addressCohorts = brk.series.cohorts.addr;
const { addrs } = brk.series;
const {
TERM_NAMES,
EPOCH_NAMES,
@@ -44,8 +44,8 @@ export function buildCohortData() {
color: colors.bitcoin,
tree: utxoCohorts.all,
addressCount: {
inner: addresses.funded.all,
delta: addresses.delta.all,
inner: addrs.funded.all,
delta: addrs.delta.all,
},
};
@@ -113,7 +113,7 @@ export function buildCohortData() {
title: `Addresses ${names.long}`,
color: colors.at(i, arr.length),
tree: cohort,
addressCount: cohort.addressCount,
addressCount: cohort.addrCount,
};
},
);
@@ -135,7 +135,7 @@ export function buildCohortData() {
title: `Addresses ${names.long}`,
color: colors.at(i, arr.length),
tree: cohort,
addressCount: cohort.addressCount,
addressCount: cohort.addrCount,
};
},
);
@@ -157,7 +157,7 @@ export function buildCohortData() {
title: `Addresses ${names.long}`,
color: colors.at(i, arr.length),
tree: cohort,
addressCount: cohort.addressCount,
addressCount: cohort.addrCount,
};
},
);
@@ -170,8 +170,8 @@ export function buildCohortData() {
color: colors.at(i, arr.length),
tree: utxoCohorts.type[key],
addressCount: {
inner: addresses.funded[key],
delta: addresses.delta[key],
inner: addrs.funded[key],
delta: addrs.delta[key],
},
};
});
@@ -204,11 +204,13 @@ export function buildCohortData() {
}),
);
const profitabilityProfit = entries(PROFIT_NAMES).map(([key, names], i, arr) => ({
name: names.short,
color: colors.at(i, arr.length),
pattern: profit[key],
}));
const profitabilityProfit = entries(PROFIT_NAMES).map(
([key, names], i, arr) => ({
name: names.short,
color: colors.at(i, arr.length),
pattern: profit[key],
}),
);
const profitabilityLoss = entries(LOSS_NAMES).map(([key, names], i, arr) => ({
name: names.short,

View File

@@ -2,9 +2,9 @@
* Holdings section builders
*
* Supply pattern capabilities by cohort type:
* - DeltaHalfInRelTotalPattern2 (STH/LTH): inProfit + inLoss + relToCirculating + relToOwn
* - SeriesTree_Cohorts_Utxo_All_Supply (All): inProfit + inLoss + relToOwn (no relToCirculating)
* - DeltaHalfInRelTotalPattern (AgeRange/MaxAge/Epoch): inProfit + inLoss + relToCirculating (no relToOwn)
* - DeltaHalfInRelTotalPattern2 (STH/LTH): inProfit + inLoss + toCirculating + toOwn
* - SeriesTree_Cohorts_Utxo_All_Supply (All): inProfit + inLoss + toOwn (no toCirculating)
* - DeltaHalfInRelTotalPattern (AgeRange/MaxAge/Epoch): inProfit + inLoss + toCirculating (no toOwn)
* - DeltaHalfInTotalPattern2 (Type.*): inProfit + inLoss (no rel)
* - DeltaHalfTotalPattern (Empty/UtxoAmount/AddrAmount): total + half only
*/
@@ -74,40 +74,40 @@ function fullSupplySeries(supply) {
/**
* % of Own Supply series (profit/loss relative to own supply)
* @param {{ inProfit: { relToOwn: { percent: AnySeriesPattern, ratio: AnySeriesPattern } }, inLoss: { relToOwn: { percent: AnySeriesPattern, ratio: AnySeriesPattern } } }} supply
* @param {{ inProfit: { toOwn: { percent: AnySeriesPattern, ratio: AnySeriesPattern } }, inLoss: { toOwn: { percent: AnySeriesPattern, ratio: AnySeriesPattern } } }} supply
* @returns {AnyFetchedSeriesBlueprint[]}
*/
function ownSupplyPctSeries(supply) {
return [
line({ series: supply.inProfit.relToOwn.percent, name: "In Profit", color: colors.profit, unit: Unit.pctOwn }),
line({ series: supply.inLoss.relToOwn.percent, name: "In Loss", color: colors.loss, unit: Unit.pctOwn }),
line({ series: supply.inProfit.relToOwn.ratio, name: "In Profit", color: colors.profit, unit: Unit.ratio }),
line({ series: supply.inLoss.relToOwn.ratio, name: "In Loss", color: colors.loss, unit: Unit.ratio }),
line({ series: supply.inProfit.toOwn.percent, name: "In Profit", color: colors.profit, unit: Unit.pctOwn }),
line({ series: supply.inLoss.toOwn.percent, name: "In Loss", color: colors.loss, unit: Unit.pctOwn }),
line({ series: supply.inProfit.toOwn.ratio, name: "In Profit", color: colors.profit, unit: Unit.ratio }),
line({ series: supply.inLoss.toOwn.ratio, name: "In Loss", color: colors.loss, unit: Unit.ratio }),
...priceLines({ numbers: [100, 50, 0], unit: Unit.pctOwn }),
];
}
/**
* % of Circulating Supply series (total, profit, loss)
* @param {{ relToCirculating: { percent: AnySeriesPattern }, inProfit: { relToCirculating: { percent: AnySeriesPattern } }, inLoss: { relToCirculating: { percent: AnySeriesPattern } } }} supply
* @param {{ toCirculating: { percent: AnySeriesPattern }, inProfit: { toCirculating: { percent: AnySeriesPattern } }, inLoss: { toCirculating: { percent: AnySeriesPattern } } }} supply
* @returns {AnyFetchedSeriesBlueprint[]}
*/
function circulatingSupplyPctSeries(supply) {
return [
line({
series: supply.relToCirculating.percent,
series: supply.toCirculating.percent,
name: "Total",
color: colors.default,
unit: Unit.pctSupply,
}),
line({
series: supply.inProfit.relToCirculating.percent,
series: supply.inProfit.toCirculating.percent,
name: "In Profit",
color: colors.profit,
unit: Unit.pctSupply,
}),
line({
series: supply.inLoss.relToCirculating.percent,
series: supply.inLoss.toCirculating.percent,
name: "In Loss",
color: colors.loss,
unit: Unit.pctSupply,
@@ -117,25 +117,25 @@ function circulatingSupplyPctSeries(supply) {
/**
* Ratio of Circulating Supply series (total, profit, loss)
* @param {{ relToCirculating: { ratio: AnySeriesPattern }, inProfit: { relToCirculating: { ratio: AnySeriesPattern } }, inLoss: { relToCirculating: { ratio: AnySeriesPattern } } }} supply
* @param {{ toCirculating: { ratio: AnySeriesPattern }, inProfit: { toCirculating: { ratio: AnySeriesPattern } }, inLoss: { toCirculating: { ratio: AnySeriesPattern } } }} supply
* @returns {AnyFetchedSeriesBlueprint[]}
*/
function circulatingSupplyRatioSeries(supply) {
return [
line({
series: supply.relToCirculating.ratio,
series: supply.toCirculating.ratio,
name: "Total",
color: colors.default,
unit: Unit.ratio,
}),
line({
series: supply.inProfit.relToCirculating.ratio,
series: supply.inProfit.toCirculating.ratio,
name: "In Profit",
color: colors.profit,
unit: Unit.ratio,
}),
line({
series: supply.inLoss.relToCirculating.ratio,
series: supply.inLoss.toCirculating.ratio,
name: "In Loss",
color: colors.loss,
unit: Unit.ratio,
@@ -154,7 +154,7 @@ function groupedUtxoCountChart(list, all, title) {
title: title("UTXO Count"),
bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) =>
line({
series: tree.outputs.unspentCount.inner,
series: tree.outputs.unspentCount.base,
name,
color,
unit: Unit.count,
@@ -230,7 +230,7 @@ function singleUtxoCountChart(cohort, title) {
title: title("UTXO Count"),
bottom: [
line({
series: cohort.tree.outputs.unspentCount.inner,
series: cohort.tree.outputs.unspentCount.base,
name: "UTXO Count",
color: cohort.color,
unit: Unit.count,
@@ -241,7 +241,7 @@ function singleUtxoCountChart(cohort, title) {
/**
* @param {CohortAll | CohortAddress | AddressCohortObject} cohort
* @param {CohortAll | CohortAddr | AddrCohortObject} cohort
* @param {(name: string) => string} title
* @returns {PartialChartOption}
*/
@@ -251,7 +251,7 @@ function singleAddressCountChart(cohort, title) {
title: title("Address Count"),
bottom: [
line({
series: cohort.addressCount.inner,
series: cohort.addressCount.base,
name: "Address Count",
color: cohort.color,
unit: Unit.count,
@@ -293,7 +293,7 @@ export function createHoldingsSection({ cohort, title }) {
}
/**
* Holdings for CohortAll (has inProfit/inLoss with relToOwn but no relToCirculating)
* Holdings for CohortAll (has inProfit/inLoss with toOwn but no toCirculating)
* @param {{ cohort: CohortAll, title: (name: string) => string }} args
* @returns {PartialOptionsGroup}
*/
@@ -325,7 +325,7 @@ export function createHoldingsSectionAll({ cohort, title }) {
}
/**
* Holdings with full relative series (relToCirculating + relToOwn)
* Holdings with full relative series (toCirculating + toOwn)
* For: CohortFull, CohortLongTerm (have DeltaHalfInRelTotalPattern2)
* @param {{ cohort: CohortFull | CohortLongTerm, title: (name: string) => string }} args
* @returns {PartialOptionsGroup}
@@ -367,7 +367,7 @@ export function createHoldingsSectionWithRelative({ cohort, title }) {
}
/**
* Holdings with inProfit/inLoss + relToCirculating (no relToOwn)
* Holdings with inProfit/inLoss + toCirculating (no toOwn)
* For: CohortWithAdjusted, CohortAgeRange (have DeltaHalfInRelTotalPattern)
* @param {{ cohort: CohortWithAdjusted | CohortAgeRange, title: (name: string) => string }} args
* @returns {PartialOptionsGroup}
@@ -435,8 +435,8 @@ export function createHoldingsSectionWithProfitLoss({ cohort, title }) {
}
/**
* Holdings for CohortAddress (has inProfit/inLoss but no rel, plus address count)
* @param {{ cohort: CohortAddress, title: (name: string) => string }} args
* Holdings for CohortAddr (has inProfit/inLoss but no rel, plus address count)
* @param {{ cohort: CohortAddr, title: (name: string) => string }} args
* @returns {PartialOptionsGroup}
*/
export function createHoldingsSectionAddress({ cohort, title }) {
@@ -464,7 +464,7 @@ export function createHoldingsSectionAddress({ cohort, title }) {
/**
* Holdings for address amount cohorts (no inProfit/inLoss, has address count)
* @param {{ cohort: AddressCohortObject, title: (name: string) => string }} args
* @param {{ cohort: AddrCohortObject, title: (name: string) => string }} args
* @returns {PartialOptionsGroup}
*/
export function createHoldingsSectionAddressAmount({ cohort, title }) {
@@ -495,7 +495,7 @@ export function createHoldingsSectionAddressAmount({ cohort, title }) {
// ============================================================================
/**
* @param {{ list: readonly CohortAddress[], all: CohortAll, title: (name: string) => string }} args
* @param {{ list: readonly CohortAddr[], all: CohortAll, title: (name: string) => string }} args
* @returns {PartialOptionsGroup}
*/
export function createGroupedHoldingsSectionAddress({ list, all, title }) {
@@ -541,7 +541,7 @@ export function createGroupedHoldingsSectionAddress({ list, all, title }) {
name: "Address Count",
title: title("Address Count"),
bottom: mapCohortsWithAll(list, all, ({ name, color, addressCount }) =>
line({ series: addressCount.inner, name, color, unit: Unit.count }),
line({ series: addressCount.base, name, color, unit: Unit.count }),
),
},
{
@@ -558,7 +558,7 @@ export function createGroupedHoldingsSectionAddress({ list, all, title }) {
/**
* Grouped holdings for address amount cohorts (no inProfit/inLoss, has address count)
* @param {{ list: readonly AddressCohortObject[], all: CohortAll, title: (name: string) => string }} args
* @param {{ list: readonly AddrCohortObject[], all: CohortAll, title: (name: string) => string }} args
* @returns {PartialOptionsGroup}
*/
export function createGroupedHoldingsSectionAddressAmount({
@@ -586,7 +586,7 @@ export function createGroupedHoldingsSectionAddressAmount({
name: "Address Count",
title: title("Address Count"),
bottom: mapCohortsWithAll(list, all, ({ name, color, addressCount }) =>
line({ series: addressCount.inner, name, color, unit: Unit.count }),
line({ series: addressCount.base, name, color, unit: Unit.count }),
),
},
{
@@ -695,7 +695,7 @@ export function createGroupedHoldingsSectionWithProfitLoss({
}
/**
* Grouped holdings with inProfit/inLoss + relToCirculating (no relToOwn)
* Grouped holdings with inProfit/inLoss + toCirculating (no toOwn)
* For: CohortWithAdjusted, CohortAgeRange
* @param {{ list: readonly (CohortWithAdjusted | CohortAgeRange)[], all: CohortAll, title: (name: string) => string }} args
* @returns {PartialOptionsGroup}
@@ -720,7 +720,7 @@ export function createGroupedHoldingsSectionWithOwnSupply({
),
...mapCohorts(list, ({ name, color, tree }) =>
line({
series: tree.supply.relToCirculating.percent,
series: tree.supply.toCirculating.percent,
name,
color,
unit: Unit.pctSupply,
@@ -741,7 +741,7 @@ export function createGroupedHoldingsSectionWithOwnSupply({
),
...mapCohorts(list, ({ name, color, tree }) =>
line({
series: tree.supply.inProfit.relToCirculating.percent,
series: tree.supply.inProfit.toCirculating.percent,
name,
color,
unit: Unit.pctSupply,
@@ -762,7 +762,7 @@ export function createGroupedHoldingsSectionWithOwnSupply({
),
...mapCohorts(list, ({ name, color, tree }) =>
line({
series: tree.supply.inLoss.relToCirculating.percent,
series: tree.supply.inLoss.toCirculating.percent,
name,
color,
unit: Unit.pctSupply,
@@ -785,7 +785,7 @@ export function createGroupedHoldingsSectionWithOwnSupply({
}
/**
* Grouped holdings with full relative series (relToCirculating + relToOwn)
* Grouped holdings with full relative series (toCirculating + toOwn)
* For: CohortFull, CohortLongTerm
* @param {{ list: readonly (CohortFull | CohortLongTerm)[], all: CohortAll, title: (name: string) => string }} args
* @returns {PartialOptionsGroup}
@@ -806,7 +806,7 @@ export function createGroupedHoldingsSectionWithRelative({ list, all, title }) {
),
...mapCohorts(list, ({ name, color, tree }) =>
line({
series: tree.supply.relToCirculating.percent,
series: tree.supply.toCirculating.percent,
name,
color,
unit: Unit.pctSupply,
@@ -827,7 +827,7 @@ export function createGroupedHoldingsSectionWithRelative({ list, all, title }) {
),
...mapCohorts(list, ({ name, color, tree }) =>
line({
series: tree.supply.inProfit.relToCirculating.percent,
series: tree.supply.inProfit.toCirculating.percent,
name,
color,
unit: Unit.pctSupply,
@@ -835,7 +835,7 @@ export function createGroupedHoldingsSectionWithRelative({ list, all, title }) {
),
...mapCohortsWithAll(list, all, ({ name, color, tree }) =>
line({
series: tree.supply.inProfit.relToOwn.percent,
series: tree.supply.inProfit.toOwn.percent,
name,
color,
unit: Unit.pctOwn,
@@ -857,7 +857,7 @@ export function createGroupedHoldingsSectionWithRelative({ list, all, title }) {
),
...mapCohorts(list, ({ name, color, tree }) =>
line({
series: tree.supply.inLoss.relToCirculating.percent,
series: tree.supply.inLoss.toCirculating.percent,
name,
color,
unit: Unit.pctSupply,
@@ -865,7 +865,7 @@ export function createGroupedHoldingsSectionWithRelative({ list, all, title }) {
),
...mapCohortsWithAll(list, all, ({ name, color, tree }) =>
line({
series: tree.supply.inLoss.relToOwn.percent,
series: tree.supply.inLoss.toOwn.percent,
name,
color,
unit: Unit.pctOwn,

View File

@@ -257,7 +257,7 @@ export function createCohortFolderBasicWithoutMarketCap(cohort) {
/**
* Address folder: like basic but with address count
* @param {CohortAddress} cohort
* @param {CohortAddr} cohort
* @returns {PartialOptionsGroup}
*/
export function createCohortFolderAddress(cohort) {
@@ -295,7 +295,7 @@ export function createCohortFolderWithoutRelative(cohort) {
/**
* Address amount cohort folder: has NUPL + addrCount
* @param {AddressCohortObject} cohort
* @param {AddrCohortObject} cohort
* @returns {PartialOptionsGroup}
*/
export function createAddressCohortFolder(cohort) {
@@ -515,7 +515,7 @@ export function createGroupedCohortFolderBasicWithoutMarketCap({
}
/**
* @param {CohortGroupAddress} args
* @param {CohortGroupAddr} args
* @returns {PartialOptionsGroup}
*/
export function createGroupedCohortFolderAddress({
@@ -565,7 +565,7 @@ export function createGroupedCohortFolderWithoutRelative({
}
/**
* @param {AddressCohortGroupObject} args
* @param {AddrCohortGroupObject} args
* @returns {PartialOptionsGroup}
*/
export function createGroupedAddressCohortFolder({

View File

@@ -35,8 +35,8 @@ export function createPricesSectionFull({ cohort, title }) {
top: [
price({ series: tree.realized.price, name: "Realized", color: colors.realized }),
price({ series: tree.realized.investor.price, name: "Investor", color: colors.investor }),
price({ series: tree.realized.investor.upperPriceBand, name: "I²/R", color: colors.stat.max, style: 2, defaultActive: false }),
price({ series: tree.realized.investor.lowerPriceBand, name: "R²/I", color: colors.stat.min, style: 2, defaultActive: false }),
price({ series: tree.realized.investor.investorUpperBand, name: "I²/R", color: colors.stat.max, style: 2, defaultActive: false }),
price({ series: tree.realized.investor.investorLowerBand, name: "R²/I", color: colors.stat.min, style: 2, defaultActive: false }),
],
},
{
@@ -66,8 +66,8 @@ export function createPricesSectionFull({ cohort, title }) {
/**
* Create prices section for cohorts with basic ratio patterns only
* (CohortWithAdjusted, CohortBasic, CohortAddress, CohortWithoutRelative)
* @param {{ cohort: CohortWithAdjusted | CohortBasic | CohortAddress | CohortWithoutRelative | CohortAgeRange, title: (name: string) => string }} args
* (CohortWithAdjusted, CohortBasic, CohortAddr, CohortWithoutRelative)
* @param {{ cohort: CohortWithAdjusted | CohortBasic | CohortAddr | CohortWithoutRelative | CohortAgeRange, title: (name: string) => string }} args
* @returns {PartialOptionsGroup}
*/
export function createPricesSectionBasic({ cohort, title }) {

View File

@@ -96,38 +96,38 @@ function relPnlChart(profit, loss, name, title) {
/**
* Unrealized P&L tree for All cohort
* @param {Brk.SeriesTree_Cohorts_Utxo_All_Unrealized} u
* @param {AllRelativePattern} u
* @param {(name: string) => string} title
* @returns {PartialOptionsTree}
*/
function unrealizedPnlTreeAll(u, title) {
return [
{ name: "USD", title: title("Unrealized P&L"), bottom: unrealizedUsdSeries(u) },
relPnlChart(u.profit.relToMcap, u.loss.relToMcap, "% of Mcap", title),
relPnlChart(u.profit.relToOwnGross, u.loss.relToOwnGross, "% of Own P&L", title),
relPnlChart(u.profit.toMcap, u.loss.toMcap, "% of Mcap", title),
relPnlChart(u.profit.toOwnGrossPnl, u.loss.toOwnGrossPnl, "% of Own P&L", title),
...unrealizedCumulativeRollingTree(u.profit, u.loss, title),
];
}
/**
* Unrealized P&L tree for Full cohorts (STH)
* @param {Brk.GrossInvestedLossNetNuplProfitSentimentPattern2} u
* @param {FullRelativePattern} u
* @param {(name: string) => string} title
* @returns {PartialOptionsTree}
*/
function unrealizedPnlTreeFull(u, title) {
return [
{ name: "USD", title: title("Unrealized P&L"), bottom: unrealizedUsdSeries(u) },
relPnlChart(u.profit.relToMcap, u.loss.relToMcap, "% of Mcap", title),
relPnlChart(u.profit.relToOwnMcap, u.loss.relToOwnMcap, "% of Own Mcap", title),
relPnlChart(u.profit.relToOwnGross, u.loss.relToOwnGross, "% of Own P&L", title),
relPnlChart(u.profit.toMcap, u.loss.toMcap, "% of Mcap", title),
relPnlChart(u.profit.toOwnMcap, u.loss.toOwnMcap, "% of Own Mcap", title),
relPnlChart(u.profit.toOwnGrossPnl, u.loss.toOwnGrossPnl, "% of Own P&L", title),
...unrealizedCumulativeRollingTree(u.profit, u.loss, title),
];
}
/**
* Unrealized P&L tree for LTH (loss relToMcap only)
* @param {Brk.GrossInvestedLossNetNuplProfitSentimentPattern2} u
* @param {FullRelativePattern} u
* @param {(name: string) => string} title
* @returns {PartialOptionsTree}
*/
@@ -137,17 +137,17 @@ function unrealizedPnlTreeLongTerm(u, title) {
{
name: "% of Mcap",
title: title("Unrealized Loss (% of Mcap)"),
bottom: percentRatio({ pattern: u.loss.relToMcap, name: "Loss", color: colors.loss }),
bottom: percentRatio({ pattern: u.loss.toMcap, name: "Loss", color: colors.loss }),
},
relPnlChart(u.profit.relToOwnMcap, u.loss.relToOwnMcap, "% of Own Mcap", title),
relPnlChart(u.profit.relToOwnGross, u.loss.relToOwnGross, "% of Own P&L", title),
relPnlChart(u.profit.toOwnMcap, u.loss.toOwnMcap, "% of Own Mcap", title),
relPnlChart(u.profit.toOwnGrossPnl, u.loss.toOwnGrossPnl, "% of Own P&L", title),
...unrealizedCumulativeRollingTree(u.profit, u.loss, title),
];
}
/**
* Unrealized P&L tree for mid-tier cohorts (AgeRange/MaxAge)
* @param {Brk.LossNetNuplProfitPattern} u
* @param {BasicRelativePattern} u
* @param {(name: string) => string} title
* @returns {PartialOptionsTree}
*/
@@ -232,7 +232,7 @@ function unrealizedCumulativeRollingTree(profit, loss, title) {
// ============================================================================
/**
* @param {Brk.SeriesTree_Cohorts_Utxo_All_Unrealized} u
* @param {AllRelativePattern} u
* @param {(name: string) => string} title
* @returns {PartialOptionsTree}
*/
@@ -242,13 +242,13 @@ function netUnrealizedTreeAll(u, title) {
{
name: "% of Own P&L",
title: title("Net Unrealized P&L (% of Own P&L)"),
bottom: percentRatioBaseline({ pattern: u.netPnl.relToOwnGross, name: "Net P&L" }),
bottom: percentRatioBaseline({ pattern: u.netPnl.toOwnGrossPnl, name: "Net P&L" }),
},
];
}
/**
* @param {Brk.GrossInvestedLossNetNuplProfitSentimentPattern2} u
* @param {FullRelativePattern} u
* @param {(name: string) => string} title
* @returns {PartialOptionsTree}
*/
@@ -258,19 +258,19 @@ function netUnrealizedTreeFull(u, title) {
{
name: "% of Own Mcap",
title: title("Net Unrealized P&L (% of Own Mcap)"),
bottom: percentRatioBaseline({ pattern: u.netPnl.relToOwnMcap, name: "Net P&L" }),
bottom: percentRatioBaseline({ pattern: u.netPnl.toOwnMcap, name: "Net P&L" }),
},
{
name: "% of Own P&L",
title: title("Net Unrealized P&L (% of Own P&L)"),
bottom: percentRatioBaseline({ pattern: u.netPnl.relToOwnGross, name: "Net P&L" }),
bottom: percentRatioBaseline({ pattern: u.netPnl.toOwnGrossPnl, name: "Net P&L" }),
},
];
}
/**
* Net P&L for mid-tier cohorts
* @param {Brk.LossNetNuplProfitPattern} u
* @param {BasicRelativePattern} u
* @returns {AnyFetchedSeriesBlueprint[]}
*/
function netUnrealizedMid(u) {
@@ -283,7 +283,7 @@ function netUnrealizedMid(u) {
/**
* Invested capital (Full unrealized only)
* @param {Brk.GrossInvestedLossNetNuplProfitSentimentPattern2 | Brk.SeriesTree_Cohorts_Utxo_All_Unrealized} u
* @param {FullRelativePattern | AllRelativePattern} u
* @returns {AnyFetchedSeriesBlueprint[]}
*/
function investedCapitalSeries(u) {
@@ -295,7 +295,7 @@ function investedCapitalSeries(u) {
/**
* Sentiment (Full unrealized only)
* @param {Brk.GrossInvestedLossNetNuplProfitSentimentPattern2 | Brk.SeriesTree_Cohorts_Utxo_All_Unrealized} u
* @param {FullRelativePattern | AllRelativePattern} u
* @returns {AnyFetchedSeriesBlueprint[]}
*/
function sentimentSeries(u) {
@@ -308,7 +308,7 @@ function sentimentSeries(u) {
/**
* NUPL series
* @param {Brk.BpsRatioPattern} nupl
* @param {NuplPattern} nupl
* @returns {AnyFetchedSeriesBlueprint[]}
*/
function nuplSeries(nupl) {
@@ -320,7 +320,7 @@ function nuplSeries(nupl) {
// ============================================================================
/**
* @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.SeriesTree_Cohorts_Utxo_Lth_Realized} r
* @param {RealizedPattern | LthRealizedPattern} r
* @param {(name: string) => string} title
* @returns {PartialOptionsTree}
*/
@@ -339,15 +339,15 @@ function realizedPnlSumTreeFull(r, title) {
name: "% of Rcap",
title: title("Realized P&L (% of Realized Cap)"),
bottom: [
...percentRatioBaseline({ pattern: r.profit.relToRcap, name: "Profit", color: colors.profit }),
...percentRatioBaseline({ pattern: r.loss.relToRcap, name: "Loss", color: colors.loss }),
...percentRatioBaseline({ pattern: r.profit.toRcap, name: "Profit", color: colors.profit }),
...percentRatioBaseline({ pattern: r.loss.toRcap, name: "Loss", color: colors.loss }),
],
},
];
}
/**
* @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.SeriesTree_Cohorts_Utxo_Lth_Realized} r
* @param {RealizedPattern | LthRealizedPattern} r
* @param {(name: string) => string} title
* @returns {PartialOptionsTree}
*/
@@ -357,13 +357,13 @@ function realizedNetPnlSumTreeFull(r, title) {
{
name: "% of Rcap",
title: title("Net Realized P&L (% of Realized Cap)"),
bottom: percentRatioBaseline({ pattern: r.netPnl.relToRcap, name: "Net" }),
bottom: percentRatioBaseline({ pattern: r.netPnl.toRcap, name: "Net" }),
},
];
}
/**
* @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.SeriesTree_Cohorts_Utxo_Lth_Realized} r
* @param {RealizedPattern | LthRealizedPattern} r
* @param {(name: string) => string} title
* @returns {PartialOptionsTree}
*/
@@ -382,8 +382,8 @@ function realizedPnlCumulativeTreeFull(r, title) {
name: "% of Rcap",
title: title("Cumulative Realized P&L (% of Realized Cap)"),
bottom: [
...percentRatioBaseline({ pattern: r.profit.relToRcap, name: "Profit", color: colors.profit }),
...percentRatioBaseline({ pattern: r.loss.relToRcap, name: "Loss", color: colors.loss }),
...percentRatioBaseline({ pattern: r.profit.toRcap, name: "Profit", color: colors.profit }),
...percentRatioBaseline({ pattern: r.loss.toRcap, name: "Loss", color: colors.loss }),
],
},
];
@@ -391,7 +391,7 @@ function realizedPnlCumulativeTreeFull(r, title) {
/**
* Net realized P&L delta tree (absolute + rate across all rolling windows)
* @param {Brk.BaseChangeCumulativeDeltaRelSumPattern | Brk.BaseCumulativeDeltaSumPattern} netPnl
* @param {NetPnlFullPattern | NetPnlBasicPattern} netPnl
* @param {(name: string) => string} title
* @returns {PartialOptionsGroup}
*/
@@ -439,7 +439,7 @@ function realizedNetPnlDeltaTree(netPnl, title) {
/**
* Full realized delta tree (absolute + rate + rel to mcap/rcap)
* @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.SeriesTree_Cohorts_Utxo_Lth_Realized} r
* @param {RealizedPattern | LthRealizedPattern} r
* @param {(name: string) => string} title
* @returns {PartialOptionsGroup}
*/
@@ -452,12 +452,12 @@ function realizedNetPnlDeltaTreeFull(r, title) {
{
name: "% of Mcap",
title: title("Net Realized P&L Change (% of Mcap)"),
bottom: percentRatioBaseline({ pattern: r.netPnl.change1m.relToMcap, name: "30d Change" }),
bottom: percentRatioBaseline({ pattern: r.netPnl.change1m.toMcap, name: "30d Change" }),
},
{
name: "% of Rcap",
title: title("Net Realized P&L Change (% of Rcap)"),
bottom: percentRatioBaseline({ pattern: r.netPnl.change1m.relToRcap, name: "30d Change" }),
bottom: percentRatioBaseline({ pattern: r.netPnl.change1m.toRcap, name: "30d Change" }),
},
],
};
@@ -491,7 +491,7 @@ function rollingNetRealizedTree(netPnl, title) {
/**
* Rolling realized with P/L and ratio (full realized only)
* @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.SeriesTree_Cohorts_Utxo_Lth_Realized} r
* @param {RealizedPattern | LthRealizedPattern} r
* @param {(name: string) => string} title
* @returns {PartialOptionsTree}
*/
@@ -554,8 +554,8 @@ function singleRollingRealizedTreeFull(r, title) {
/**
* Rolling realized profit/loss sums (basic — no P/L ratio)
* @param {Brk.BaseCumulativeSumPattern3} profit
* @param {Brk.BaseCumulativeSumPattern3} loss
* @param {RealizedProfitLossPattern} profit
* @param {RealizedProfitLossPattern} loss
* @param {(name: string) => string} title
* @returns {PartialOptionsTree}
*/
@@ -676,7 +676,7 @@ function investorPricePercentilesTree(percentiles, title) {
/**
* Full realized subfolder (All/STH/LTH)
* @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.SeriesTree_Cohorts_Utxo_Lth_Realized} r
* @param {RealizedPattern | LthRealizedPattern} r
* @param {(name: string) => string} title
* @returns {PartialOptionsGroup}
*/
@@ -746,7 +746,7 @@ function realizedSubfolderFull(r, title) {
{
name: "% of Rcap",
title: title("Cumulative Net P&L (% of Realized Cap)"),
bottom: percentRatioBaseline({ pattern: r.netPnl.relToRcap, name: "Net" }),
bottom: percentRatioBaseline({ pattern: r.netPnl.toRcap, name: "Net" }),
},
],
},
@@ -757,7 +757,7 @@ function realizedSubfolderFull(r, title) {
{
name: "% of Rcap",
title: title("Cumulative Peak Regret (% of Realized Cap)"),
bottom: percentRatioBaseline({ pattern: r.peakRegret.relToRcap, name: "Peak Regret" }),
bottom: percentRatioBaseline({ pattern: r.peakRegret.toRcap, name: "Peak Regret" }),
},
],
},
@@ -769,7 +769,7 @@ function realizedSubfolderFull(r, title) {
/**
* Mid realized subfolder (AgeRange/MaxAge — has netPnl + delta, no relToRcap/peakRegret)
* @param {Brk.CapLossMvrvNetPriceProfitSoprPattern} r
* @param {MidRealizedPattern} r
* @param {(name: string) => string} title
* @returns {PartialOptionsGroup}
*/
@@ -823,7 +823,7 @@ function realizedSubfolderMid(r, title) {
/**
* Basic realized subfolder (no netPnl, no relToRcap)
* @param {Brk.CapLossMvrvPriceProfitSoprPattern} r
* @param {BasicRealizedPattern} r
* @param {(name: string) => string} title
* @returns {PartialOptionsGroup}
*/
@@ -1070,8 +1070,8 @@ export function createProfitabilitySectionBasicWithInvestedCapitalPct({ cohort,
}
/**
* Section for CohortAddress (has unrealized profit/loss + NUPL, basic realized)
* @param {{ cohort: CohortAddress, title: (name: string) => string }} args
* Section for CohortAddr (has unrealized profit/loss + NUPL, basic realized)
* @param {{ cohort: CohortAddr, title: (name: string) => string }} args
* @returns {PartialOptionsGroup}
*/
export function createProfitabilitySectionAddress({ cohort, title }) {
@@ -1110,8 +1110,8 @@ export function createProfitabilitySectionAddress({ cohort, title }) {
/**
* Grouped realized P&L sum (basic — all cohorts have profit/loss)
* @template {{ name: string, color: Color, tree: { realized: { profit: Brk.BaseCumulativeSumPattern3, loss: Brk.BaseCumulativeSumPattern3 } } }} T
* @template {{ name: string, color: Color, tree: { realized: { profit: Brk.BaseCumulativeSumPattern3, loss: Brk.BaseCumulativeSumPattern3 } } }} A
* @template {{ name: string, color: Color, tree: { realized: { profit: RealizedProfitLossPattern, loss: RealizedProfitLossPattern } } }} T
* @template {{ name: string, color: Color, tree: { realized: { profit: RealizedProfitLossPattern, loss: RealizedProfitLossPattern } } }} A
* @param {readonly T[]} list
* @param {A} all
* @param {(name: string) => string} title
@@ -1165,8 +1165,8 @@ function groupedRealizedPnlSumFull(list, all, title) {
/**
* Grouped rolling realized charts (basic — profit/loss sums only)
* @template {{ name: string, color: Color, tree: { realized: { profit: Brk.BaseCumulativeSumPattern3, loss: Brk.BaseCumulativeSumPattern3 } } }} T
* @template {{ name: string, color: Color, tree: { realized: { profit: Brk.BaseCumulativeSumPattern3, loss: Brk.BaseCumulativeSumPattern3 } } }} A
* @template {{ name: string, color: Color, tree: { realized: { profit: RealizedProfitLossPattern, loss: RealizedProfitLossPattern } } }} T
* @template {{ name: string, color: Color, tree: { realized: { profit: RealizedProfitLossPattern, loss: RealizedProfitLossPattern } } }} A
* @param {readonly T[]} list
* @param {A} all
* @param {(name: string) => string} title
@@ -1218,8 +1218,8 @@ function groupedRollingRealizedChartsFull(list, all, title) {
/**
* Grouped realized subfolder (basic)
* @template {{ name: string, color: Color, tree: { realized: { profit: Brk.BaseCumulativeSumPattern3, loss: Brk.BaseCumulativeSumPattern3 } } }} T
* @template {{ name: string, color: Color, tree: { realized: { profit: Brk.BaseCumulativeSumPattern3, loss: Brk.BaseCumulativeSumPattern3 } } }} A
* @template {{ name: string, color: Color, tree: { realized: { profit: RealizedProfitLossPattern, loss: RealizedProfitLossPattern } } }} T
* @template {{ name: string, color: Color, tree: { realized: { profit: RealizedProfitLossPattern, loss: RealizedProfitLossPattern } } }} A
* @param {readonly T[]} list
* @param {A} all
* @param {(name: string) => string} title
@@ -1364,8 +1364,8 @@ function groupedRealizedSubfolderFull(list, all, title) {
/**
* Grouped unrealized P&L (USD only — for all cohorts that at least have nupl)
* @template {{ name: string, color: Color, tree: { unrealized: { nupl: Brk.BpsRatioPattern } } }} T
* @template {{ name: string, color: Color, tree: { unrealized: { nupl: Brk.BpsRatioPattern } } }} A
* @template {{ name: string, color: Color, tree: { unrealized: { nupl: NuplPattern } } }} T
* @template {{ name: string, color: Color, tree: { unrealized: { nupl: NuplPattern } } }} A
* @param {readonly T[]} list
* @param {A} all
* @param {(name: string) => string} title
@@ -1406,7 +1406,7 @@ function groupedPnlChartsWithMarketCap(list, all, title) {
name: "% of Mcap",
title: title("Unrealized Profit (% of Mcap)"),
bottom: flatMapCohortsWithAll(list, all, ({ name, color, tree }) =>
percentRatio({ pattern: tree.unrealized.profit.relToMcap, name, color }),
percentRatio({ pattern: tree.unrealized.profit.toMcap, name, color }),
),
},
],
@@ -1425,7 +1425,7 @@ function groupedPnlChartsWithMarketCap(list, all, title) {
name: "% of Mcap",
title: title("Unrealized Loss (% of Mcap)"),
bottom: flatMapCohortsWithAll(list, all, ({ name, color, tree }) =>
percentRatio({ pattern: tree.unrealized.loss.relToMcap, name, color }),
percentRatio({ pattern: tree.unrealized.loss.toMcap, name, color }),
),
},
],
@@ -1496,14 +1496,14 @@ function groupedPnlChartsLongTerm(list, all, title) {
name: "% of Own Mcap",
title: title("Unrealized Profit (% of Own Mcap)"),
bottom: flatMapCohorts(list, ({ name, color, tree }) =>
percentRatio({ pattern: tree.unrealized.profit.relToOwnMcap, name, color }),
percentRatio({ pattern: tree.unrealized.profit.toOwnMcap, name, color }),
),
},
{
name: "% of Own P&L",
title: title("Unrealized Profit (% of Own P&L)"),
bottom: flatMapCohortsWithAll(list, all, ({ name, color, tree }) =>
percentRatio({ pattern: tree.unrealized.profit.relToOwnGross, name, color }),
percentRatio({ pattern: tree.unrealized.profit.toOwnGrossPnl, name, color }),
),
},
],
@@ -1522,21 +1522,21 @@ function groupedPnlChartsLongTerm(list, all, title) {
name: "% of Mcap",
title: title("Unrealized Loss (% of Mcap)"),
bottom: flatMapCohortsWithAll(list, all, ({ name, color, tree }) =>
percentRatio({ pattern: tree.unrealized.loss.relToMcap, name, color }),
percentRatio({ pattern: tree.unrealized.loss.toMcap, name, color }),
),
},
{
name: "% of Own Mcap",
title: title("Unrealized Loss (% of Own Mcap)"),
bottom: flatMapCohorts(list, ({ name, color, tree }) =>
percentRatio({ pattern: tree.unrealized.loss.relToOwnMcap, name, color }),
percentRatio({ pattern: tree.unrealized.loss.toOwnMcap, name, color }),
),
},
{
name: "% of Own P&L",
title: title("Unrealized Loss (% of Own P&L)"),
bottom: flatMapCohortsWithAll(list, all, ({ name, color, tree }) =>
percentRatio({ pattern: tree.unrealized.loss.relToOwnGross, name, color }),
percentRatio({ pattern: tree.unrealized.loss.toOwnGrossPnl, name, color }),
),
},
],
@@ -1555,14 +1555,14 @@ function groupedPnlChartsLongTerm(list, all, title) {
name: "% of Own Mcap",
title: title("Net Unrealized P&L (% of Own Mcap)"),
bottom: flatMapCohorts(list, ({ name, color, tree }) =>
percentRatioBaseline({ pattern: tree.unrealized.netPnl.relToOwnMcap, name, color }),
percentRatioBaseline({ pattern: tree.unrealized.netPnl.toOwnMcap, name, color }),
),
},
{
name: "% of Own P&L",
title: title("Net Unrealized P&L (% of Own P&L)"),
bottom: flatMapCohortsWithAll(list, all, ({ name, color, tree }) =>
percentRatioBaseline({ pattern: tree.unrealized.netPnl.relToOwnGross, name, color }),
percentRatioBaseline({ pattern: tree.unrealized.netPnl.toOwnGrossPnl, name, color }),
),
},
],

View File

@@ -52,7 +52,7 @@ export function createValuationSectionFull({ cohort, title }) {
{
name: "% of Own Mcap",
title: title("Realized Cap (% of Own Mcap)"),
bottom: percentRatioBaseline({ pattern: tree.realized.cap.relToOwnMcap, name: "Rel. to Own M.Cap", color }),
bottom: percentRatioBaseline({ pattern: tree.realized.cap.toOwnMcap, name: "Rel. to Own M.Cap", color }),
},
],
},
@@ -76,8 +76,8 @@ export function createValuationSectionFull({ cohort, title }) {
/**
* Create valuation section for cohorts with basic ratio patterns
* (CohortWithAdjusted, CohortBasic, CohortAddress, CohortWithoutRelative)
* @param {{ cohort: CohortWithAdjusted | CohortBasic | CohortAddress | CohortWithoutRelative, title: (name: string) => string }} args
* (CohortWithAdjusted, CohortBasic, CohortAddr, CohortWithoutRelative)
* @param {{ cohort: CohortWithAdjusted | CohortBasic | CohortAddr | CohortWithoutRelative, title: (name: string) => string }} args
* @returns {PartialOptionsGroup}
*/
export function createValuationSection({ cohort, title }) {
@@ -201,7 +201,7 @@ export function createGroupedValuationSectionWithOwnMarketCap({
name: "% of Own Mcap",
title: title("Realized Cap (% of Own Mcap)"),
bottom: flatMapCohortsWithAll(list, all, ({ name, color, tree }) =>
percentRatio({ pattern: tree.realized.cap.relToOwnMcap, name, color }),
percentRatio({ pattern: tree.realized.cap.toOwnMcap, name, color }),
),
},
],