Commit Graph

14 Commits

Author SHA1 Message Date
Patrick Selamy 3bf8e228b8 Merge pull request #32 from pselamy/fix/5
feat: add Redis Streams event publisher for trade events (#5)
2026-01-04 15:05:11 -05:00
Patrick Selamy 2eabbad738 feat: add Redis Streams event publisher for trade events (#5)
Implement EventPublisher class for publishing trade events to Redis
Streams, enabling decoupled downstream processing. Key features:

- EventPublisher wrapping Redis Streams XADD/XREADGROUP commands
- Single and batch publishing with configurable max stream length
- Consumer group management (create/ensure)
- Event reading with pending entry recovery
- Acknowledgment helpers for exactly-once semantics
- Stream info and trimming utilities
- Full TradeEvent serialization/deserialization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 15:04:34 -05:00
Patrick Selamy f07f6f17ca Merge pull request #31 from pselamy/fix/4
feat: add market metadata synchronizer with Redis caching (#4)
2026-01-04 14:57:36 -05:00
Patrick Selamy 8db2516001 feat: add market metadata synchronizer with Redis caching (#4)
Implement MarketMetadataSync class for background synchronization of
market metadata with Redis-based caching. Key features:

- MarketMetadata dataclass with derived category field
- Automatic category derivation from market title (politics, crypto,
  sports, entertainment, finance, tech, science, other)
- Background sync loop with configurable interval (default: 5 min)
- Redis caching with TTL-based expiration (default: 10 min)
- Cache-first lookups via get_market() method
- State management with callbacks for monitoring
- Comprehensive test suite (29 tests)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 14:56:39 -05:00
Patrick Selamy 20d272b6c3 Merge pull request #30 from pselamy/fix/3
feat: implement WebSocket trade stream handler (#3)
2026-01-04 14:47:14 -05:00
Patrick Selamy 85010a3ea5 feat: implement WebSocket trade stream handler with reconnection
- Add TradeEvent dataclass for trade data from WebSocket feed
- Implement TradeStreamHandler with async WebSocket streaming
- Add automatic reconnection with exponential backoff (1s-30s)
- Support event/market filtering for targeted subscriptions
- Include connection state management and statistics tracking
- Add websockets>=12.0 dependency

Acceptance Criteria:
- [x] TradeStreamHandler class using websockets library
- [x] Connects to Polymarket WSS endpoint
- [x] Subscribes to market trade channel on connection
- [x] Parses trade messages into TradeEvent dataclass
- [x] Implements heartbeat/ping-pong for connection health
- [x] Auto-reconnects on disconnect with exponential backoff
- [x] Emits events via callback pattern
- [x] Logs connection state changes

Closes #3

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 14:46:38 -05:00
Patrick Selamy 1299cfe0b7 Merge pull request #29 from pselamy/fix/2
feat: implement Polymarket CLOB client wrapper (#2)
2026-01-04 14:41:29 -05:00
Patrick Selamy bb5fc086ae feat: implement Polymarket CLOB client wrapper with rate limiting
- Add ClobClient class wrapping py-clob-client library
- Implement rate limiting (10 requests/second) with token bucket
- Add retry logic with exponential backoff (3 retries)
- Load API key from POLYMARKET_API_KEY environment variable
- Create Market, Orderbook, Token dataclass models
- Add comprehensive unit tests with mocked responses

Acceptance Criteria:
- [x] ClobClient class that wraps py-clob-client
- [x] Loads POLYMARKET_API_KEY from environment
- [x] Implements get_markets() returning all active markets
- [x] Implements get_market(market_id) returning market details
- [x] Implements get_orderbook(market_id) returning current book
- [x] Rate limiting: max 10 requests/second with automatic throttling
- [x] Retry logic: 3 retries with exponential backoff on errors
- [x] Unit tests with mocked responses
- [x] Type hints for all public methods

Closes #2

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 14:40:43 -05:00
Patrick Selamy bc05af2fd7 Merge pull request #28 from pselamy/fix/25
feat: set up Python project structure with pyproject.toml (#25)
2026-01-04 14:35:33 -05:00
Patrick Selamy 8211e57b61 feat: set up Python project structure with pyproject.toml
- Add pyproject.toml with core and dev dependencies
- Configure Ruff for linting and formatting
- Configure MyPy for strict type checking
- Configure pytest with asyncio support
- Create src/polymarket_insider_tracker package structure
- Add py.typed marker for PEP 561 compliance
- Add pre-commit hooks configuration
- Add comprehensive .gitignore
- Create test directory structure with basic tests

Closes #25

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 14:34:37 -05:00
Patrick Selamy 9c4006b9aa Merge pull request #27 from pselamy/feat/priority-issue-resolution-skill
feat: add priority-issue-resolution skill for autonomous issue handling
2026-01-04 14:05:05 -05:00
Patrick Selamy c4c9f96668 feat: add priority-issue-resolution skill for autonomous issue handling 2026-01-04 14:04:21 -05:00
Patrick Selamy 32656b2f2f Add comprehensive README with project vision and technical overview 2026-01-04 13:12:55 -05:00
Patrick Selamy c27d788c96 Initial commit 2026-01-04 13:10:50 -05:00