Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new interactive blog post on ETF diversification and introduces two reusable blog widgets (random-walk diversification simulator + risk-budget allocator) backed by a shared ETF dataset. Also includes minor Markdown formatting updates in a couple of planning/notes docs.
Changes:
- Add
DiversificationRandomWalk(Chart.js-based simulator) andPortfolioRiskAllocator(risk-budget optimizer UI). - Add shared ETF/covariance dataset used by both widgets.
- Add new MDX blog post embedding the widgets; minor Markdown table/spacing cleanup in docs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| website/TOC_IMPLEMENTATION_PLAN.md | Markdown formatting/spacing cleanup in the ToC implementation plan. |
| website/components/blog/PortfolioRiskAllocator.tsx | New interactive risk-budget allocator widget (UI + optimization routines). |
| website/components/blog/etfData.ts | New shared ETF/cluster/covariance data payload for blog widgets. |
| website/components/blog/DiversificationRandomWalk.tsx | New interactive diversification random-walk simulator + histogram visualization. |
| website/blog/multichain_technical_notes.md | Markdown formatting cleanup (tables/spacing). |
| website/blog/etf_diversification_interactive.mdx | New blog post embedding the new interactive widgets. |
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+29
to
+42
| const STEPS = 504; // 2 trading years — more points for smoother histogram | ||
| const ANIM_BATCH = 8; // steps drawn per frame | ||
| const ANIM_INTERVAL = 25; // ms between frames | ||
|
|
||
| interface Paths { | ||
| bondReturns: number[]; | ||
| stockReturns: number[]; | ||
| } | ||
|
|
||
| /** Generate correlated daily returns for bonds and stocks. | ||
| * Uses Cholesky decomposition for the 2×2 case. */ | ||
| function generatePaths(sigBond: number, sigStock: number, rho: number): Paths { | ||
| const dailySigBond = sigBond / Math.sqrt(STEPS); | ||
| const dailySigStock = sigStock / Math.sqrt(STEPS); |
Comment on lines
+234
to
+246
| // defer interval to next tick so state is set | ||
| setTimeout(() => { | ||
| let step = 0; | ||
| animRef.current = setInterval(() => { | ||
| step = Math.min(step + ANIM_BATCH, STEPS); | ||
| setVisibleSteps(step); | ||
| if (step >= STEPS) { | ||
| clearInterval(animRef.current!); | ||
| animRef.current = null; | ||
| setIsAnimating(false); | ||
| } | ||
| }, ANIM_INTERVAL); | ||
| }, 0); |
Comment on lines
+313
to
+341
| <div | ||
| key={hi} | ||
| onPointerDown={(e) => { | ||
| e.preventDefault(); | ||
| setDragging(hi); | ||
| }} | ||
| className={css({ | ||
| position: "absolute", | ||
| top: "-2px", | ||
| width: "16px", | ||
| height: "calc(100% + 4px)", | ||
| cursor: "col-resize", | ||
| display: "flex", | ||
| alignItems: "center", | ||
| justifyContent: "center", | ||
| zIndex: 2, | ||
| })} | ||
| style={{ left: `calc(${leftPct}% - 8px)` }} | ||
| > | ||
| <div | ||
| className={css({ | ||
| width: "4px", | ||
| height: "60%", | ||
| backgroundColor: "white", | ||
| borderRadius: "2px", | ||
| boxShadow: "0 1px 4px rgba(0,0,0,0.35)", | ||
| })} | ||
| /> | ||
| </div> |
Comment on lines
+521
to
+524
| {cluster.etfs.map((etf) => { | ||
| const idx = DATA.etf_names.indexOf(etf); | ||
| const etfVol = Math.sqrt(DATA.cov_etf_ann[idx][idx]) * 100; | ||
| return ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.