Skip to content

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
MusashiBot:mainfrom
ShinyPotatoo:integration
Open

Implemented v1.5 executable edge contract, added mode/maxDataAge controls, and harden caches/health/tests/docs#4
ShinyPotatoo wants to merge 10 commits into
MusashiBot:mainfrom
ShinyPotatoo:integration

Conversation

@ShinyPotatoo
Copy link
Copy Markdown

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.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 19, 2026

@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.

@ShinyPotatoo ShinyPotatoo changed the title Integration Implemented v1.5 executable edge contract, added mode/maxDataAge controls, and harden caches/health/tests/docs Apr 19, 2026
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.

1 participant