Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/day-simulator/DayDeploymentInputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export default function DayDeploymentInputs({
{ inputId: "restockHurdle", label: "Restock hurdle", unit: "bps", value: "", state: entered("restockHurdle") },
{ inputId: "maximumDiscount", label: "Maximum discount", unit: "bps", value: "", state: entered("maximumDiscount") },
{ inputId: "maximumPremium", label: "Maximum premium", unit: "bps", value: "", state: entered("maximumPremium") },
{ inputId: "depthAtNav", label: "Depth at NAV", value: "", state: entered("depthAtNav") },
{ inputId: "depthAtNav", label: "Depth at NAV", unit: "bps", value: "", state: entered("depthAtNav") },
{ inputId: "reinvestmentSlippageTolerance", label: "Reinvestment slippage tolerance", unit: "bps", value: "", state: entered("reinvestmentSlippageTolerance") },
]}
onInputChange={onDeploymentInputChange}
Expand Down
51 changes: 35 additions & 16 deletions components/day-v3/DayV3Deployment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ import type {
} from "@/lib/day-v3/pool-design";
import type { DayV3ExpiryPolicy, DayV3Goals } from "@/lib/day-v3/types";
import type { DayV3YieldCurveDesign } from "@/lib/day-v3/yield-curves";
import {
dayV3DepthAtNavBps,
dayV3MaximumDiscountBps,
} from "@/lib/day-v3/exit-units";
import { cn } from "@/lib/utils";

const DEPLOY_URL = "https://www.royco.org/deploy-market";
Expand Down Expand Up @@ -75,8 +79,8 @@ function Row({ label, value }: { label: string; value: string }) {
const shown = (value: number | null, suffix = "") =>
value === null ? "Unresolved" : `${value.toFixed(2)}${suffix}`;

const shownDollars = (value: number | null, suffix = "") =>
value === null ? "Unresolved" : `$${value.toFixed(2)}${suffix}`;
const shownBps = (value: number | null) =>
value === null ? "Unresolved" : `${value.toFixed(0)} bps`;

function DayV3Deployment({
exit,
Expand Down Expand Up @@ -169,16 +173,16 @@ function DayV3Deployment({
missing: "Enter how often Senior’s value is published.",
},
{
label: "Immediate exit amount",
label: "Depth at NAV",
ready: goals.immediateExitSharePct !== null,
scope: "v3-handoff" as const,
missing: "Choose how much of every $100 Senior can sell at once.",
missing: "Choose the Senior depth available at NAV in basis points.",
},
{
label: "Minimum exit payout",
label: "Maximum discount",
ready: goals.minimumProceedsPer100 !== null,
scope: "v3-handoff" as const,
missing: "Choose the lowest acceptable payout per $100 sold.",
missing: "Choose the maximum discount to NAV in basis points.",
},
{
label: "Deployment target",
Expand Down Expand Up @@ -281,8 +285,8 @@ function DayV3Deployment({
"External spread assumption",
"Fixed-Term Grace Period",
"NAV refresh cadence",
"Immediate exit amount",
"Minimum exit payout",
"Depth at NAV",
"Maximum discount",
"Deployment target",
"Protected Exit trigger",
"Protected Exit bonus",
Expand Down Expand Up @@ -333,8 +337,8 @@ function DayV3Deployment({
return "#day-v3-protection-inputs";
if (
[
"Immediate exit amount",
"Minimum exit payout",
"Depth at NAV",
"Maximum discount",
"Canonical pool design",
"Minimum Liquidity",
].includes(label)
Expand Down Expand Up @@ -637,12 +641,20 @@ function DayV3Deployment({
value={shown(goals.recoveryDays, " days")}
/>
<Row
label="Immediate exit"
value={shownDollars(goals.immediateExitSharePct, " / $100")}
label="Depth at NAV"
value={shownBps(
goals.immediateExitSharePct === null
? null
: dayV3DepthAtNavBps(goals.immediateExitSharePct),
)}
/>
<Row
label="Minimum payout"
value={shownDollars(goals.minimumProceedsPer100, " / $100")}
label="Maximum discount"
value={shownBps(
goals.minimumProceedsPer100 === null
? null
: dayV3MaximumDiscountBps(goals.minimumProceedsPer100),
)}
/>
</section>

Expand All @@ -662,9 +674,16 @@ function DayV3Deployment({
/>
<Row
label="Maximum Discount"
value={shown(exit.maximumDiscountPct, "%")}
value={shownBps(
exit.maximumDiscountPct === null
? null
: exit.maximumDiscountPct * 100,
)}
/>
<Row
label="E-CLP concentration"
value={shown(exit.lambda, " λ")}
/>
<Row label="Depth at NAV" value={shown(exit.lambda, " λ")} />
<Row
label="Maximum Premium"
value={shown(exit.maximumPremiumBps, " bps")}
Expand Down
4 changes: 2 additions & 2 deletions components/day-v3/DayV3DesignOutcome.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ assert.match(markup, /\$5\.0 at once/);
assert.match(markup, /Payout floor/);
assert.match(markup, /\$99/);
assert.match(markup, /Needs changes/);
assert.match(markup, /reducing exit size/);
assert.match(markup, /lowering the payout floor/);
assert.match(markup, /reducing depth at NAV/);
assert.match(markup, /allowing a larger maximum discount/);
assert.match(
markup,
/shortening conversion time or lowering the external spread assumption/,
Expand Down
4 changes: 2 additions & 2 deletions components/day-v3/DayV3DesignOutcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default function DayV3DesignOutcome({
className="text-[10.5px] font-semibold underline underline-offset-4"
href="#day-v3-exit-inputs"
>
reducing exit size
reducing depth at NAV
</a>
<span aria-hidden="true" className="text-[var(--tertiary)]">
·
Expand All @@ -116,7 +116,7 @@ export default function DayV3DesignOutcome({
className="text-[10.5px] font-semibold underline underline-offset-4"
href="#day-v3-exit-inputs"
>
lowering the payout floor
allowing a larger maximum discount
</a>
<span aria-hidden="true" className="text-[var(--tertiary)]">
·
Expand Down
44 changes: 26 additions & 18 deletions components/day-v3/DayV3ExitModel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ const resolvedMarkup = renderToStaticMarkup(

assert.match(resolvedMarkup, /data-model-state="recommended"/);
assert.match(resolvedMarkup, /data-model-source="canonical-rwa-eclp-service"/);
// The four labels the comparison is made of. The "/ $100" each one carried is
// gone — the card's own note already says "per $100 Senior", so every label
// restated the basis a fourth time.
assert.match(resolvedMarkup, /Sale you selected/);
assert.match(resolvedMarkup, /Capacity the pool has/);
assert.match(resolvedMarkup, /Payout floor you set/);
assert.match(resolvedMarkup, /Lowest the pool pays/);
// Issuer goals and modeled results use the same bps units on both comparisons.
assert.match(resolvedMarkup, /Depth at NAV you set/);
assert.match(resolvedMarkup, /Depth the pool has/);
assert.match(resolvedMarkup, /Maximum discount you set/);
assert.match(resolvedMarkup, /Maximum discount the pool has/);
assert.match(resolvedMarkup, /1000 bps/);
assert.match(resolvedMarkup, /500 bps/);
assert.match(resolvedMarkup, /380 bps/);
assert.match(resolvedMarkup, /Proceeds: \$9\.62 after the live swap fee/);
// The swap fee, minimum liquidity and maximum discount are pool terms, not
// results of this comparison, and the cards that depend on them state them.
Expand Down Expand Up @@ -85,9 +86,9 @@ assert.match(
);
assert.match(
illustrativeMarkup,
/Shows how the selected exit size and payout affect one trade/,
/Shows how the selected depth and maximum discount affect one trade/,
);
assert.match(illustrativeMarkup, /Capacity the pool has/);
assert.match(illustrativeMarkup, /Depth the pool has/);
assert.match(illustrativeMarkup, /Proceeds: \$9\.62 after the modeled swap fee/);
assert.doesNotMatch(illustrativeMarkup, />—</);

Expand Down Expand Up @@ -141,7 +142,8 @@ assert.match(
/data-model-source="issuer-goal-no-immediate-exit"/,
);
assert.match(disabledMarkup, /no SLP or pool execution/);
assert.match(disabledMarkup, /Immediate exit/);
assert.match(disabledMarkup, /Depth at NAV/);
assert.match(disabledMarkup, />0 bps</);
assert.match(disabledMarkup, />\$0\.00</);
assert.match(disabledMarkup, />0\.00%?</);
assert.doesNotMatch(disabledMarkup, /Swap fee:/);
Expand Down Expand Up @@ -308,7 +310,7 @@ assert.match(
assert.doesNotMatch(goalsMarkup, /drop → .*coverage/i);
assert.match(
goalsMarkup,
/\$10\.0 immediate exit → \$12\.4 SLP · \$9\.6 proceeds · \$95\.0 floor/,
/1000 bps depth at NAV → \$12\.4 SLP · \$9\.6 proceeds · 500 bps maximum discount/,
);
assert.equal(
(goalsMarkup.match(/Section status: Set/g) ?? []).length,
Expand Down Expand Up @@ -337,8 +339,10 @@ assert.doesNotMatch(goalsMarkup, /Restock hurdle/);
assert.doesNotMatch(goalsMarkup, /day-v3-deployment-setup-inputs/);
assert.doesNotMatch(goalsMarkup, /day-v3-premium-inputs/);
assert.doesNotMatch(goalsMarkup, /day-v3-protected-exit-inputs/);
assert.match(goalsMarkup, /Out of every \$100 Senior, how much should be sellable/);
assert.match(goalsMarkup, /least a seller should receive for \$100 Senior/);
assert.match(goalsMarkup, /How much Senior depth should be available at NAV/);
assert.match(goalsMarkup, /What is the maximum discount to NAV/);
assert.match(goalsMarkup, /value="1000"/);
assert.match(goalsMarkup, /value="500"/);
// The input sections no longer restate results. SLP funding and Minimum
// Liquidity belong to the capital stack, the payout floor and proceeds to the
// exit model; repeating them beside the controls made a reader check two
Expand All @@ -358,9 +362,9 @@ for (const moved of [
// numbers have not simply vanished from this surface.
assert.match(
goalsMarkup,
/\$10\.0 immediate exit → \$12\.4 SLP · \$9\.6 proceeds · \$95\.0 floor/,
/1000 bps depth at NAV → \$12\.4 SLP · \$9\.6 proceeds · 500 bps maximum discount/,
);
assert.doesNotMatch(goalsMarkup, /Maximum discount/);
assert.doesNotMatch(goalsMarkup, /of \$100/);
assert.doesNotMatch(goalsMarkup, /See .*impact/i);

// The pool's swap fee is the issuer's to set, with an inherited default. An
Expand Down Expand Up @@ -501,10 +505,14 @@ assert.match(restockMarkup, /data-model-source="shared-day-engine-illustrative-d
assert.match(restockMarkup, /illustrative pool/);
// The band the payout floor set is named, because it is the reason the
// discount is what it is.
assert.match(restockMarkup, /5\.00% maximum discount/);
assert.match(restockMarkup, /is set by your payout floor/);
assert.match(restockMarkup, /500 bps maximum discount/);
assert.match(restockMarkup, /is set by your maximum discount/);
assert.match(restockMarkup, /Buys Senior below NAV/);
assert.match(restockMarkup, /They keep/);
assert.match(restockMarkup, /annual restock hurdle rate/);
assert.match(restockMarkup, /Restock hurdle cleared/);
assert.match(restockMarkup, /Margin above restock hurdle/);
assert.doesNotMatch(restockMarkup, /cost of capital/i);
assert.doesNotMatch(restockMarkup, /break[- ]even/i);

// A live template solved its own band; saying the payout floor set it named the
// wrong pool, and it was named beside quotes taken off the template's curve.
Expand Down
65 changes: 47 additions & 18 deletions components/day-v3/DayV3ExitModel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import type { DayV3ExitView } from "@/components/day-v3/DayV3Goals";
import DayV3DocsLink from "@/components/day-v3/DayV3DocsLink";
import {
dayV3DepthAtNavBps,
dayV3MaximumDiscountBps,
} from "@/lib/day-v3/exit-units";
import {
Card,
CardContent,
Expand All @@ -13,19 +17,26 @@ type MaybeNumber = number | null;
const dollars = (value: MaybeNumber, digits = 1) =>
value === null ? "—" : `$${value.toFixed(digits)}`;

const width = (value: MaybeNumber) =>
value === null ? "0%" : `${Math.max(0, Math.min(100, value))}%`;
const width = (value: MaybeNumber, max: number) =>
value === null
? "0%"
: `${Math.max(0, Math.min(100, (value / max) * 100))}%`;

const basisPoints = (value: MaybeNumber) =>
value === null ? "—" : `${value.toFixed(0)} bps`;

function ComparisonBar({
requested,
requestedLabel,
modeled,
modeledLabel,
max,
}: {
requested: MaybeNumber;
requestedLabel: string;
modeled: MaybeNumber;
modeledLabel: string;
max: number;
}) {
return (
<div className="flex flex-col gap-2">
Expand All @@ -34,7 +45,7 @@ function ComparisonBar({
{requestedLabel}
</span>
<span className="font-mono tabular-nums text-[var(--tertiary)]">
{dollars(requested)}
{basisPoints(requested)}
</span>
</div>
<div
Expand All @@ -43,19 +54,19 @@ function ComparisonBar({
>
<span
className="absolute inset-y-0 left-0 rounded-full bg-[color-mix(in_srgb,var(--theme-navy)_32%,transparent)]"
style={{ width: width(requested) }}
style={{ width: width(requested, max) }}
/>
<span
className="absolute inset-y-[3px] left-0 rounded-full bg-[var(--theme-green)]"
style={{ width: width(modeled) }}
style={{ width: width(modeled, max) }}
/>
</div>
<div className="flex items-baseline justify-between gap-3 text-[10.5px]">
<span className="font-semibold text-[var(--foreground)]">
{modeledLabel}
</span>
<span className="font-mono font-semibold tabular-nums">
{dollars(modeled)}
{basisPoints(modeled)}
</span>
</div>
</div>
Expand Down Expand Up @@ -126,7 +137,7 @@ export default function DayV3ExitModel({
{disabled
? "Immediate Senior exit is off, so this design has no SLP or pool execution."
: illustrative
? "Shows how the selected exit size and payout affect one trade, per $100 Senior."
? "Shows how the selected depth and maximum discount affect one trade."
: "What you asked for against what the pool delivers, per $100 Senior."}
</CardNote>
</CardHeader>
Expand All @@ -135,26 +146,44 @@ export default function DayV3ExitModel({
{!disabled ? (
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
<ComparisonBar
requested={promisedExitSharePct}
requestedLabel="Sale you selected"
modeled={modeled ? exit.sellablePer100 : null}
modeledLabel="Capacity the pool has"
requested={
promisedExitSharePct === null
? null
: dayV3DepthAtNavBps(promisedExitSharePct)
}
requestedLabel="Depth at NAV you set"
modeled={
modeled && exit.sellablePer100 !== null
? dayV3DepthAtNavBps(exit.sellablePer100)
: null
}
modeledLabel="Depth the pool has"
max={10_000}
/>
<ComparisonBar
requested={minimumProceedsPer100}
requestedLabel="Payout floor you set"
modeled={modeled ? exit.lowestPayoutPer100 : null}
modeledLabel="Lowest the pool pays"
requested={
minimumProceedsPer100 === null
? null
: dayV3MaximumDiscountBps(minimumProceedsPer100)
}
requestedLabel="Maximum discount you set"
modeled={
modeled && exit.lowestPayoutPer100 !== null
? dayV3MaximumDiscountBps(exit.lowestPayoutPer100)
: null
}
modeledLabel="Maximum discount the pool has"
max={10_000}
/>
</div>
) : null}

{disabled ? (
<div className="grid grid-cols-1 gap-3 sm:grid-cols-3">
<Outcome
label="Immediate exit"
label="Depth at NAV"
note="no immediate pool exit"
value="$0.00"
value="0 bps"
/>
<Outcome
label="SLP required"
Expand All @@ -173,7 +202,7 @@ export default function DayV3ExitModel({
Complete the exit terms above
</strong>
<p className="mx-auto mt-1 max-w-[58ch] text-[11px] leading-snug text-[var(--secondary)]">
Choose the amount Senior can sell and the minimum payout, and this
Choose the depth at NAV and maximum discount, and this
model shows capacity, proceeds and the pool curve rather than a
row of empty values.
</p>
Expand Down
Loading
Loading