Skip to content

feat(strategies): add strict interior-gap error to BacktestPriceFeed - #1017

Open
shobhamerabacha-star wants to merge 1 commit into
drydocs:mainfrom
shobhamerabacha-star:feat/issue-1015-solution
Open

shobhamerabacha-star wants to merge 1 commit into
drydocs:mainfrom
shobhamerabacha-star:feat/issue-1015-solution

Conversation

@shobhamerabacha-star

Copy link
Copy Markdown

Summary

Adds an opt-in strict mode to BacktestPriceFeed that throws a new PriceGapError when a requested timestamp falls within the feed range but does not match any supplied price point.

Changes

  • Added BacktestPricePoint, PriceGapError, and isPriceGapError to packages/strategies/src/types.ts.
  • PriceGapError captures the requested timestamp and the bracketing points (before and after).
  • Extended BacktestPriceFeed constructor and BacktestPriceFeed.create to accept an optional strict option, defaulting to false.
  • In strict mode, reads matching no supplied point throw PriceGapError, while reads outside [first, last] still throw TimestampOutOfRangeError.
  • Default carry-forward behavior is preserved untouched for backwards compatibility.
  • Added test coverage for exact hits, interior gaps in both modes, and range boundary reads.

Verification

  • Vitest unit tests in @meridian/strategies: 581 passed (100% green)
  • TypeScript typecheck (tsc --noEmit): passed
  • Soroban contracts suite: 100% passed

Closes #1015

@vercel

vercel Bot commented Oct 9, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

[Feature] Add a strict interior-gap error to BacktestPriceFeed

1 participant