Skip to content

feat(strategies): support volatile asset symbols - #1032

Merged
collinsezedike merged 1 commit into
drydocs:mainfrom
Fi-zzy:fix/issue-1022
Oct 25, 2026
Merged

collinsezedike merged 1 commit into
drydocs:mainfrom
Fi-zzy:fix/issue-1022

Conversation

@Fi-zzy

@Fi-zzy Fi-zzy commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Derive the strategy engine asset union from the loan configuration universe: USDC, EURC, XLM, USDG, BTC, and ETH.
  • Keep vault stablecoin constants unchanged and allow price feeds to provide the assets they actually price.
  • Widen scenario pricing and portfolio report types, with XLM coverage in feeds, scenarios, and backtests.

This is a source-level TypeScript change that accepts more asset symbols; existing USDC/EURC behavior and vault deposit asset constraints are unchanged.

Closes #1022

Verification: tests, typecheck, and lint pass for @meridian/strategies; the branch is rebased onto current main.

@drips-wave

drips-wave Bot commented Oct 15, 2026

Copy link
Copy Markdown

@Fi-zzy Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Oct 15, 2026

Copy link
Copy Markdown

@Fi-zzy is attempting to deploy a commit to the Collins' projects Team on Vercel.

A member of the Team first needs to authorize it.

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fi-zzy thanks for the work. CI is red for two reasons.

pnpm format:check fails on packages/strategies/src/feeds.ts, packages/strategies/src/regime-scenarios.ts and packages/strategies/src/scenario-backtest.test.ts. Running pnpm exec prettier --write on those three clears the Lint & Typecheck job.

@meridian/strategies#build fails with TS2352 at regime-scenarios.ts:218, and that is what fails the Test job. Once the build is green, please confirm pnpm typecheck is clean with the Partial<Record<...>> holdings change in report.ts, because the failing tsc step stopped before consumers of finalState.holdings were checked.

AssetSymbol,
Array<{ timestamp: number; price: FixedPointDecimal }>
> = { USDC: [], EURC: [] };
> = Object.fromEntries(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fi-zzy Object.fromEntries here infers { [k: string]: never[] }, and TS2352 rejects the direct cast to Record<AssetSymbol, ...>. This is the build failure that takes down the Test job. Type the record explicitly before filling it, or cast through unknown.

export interface ReportPortfolioState {
readonly timestamp: SimulationTimestamp;
readonly holdings: Readonly<Record<AssetSymbol, FixedPointDecimal>>;
readonly holdings: Readonly<Partial<Record<AssetSymbol, FixedPointDecimal>>>;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fi-zzy widening holdings to Partial<...> is fine, but the tsc step never got past the build error above, so consumers that index a single asset (for example holdings[asset].toStroops()) have not been typechecked. Please confirm pnpm typecheck passes after the cast is fixed.

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fi-zzy the Typecheck job fails on the cast in regime-scenarios.ts and the Format job fails on feeds.ts, regime-scenarios.ts, and scenario-backtest.test.ts. Run pnpm format to fix the formatting.

> = { USDC: [], EURC: [] };
> = Object.fromEntries(
KNOWN_ASSET_SYMBOLS.map((supported) => [supported, []])
) as Record<AssetSymbol, Array<{ timestamp: number; price: FixedPointDecimal }>>;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object.fromEntries(...) is inferred as { [k: string]: never[] }, so this cast to Record<AssetSymbol, ...> is rejected with TS2352. Type the map callback so each entry is [AssetSymbol, Array<{ timestamp: number; price: FixedPointDecimal }>], or build the record with an explicit accumulator.

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fi-zzy the Typecheck job fails on the cast in regime-scenarios.ts and the Format job fails on feeds.ts, regime-scenarios.ts, and scenario-backtest.test.ts. Run pnpm format to fix the formatting.

> = { USDC: [], EURC: [] };
> = Object.fromEntries(
KNOWN_ASSET_SYMBOLS.map((supported) => [supported, []])
) as Record<AssetSymbol, Array<{ timestamp: number; price: FixedPointDecimal }>>;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object.fromEntries(...) is inferred as { [k: string]: never[] }, so this cast to Record<AssetSymbol, ...> is rejected with TS2352. Type the map callback so each entry is [AssetSymbol, Array<{ timestamp: number; price: FixedPointDecimal }>], or build the record with an explicit accumulator.

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the updates, @Fi-zzy. The rebased branch resolves the cast and formatting failures, and the widened asset union is covered by XLM tests. All required checks pass; this is ready to merge. Please consider picking up another open issue.

@collinsezedike
collinsezedike merged commit 1006454 into drydocs:main Oct 25, 2026
11 of 12 checks passed
@collinsezedike

Copy link
Copy Markdown
Collaborator

Thank you for your contribution, @Fi-zzy; if you have a moment, starring the repository would help the project reach more people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SDK] Widen the engine asset universe beyond supported stablecoins

2 participants