From bb02360f1fc0755e5113990261cc3bd81c27d7b8 Mon Sep 17 00:00:00 2001 From: 2NNatural Date: Wed, 19 Aug 2026 14:24:41 -0700 Subject: [PATCH] Set Day yield premium fees to 5% --- lib/day-markets/acred/market.json | 4 +- lib/day-markets/blockhouse/market.json | 4 +- lib/day-markets/dualmint/market.json | 4 +- lib/day-markets/infinifi/market.json | 4 +- lib/day-markets/makina-dbit/market.json | 4 +- lib/day-markets/makina-deth/market.json | 4 +- lib/day-markets/makina-dusd/market.json | 4 +- lib/day-markets/makina-usdshfmk/market.json | 4 +- lib/day-markets/pareto-falconx/market.json | 6 +-- lib/day-markets/reusde/market.json | 4 +- lib/day-markets/susdai/market.json | 6 +-- .../explorer-market.test.ts | 40 +++++++++++++++++++ lib/day-simulator-template/explorer-market.ts | 4 +- lib/day-simulator-template/runtime.test.ts | 16 ++++---- scripts/day-simulator/template-lock.json | 6 +-- scripts/day-v3/v2-output-regression.test.ts | 11 ++--- 16 files changed, 82 insertions(+), 43 deletions(-) diff --git a/lib/day-markets/acred/market.json b/lib/day-markets/acred/market.json index 596158e..9d681cd 100644 --- a/lib/day-markets/acred/market.json +++ b/lib/day-markets/acred/market.json @@ -34,8 +34,8 @@ "selfLiquidationBonus": 0.01, "stProtocolFee": 0, "jtProtocolFee": 0, - "jtYieldShareProtocolFee": 0.45, - "ltYieldShareProtocolFee": 0.45, + "jtYieldShareProtocolFee": 0.05, + "ltYieldShareProtocolFee": 0.05, "stableYield": 0.035, "swapFeeBps": 10, "poolTurnoverPerYear": 8, diff --git a/lib/day-markets/blockhouse/market.json b/lib/day-markets/blockhouse/market.json index 7316985..d214583 100644 --- a/lib/day-markets/blockhouse/market.json +++ b/lib/day-markets/blockhouse/market.json @@ -34,8 +34,8 @@ "selfLiquidationBonus": 0.01, "stProtocolFee": 0, "jtProtocolFee": 0, - "jtYieldShareProtocolFee": 0.45, - "ltYieldShareProtocolFee": 0.45, + "jtYieldShareProtocolFee": 0.05, + "ltYieldShareProtocolFee": 0.05, "stableYield": 0.035, "swapFeeBps": 10, "poolTurnoverPerYear": 8, diff --git a/lib/day-markets/dualmint/market.json b/lib/day-markets/dualmint/market.json index 050e0ef..66ca79d 100644 --- a/lib/day-markets/dualmint/market.json +++ b/lib/day-markets/dualmint/market.json @@ -34,8 +34,8 @@ "selfLiquidationBonus": 0.01, "stProtocolFee": 0, "jtProtocolFee": 0, - "jtYieldShareProtocolFee": 0.45, - "ltYieldShareProtocolFee": 0.45, + "jtYieldShareProtocolFee": 0.05, + "ltYieldShareProtocolFee": 0.05, "stableYield": 0.035, "swapFeeBps": 10, "poolTurnoverPerYear": 8, diff --git a/lib/day-markets/infinifi/market.json b/lib/day-markets/infinifi/market.json index 72ccfe7..6a93820 100644 --- a/lib/day-markets/infinifi/market.json +++ b/lib/day-markets/infinifi/market.json @@ -34,8 +34,8 @@ "selfLiquidationBonus": 0.01, "stProtocolFee": 0, "jtProtocolFee": 0, - "jtYieldShareProtocolFee": 0.45, - "ltYieldShareProtocolFee": 0.45, + "jtYieldShareProtocolFee": 0.05, + "ltYieldShareProtocolFee": 0.05, "stableYield": 0.035, "swapFeeBps": 10, "poolTurnoverPerYear": 8, diff --git a/lib/day-markets/makina-dbit/market.json b/lib/day-markets/makina-dbit/market.json index fee1b9c..62e2591 100644 --- a/lib/day-markets/makina-dbit/market.json +++ b/lib/day-markets/makina-dbit/market.json @@ -34,8 +34,8 @@ "selfLiquidationBonus": 0.01, "stProtocolFee": 0, "jtProtocolFee": 0, - "jtYieldShareProtocolFee": 0.45, - "ltYieldShareProtocolFee": 0.45, + "jtYieldShareProtocolFee": 0.05, + "ltYieldShareProtocolFee": 0.05, "stableYield": 0, "swapFeeBps": 10, "poolTurnoverPerYear": 2.4, diff --git a/lib/day-markets/makina-deth/market.json b/lib/day-markets/makina-deth/market.json index 09c4015..4cb036f 100644 --- a/lib/day-markets/makina-deth/market.json +++ b/lib/day-markets/makina-deth/market.json @@ -34,8 +34,8 @@ "selfLiquidationBonus": 0.01, "stProtocolFee": 0, "jtProtocolFee": 0, - "jtYieldShareProtocolFee": 0.45, - "ltYieldShareProtocolFee": 0.45, + "jtYieldShareProtocolFee": 0.05, + "ltYieldShareProtocolFee": 0.05, "stableYield": 0.035, "swapFeeBps": 10, "poolTurnoverPerYear": 8, diff --git a/lib/day-markets/makina-dusd/market.json b/lib/day-markets/makina-dusd/market.json index 699c5dd..4f33b2d 100644 --- a/lib/day-markets/makina-dusd/market.json +++ b/lib/day-markets/makina-dusd/market.json @@ -41,8 +41,8 @@ "selfLiquidationBonus": 0.01, "stProtocolFee": 0, "jtProtocolFee": 0, - "jtYieldShareProtocolFee": 0.45, - "ltYieldShareProtocolFee": 0.45, + "jtYieldShareProtocolFee": 0.05, + "ltYieldShareProtocolFee": 0.05, "stableYield": 0.035, "swapFeeBps": 10, "poolTurnoverPerYear": 8, diff --git a/lib/day-markets/makina-usdshfmk/market.json b/lib/day-markets/makina-usdshfmk/market.json index e8d2fc9..8514d4f 100644 --- a/lib/day-markets/makina-usdshfmk/market.json +++ b/lib/day-markets/makina-usdshfmk/market.json @@ -34,8 +34,8 @@ "selfLiquidationBonus": 0.01, "stProtocolFee": 0, "jtProtocolFee": 0, - "jtYieldShareProtocolFee": 0.45, - "ltYieldShareProtocolFee": 0.45, + "jtYieldShareProtocolFee": 0.05, + "ltYieldShareProtocolFee": 0.05, "stableYield": 0.035, "swapFeeBps": 10, "poolTurnoverPerYear": 8, diff --git a/lib/day-markets/pareto-falconx/market.json b/lib/day-markets/pareto-falconx/market.json index d28dec5..149854b 100644 --- a/lib/day-markets/pareto-falconx/market.json +++ b/lib/day-markets/pareto-falconx/market.json @@ -23,7 +23,7 @@ "riskYDM": { "mode": "adaptive", "y0": 0.005, - "yTarget": 0.045, + "yTarget": 0.027, "y100": 0.31, "maxAdaptSpeedPerYear": 100, "minYTarget": 0.0001, @@ -41,8 +41,8 @@ "selfLiquidationBonus": 0.01, "stProtocolFee": 0, "jtProtocolFee": 0, - "jtYieldShareProtocolFee": 0.45, - "ltYieldShareProtocolFee": 0.45, + "jtYieldShareProtocolFee": 0.05, + "ltYieldShareProtocolFee": 0.05, "stableYield": 0.035, "swapFeeBps": 10, "poolTurnoverPerYear": 8, diff --git a/lib/day-markets/reusde/market.json b/lib/day-markets/reusde/market.json index 11bfaa9..084f207 100644 --- a/lib/day-markets/reusde/market.json +++ b/lib/day-markets/reusde/market.json @@ -34,8 +34,8 @@ "selfLiquidationBonus": 0.01, "stProtocolFee": 0, "jtProtocolFee": 0, - "jtYieldShareProtocolFee": 0.45, - "ltYieldShareProtocolFee": 0.45, + "jtYieldShareProtocolFee": 0.05, + "ltYieldShareProtocolFee": 0.05, "stableYield": 0.035, "swapFeeBps": 10, "poolTurnoverPerYear": 8, diff --git a/lib/day-markets/susdai/market.json b/lib/day-markets/susdai/market.json index 51b8db3..1f13feb 100644 --- a/lib/day-markets/susdai/market.json +++ b/lib/day-markets/susdai/market.json @@ -23,7 +23,7 @@ "riskYDM": { "mode": "adaptive", "y0": 0.03, - "yTarget": 0.07, + "yTarget": 0.188, "y100": 0.31, "maxAdaptSpeedPerYear": 100, "minYTarget": 0.0001, @@ -41,8 +41,8 @@ "selfLiquidationBonus": 0.01, "stProtocolFee": 0, "jtProtocolFee": 0, - "jtYieldShareProtocolFee": 0.45, - "ltYieldShareProtocolFee": 0.45, + "jtYieldShareProtocolFee": 0.05, + "ltYieldShareProtocolFee": 0.05, "stableYield": 0.035, "swapFeeBps": 10, "poolTurnoverPerYear": 8, diff --git a/lib/day-simulator-template/explorer-market.test.ts b/lib/day-simulator-template/explorer-market.test.ts index 1276235..cfea1aa 100644 --- a/lib/day-simulator-template/explorer-market.test.ts +++ b/lib/day-simulator-template/explorer-market.test.ts @@ -8,6 +8,22 @@ import { import { runDayTargetScenario } from "@/lib/day-simulator-template/runtime"; import { annualizedSeriesApy } from "@/lib/day-simulator-template/series"; import { JBBB_SAMPLE_MARKET } from "@/lib/day-sample-sources/jbbb/market"; +import { DAY_MARKETS } from "@/lib/day-markets/registry"; + +const YIELD_PREMIUM_PROTOCOL_FEE = 0.05; + +for (const market of DAY_MARKETS) { + assert.equal( + market.defaults.jtYieldShareProtocolFee, + YIELD_PREMIUM_PROTOCOL_FEE, + `${market.id} Junior yield-premium protocol fee`, + ); + assert.equal( + market.defaults.ltYieldShareProtocolFee, + YIELD_PREMIUM_PROTOCOL_FEE, + `${market.id} SLP yield-premium protocol fee`, + ); +} assert.equal(DAY_EXPLORER_TEMPLATE_MARKET.route, "/day-sim"); assert.equal(DAY_EXPLORER_TEMPLATE_MARKET.series.length, 13); @@ -30,6 +46,14 @@ assert.equal(draft.certification.intakeConfirmed, false); assert.equal(draft.provenance.observationCount, 3); assert.equal(draft.provenance.priceType, "unknown"); assert.ok(draft.defaults.sourceApy > 0); +assert.equal( + draft.defaults.jtYieldShareProtocolFee, + YIELD_PREMIUM_PROTOCOL_FEE, +); +assert.equal( + draft.defaults.ltYieldShareProtocolFee, + YIELD_PREMIUM_PROTOCOL_FEE, +); const outputs = runDayTargetScenario(draft.defaults); assert.ok(Number.isFinite(outputs.seniorApy)); @@ -43,6 +67,14 @@ assert.equal(JBBB_SAMPLE_MARKET.provenance.observationCount, 1144); assert.equal(JBBB_SAMPLE_MARKET.provenance.firstDate, "2022-01-12"); assert.equal(JBBB_SAMPLE_MARKET.provenance.lastDate, "2026-08-05"); assert.equal(JBBB_SAMPLE_MARKET.series[0].price, 100); +assert.equal( + JBBB_SAMPLE_MARKET.defaults.jtYieldShareProtocolFee, + YIELD_PREMIUM_PROTOCOL_FEE, +); +assert.equal( + JBBB_SAMPLE_MARKET.defaults.ltYieldShareProtocolFee, + YIELD_PREMIUM_PROTOCOL_FEE, +); assert.ok(Math.abs(annualizedSeriesApy(JBBB_SAMPLE_MARKET.series) - 0.05825) < 0.00001); const yieldDraft = buildDayYieldDraftMarket({ @@ -57,6 +89,14 @@ assert.equal(yieldDraft.provenance.observationCount, 0); assert.equal(yieldDraft.provenance.feesIncluded, true); assert.equal(yieldDraft.customization.hiddenSections.includes("backtest"), true); assert.equal(yieldDraft.series.length, 0); +assert.equal( + yieldDraft.defaults.jtYieldShareProtocolFee, + YIELD_PREMIUM_PROTOCOL_FEE, +); +assert.equal( + yieldDraft.defaults.ltYieldShareProtocolFee, + YIELD_PREMIUM_PROTOCOL_FEE, +); const yieldOutputs = runDayTargetScenario(yieldDraft.defaults); assert.ok(Number.isFinite(yieldOutputs.seniorApy)); diff --git a/lib/day-simulator-template/explorer-market.ts b/lib/day-simulator-template/explorer-market.ts index ac60b68..4ceb8ed 100644 --- a/lib/day-simulator-template/explorer-market.ts +++ b/lib/day-simulator-template/explorer-market.ts @@ -35,8 +35,8 @@ export const DAY_EXPLORER_TEMPLATE_MANIFEST: DayMarketManifest = { selfLiquidationBonus: 0.02, stProtocolFee: 0, jtProtocolFee: 0, - jtYieldShareProtocolFee: 0, - ltYieldShareProtocolFee: 0, + jtYieldShareProtocolFee: 0.05, + ltYieldShareProtocolFee: 0.05, stableYield: 0.035, swapFeeBps: 10, poolTurnoverPerYear: 8, diff --git a/lib/day-simulator-template/runtime.test.ts b/lib/day-simulator-template/runtime.test.ts index 0568865..32f6cda 100644 --- a/lib/day-simulator-template/runtime.test.ts +++ b/lib/day-simulator-template/runtime.test.ts @@ -343,15 +343,13 @@ assert.equal(tighterBandConfig.eclpBandWidth, 0.05); assert.equal(tighterBandConfig.eclpParams, undefined); const yields = runDayTargetScenario(market.defaults); -// Senior and SLP moved when the pool stopped being seeded at a flat 10% Senior -// and started opening at its own curve's resting split — 3.884% on every market -// that declares a curve, Pareto included. Junior is untouched by the pool's -// composition and is byte-identical, which is the check that the change did -// what it says and nothing more. Senior 8.879% -> 8.797%, still inside this -// market's [8.66, 9.16] certification band. -assert.ok(Math.abs(yields.seniorApy - 0.08797192293801026) < 1e-12); -assert.ok(Math.abs(yields.juniorApy - 0.12948094983927905) < 1e-12); -assert.ok(Math.abs(yields.liquidityApy - 0.09327491357897322) < 1e-12); +// Pareto's accountant-backed calibration preserves its declared Senior and +// Junior return bands after the uniform 5% Junior/SLP yield-premium protocol +// fee is applied. These exact outputs also pin the manifest decimal through the +// runtime adapter and the contract-mirrored fee-share minting path. +assert.ok(Math.abs(yields.seniorApy - 0.0913920169096325) < 1e-12); +assert.ok(Math.abs(yields.juniorApy - 0.13924177159090334) < 1e-12); +assert.ok(Math.abs(yields.liquidityApy - 0.10248258285545275) < 1e-12); const forwardSeries = buildDayForwardSeries( 0.114, diff --git a/scripts/day-simulator/template-lock.json b/scripts/day-simulator/template-lock.json index 703e973..80c534d 100644 --- a/scripts/day-simulator/template-lock.json +++ b/scripts/day-simulator/template-lock.json @@ -23,8 +23,8 @@ "lib/day-simulator-template/docs-links.ts": "37493e2dded59fa3c7fe91df8401aa5926ad1d12a38a52052873d9957be0ff62", "lib/day-simulator-template/erasure.test.ts": "f328072947e011cb822c91afeaf53bdc065ff07431a887036d430b42519ff7b6", "lib/day-simulator-template/erasure.ts": "84c1e880dafa07d5061dac24def4a3756419bcce7c7e70d5641fd0efcfc09e9d", - "lib/day-simulator-template/explorer-market.test.ts": "4f7b199c0ba4aa515d2924b25f0b88e748f83f46d623fedd339b8d04368f58a0", - "lib/day-simulator-template/explorer-market.ts": "cc8897036585f86993564a90b3e7d06185f1de26640be396eb677f219e01d005", + "lib/day-simulator-template/explorer-market.test.ts": "5ab8226d4263f8c271ea3d1c104b635f71e66bdfed008d90c24eebd48d2fa7f5", + "lib/day-simulator-template/explorer-market.ts": "1a27086ef2a8e0e730b6b167855153b7b436c7cd8719db59a77f048a3617871b", "lib/day-simulator-template/explainer.test.ts": "ac6e9379158620fd4f75e7c7b56cdedd7d940dc34772f00b16b2388de83d35e1", "lib/day-simulator-template/explainer.ts": "f3cc1c74d389009201a1ee46283ff5b462399fabec87cdf67e08254e7980aa95", "lib/day-simulator-template/issuer-presets.ts": "fecaed5814634c8d14a9767e43f0f62a6da375e2e72282bd203fdd364aac1ba0", @@ -34,7 +34,7 @@ "lib/day-simulator-template/permalink.ts": "776525c1a9928ebaf876b45d197e19b2ef12a7f51114d94ab03defd0caf5b1e0", "lib/day-simulator-template/permalink.test.ts": "13fe4d22f7f49c1a96677e31f882068270f9943be00edc5493a64f2b12e620b2", "lib/day-simulator-template/refill.ts": "bb41d8ef450523aa9006fe1f9f2ed422ae0640053d44c3709151fe2bd2ada20d", - "lib/day-simulator-template/runtime.test.ts": "0be9608aa8b07d3166de0fe0e941238fa21f0253ad3c661f22f0a62a46e604d4", + "lib/day-simulator-template/runtime.test.ts": "bc07324c6335720b0f8c204005a5b34e31163d7bdd276c7b16b6d44403b2627d", "lib/day-simulator-template/runtime.ts": "f54ea48cbbfc5ad4d1977aa7b0507cf7ddb91ae10606e90ab1ed280c89a83b86", "lib/day-simulator-template/series.ts": "fcfad3de9a17225bdf1aedf672eb2c756af5100db417169bff0569a7e3082db4", "lib/day-simulator-template/stress.test.ts": "9637ea95cea0c6c002873b74caca5bde780d92c929076b7568e3e28075ff87f0", diff --git a/scripts/day-v3/v2-output-regression.test.ts b/scripts/day-v3/v2-output-regression.test.ts index d43db46..64c3636 100644 --- a/scripts/day-v3/v2-output-regression.test.ts +++ b/scripts/day-v3/v2-output-regression.test.ts @@ -41,8 +41,9 @@ const actual = { }; // Captured after the authorized shared-engine correction that applies the -// exact-input pool fee before E-CLP pricing. The route/components remain frozen; -// this baseline intentionally records the corrected all-in exit quote. +// exact-input pool fee before E-CLP pricing and the uniform 5% protocol fee on +// Junior and SLP yield premiums. The route/components remain frozen; this +// baseline intentionally records the corrected all-in returns and exit quote. assert.deepEqual(actual, { market: "jbbb", terms: { @@ -59,9 +60,9 @@ assert.deepEqual(actual, { lt: 4444444.444444445, }, scenario: { - seniorApy: 0.043539092406083446, - juniorApy: 0.0995122311478902, - liquidityApy: 0.07104533931079726, + seniorApy: 0.04353777871863951, + juniorApy: 0.09741459113398454, + liquidityApy: 0.06973721931312293, }, capitalStack: { coverageLossLimit: 0.22222222222299992,