-
Notifications
You must be signed in to change notification settings - Fork 13
Add support for FOK and IOC order types #64
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
PR Review: Add support for FOK and IOC order typesSummaryThis PR implements Fill-Or-Kill (FOK) and Immediate-Or-Cancel (IOC) order types across the codebase. The implementation is well-structured and follows the project's patterns. Below is my detailed review. ✅ Strengths1. Clean API Design
2. Comprehensive Testing
3. Exchange-Specific Validation
4. Documentation
|
- Add OrderTimeInForce enum with GTC, FOK, and IOC options - Update Order model with time_in_force field (defaults to GTC) - Update Exchange.create_order() to accept time_in_force parameter - Implement time_in_force support in all exchanges: - Polymarket: Maps to py_clob_client OrderType (GTC, FOK, GTD for IOC) - Opinion: Adds parameter support (SDK may have limited support) - Limitless: Sends timeInForce in API payload - Add comprehensive tests for OrderTimeInForce enum - Export OrderTimeInForce in public API Closes #22 Co-authored-by: guzus <guzus@users.noreply.github.com>
- Limitless: Only supports GTC and FOK, rejects IOC with InvalidOrder - Opinion: Only supports GTC, rejects FOK/IOC with InvalidOrder - Kalshi: Added time_in_force parameter with full GTC/FOK/IOC support - Polymarket: Already has full GTC/FOK/IOC support (no changes) This ensures users get clear error messages when using unsupported order types on exchanges that don't support them. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create wiki/exchanges/kalshi.md with comprehensive API documentation - Add CLAUDE.md rule requiring wiki docs when integrating new exchanges Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use full string values per Kalshi API spec: - good_till_canceled (not gtc) - fill_or_kill (not fok) - immediate_or_cancel (not ioc) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
c64aeea to
cd95290
Compare
cd95290 to
3718798
Compare
- Fix PredictFun.id to return "predict.fun" to match registry key - Update exchange count in tests from 4 to 5 (Kalshi added) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3718798 to
365a19a
Compare
Pull Request Review: Add support for FOK and IOC order typesSummaryThis PR successfully implements support for Fill-Or-Kill (FOK) and Immediate-Or-Cancel (IOC) order types across the dr-manhattan prediction market SDK. The implementation is well-structured and properly handles exchange-specific capabilities. Strengths
Critical Issues1. PredictFun Exchange Missing time_in_force Support
2. Missing time_in_force in Order Creation
3. Missing time_in_force in PredictFun Order Objects
4. Incomplete Import in PredictFun
Minor Issues
Overall AssessmentQuality: Good (4/5) | Completeness: 85% | Risk: Low The PR demonstrates good software engineering with clear separation of concerns, proper validation, and comprehensive documentation. Main issues are PredictFun missing time_in_force implementation. Once resolved, ready to merge. Generated by Claude Code |
PR Review: Add support for FOK and IOC order typesSummaryThis PR implements Fill-Or-Kill (FOK) and Immediate-Or-Cancel (IOC) order types across all exchanges. The implementation is solid overall with good documentation and test coverage. Below are my findings. ✅ Strengths
🐛 Critical Issues1. Missing
|
Pull Request Review - PR #64: Add support for FOK and IOC order typesSummaryThis PR adds support for Fill-Or-Kill (FOK) and Immediate-Or-Cancel (IOC) order types across the codebase. The implementation is well-structured and includes proper validation, comprehensive tests, and excellent documentation. Overall, this is high-quality work with good attention to detail. Strengths1. Clean Architecture
2. Exchange-Specific ValidationExcellent work implementing exchange-specific validation:
3. Documentation
4. Testing
Issues and Concerns1. CRITICAL: Polymarket IOC Mapping May Be IncorrectLocation: dr_manhattan/exchanges/polymarket.py:798 The code maps IOC to GTD (Good-Til-Date) with a comment claiming GTD provides IOC behavior. This seems unlikely as GTD typically remains active until a specific date/time, while IOC immediately fills what's possible and cancels the rest. Recommendation: Verify this mapping against the py_clob_client library documentation. If GTD doesn't provide IOC behavior, either raise InvalidOrder for IOC or use the correct OrderType. 2. Missing time_in_force in Order ConstructionRecommendation: Verify that all exchange implementations properly set time_in_force in their Order objects, especially in parse_order methods. 3. Test Coverage GapsMissing integration tests for:
4. Inconsistent Error MessagesError messages have different formats across exchanges. Recommend standardizing for consistency. 5. PredictFun Exchange ID ChangeLocation: dr_manhattan/exchanges/predictfun.py:119 The exchange ID was changed from "predictfun" to "predict.fun". This seems unrelated to the time-in-force feature and could be a breaking change. Either revert this or document it clearly in the PR description. Suggestions
Security and PerformanceSecurity: No issues detected Code Quality Score: 8/10
Final RecommendationConditional Approval - Please address the critical Polymarket IOC mapping issue before merging. Once verified/fixed and integration tests added, this will be ready to merge. Great job on the comprehensive documentation and thoughtful exchange-specific validation! |
- Add WebSocket authentication details - Add subscribe/unsubscribe command examples - Remove See Also section Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PR Review: Add support for FOK and IOC order typesSummaryThis PR successfully implements Fill-Or-Kill (FOK) and Immediate-Or-Cancel (IOC) order types across the dr-manhattan prediction market SDK. The implementation is well-structured and includes proper validation, documentation, and tests. Code Quality: GoodStrengths
Concerns
Test Coverage: PartialGood:
Missing:
Performance: No concernsThe changes do not introduce any performance issues. Simple enum checks and dictionary lookups are negligible. Security: Good
Best Practices: Minor issues
Recommendations SummaryCritical:
High Priority:
Nice to Have:
Overall Assessment: Approve with recommendationsThis is a solid implementation that adds valuable functionality. The concerns are relatively minor and mostly around edge cases and testing. The code follows the repository conventions and includes good documentation. Suggested action: Address the Polymarket GTD mapping concern before merging, as it could cause runtime issues for users. |
Summary
Implemented support for Fill-Or-Kill (FOK) and Immediate-Or-Cancel (IOC/FAK) order types.
Changes
Closes #22
Generated with Claude Code