-
Notifications
You must be signed in to change notification settings - Fork 15
feat(cross_exchange): add cross-exchange market management module #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
- Add OutcomeRef, OutcomeToken, ExchangeOutcomeRef type hierarchy - Add CrossExchangeManager for fetching markets by mapping - Add MarketMatcher skeleton with category and LLM strategies - Add TokenPrice, MatchedOutcome, FetchedMarkets types - Add example script and documentation
466fd36 to
68c522b
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
…d add parsing for multi-outcome events - Updated `fetch_markets_by_slug` to return nested markets as separate Market objects. - Introduced `_parse_nested_market` method to handle parsing of nested market data, including prices, tokens, and metadata. - Modified example script to include Limitless outcomes in the cross-exchange table display.
Pull Request Review: Cross-Exchange Market Management ModuleSummaryThis PR adds a well-structured cross-exchange market comparison system. The implementation is clean, modular, and follows good architectural principles with a clear separation between manual mapping (working) and automatic matching (skeleton for future). Strengths1. Excellent Architecture & Design ✅
2. Good Documentation ✅
3. Smart Implementation Details ✅
Issues & RecommendationsCRITICAL: Violation of CLAUDE.md Guidelines 🚨1. Environment Variables (.env.example)Location: +# TODO: OpenRouter API (for LLM-based market matching)
+OPENROUTER_API_KEY=sk-or-...
+OPENROUTER_MODEL=xiaomi/mimo-v2-flash:freeIssue: CLAUDE.md Rule #4 states: "Single Source of Truth: DO NOT place many variables in .env file. Place them in the code instead." Recommendation: Since LLM matching is not yet implemented (returns 0.0), either:
2. Documentation File CreatedLocation: Issue: CLAUDE.md Rule #2 states: "DO NOT create a new document. Purge unnecessary code and files." Recommendation:
HIGH PRIORITY: Code Quality Issues
|
| Rule | Status | Notes |
|---|---|---|
| 1. Focused & clean | Code is clean, but CROSS_EXCHANGE.md adds 223 lines | |
| 2. No new documents | ❌ VIOLATION | CROSS_EXCHANGE.md created |
| 3. Use UV | ✅ PASS | Example uses uv run |
| 4. Single source of truth | ❌ VIOLATION | Added env vars for unimplemented feature |
| 5. Run & Debug | No evidence of testing |
Verdict
Conditional Approval with Required Changes
Must Fix Before Merge:
- ❌ Remove OPENROUTER_* from
.env.example(unimplemented feature) - ❌ Remove or consolidate
CROSS_EXCHANGE.mdper CLAUDE.md ⚠️ Add proper logging instead of print statements⚠️ Add basic test coverage (at least happy path)
Should Fix:
- Fix type hints (
set→Set[str]) - Either implement one matcher OR don't export skeletons in
__all__ - Add
raise NotImplementedError()to skeleton matchers
Nice to Have:
- Move
richto dev dependencies - Make pagination limits configurable
- Document return types properly
Positive Conclusion
Despite the issues above, this is high-quality work with excellent architecture. The type hierarchy, exchange-agnostic design, and separation of concerns are exemplary. The violations of CLAUDE.md are easily fixable, and the code quality issues are mostly about error handling and testing.
After addressing the critical violations and adding tests, this will be a solid addition to the codebase. 🚀
Great job on the core implementation! 👏
|
wow cross-exchange market great!! |
Summary