Implemented v1.5 executable edge contract, added mode/maxDataAge controls, and harden caches/health/tests/docs#4
Open
ShinyPotatoo wants to merge 10 commits into
Open
Conversation
…rols, and harden caches/health/tests/docs
… clients and case-study script
|
@ShinyPotatoo is attempting to deploy a commit to the Victor's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
This Pull Request implements the v1.5 PRD/TDD signal API, including executable net edge calculation, stricter market matching, schema compliance, API contract, and caching behavior.
It also incorporates non-conflicting upstream changes from a related PR, while preserving the v1.5 signal model as the canonical behavior.
Request Path:
The /api/markets/arbitrage endpoint supports query parameters including mode, minNetEdgeBps / minSpread, maxDataAgeMs, and related filters.
Data Layer:
getMarkets() loads Polymarket and Kalshi markets using TTL caching with in-flight deduplication. Market freshness is derived and degrades when maxDataAgeMs is exceeded.
Computation:
detectArbitrage() groups markets by category, applies stricter matching rules, computes executable YES-side pricing, and derives both gross and net edge in bps, including fees, slippage, and latency adjustments. Liquidity and expiry filters are applied, and results are sorted deterministically.
Output Shape:
Returned opportunities conform to the v1.5 schema. In fast mode, a reduced payload is returned.
Observability:
Structured logs are emitted in the handler. Cache and freshness metadata are exposed where enabled.
Clients:
The SDK supports the new query parameters, and tests validate the contract against a live API instance.