SDK Version: Neural v0.1.0 (Beta)
Last Updated: October 11, 2025
Total Issues: 15 bugs documented
File: neural/trading/websocket.py
Severity: π΄ CRITICAL
Status: Blocking SDK WebSocket usage
Issue:
KalshiWebSocketSupervisor fails with 403 Forbidden despite valid credentials.
Root Cause: Authentication headers not properly set during WebSocket handshake.
Required Changes:
- Ensure PSS signature generation matches Kalshi's requirements
- Add authentication headers to initial HTTP upgrade request
- Test with actual Kalshi production credentials
- Verify SSL/TLS configuration with certifi
Testing:
# Should work after fix
supervisor = KalshiWebSocketSupervisor(
api_key_id="valid-key",
private_key_pem=private_key_bytes
)
await supervisor.start() # Should not get 403Reference: Bug #11 in BETA_BUGS_TRACKING.md
File: neural/data_collection/kalshi.py
Severity: π΄ CRITICAL
Status: Methods completely unusable
Issue:
Methods expect series_ticker field that doesn't exist in API response.
Error:
KeyError: 'series_ticker'Required Changes:
- Remove
series_tickerparameter usage - Use
event_tickerfield (which actually exists) - Add proper error handling for missing fields
- Update method signatures to match actual Kalshi API
Fix Example:
# Current (BROKEN):
def get_nfl_games(self):
return self.get_markets(series_ticker="KXNFLGAME") # WRONG FIELD
# Fixed:
def get_nfl_games(self):
markets = self.get_markets_by_sport(sport="football", limit=1000)
return [m for m in markets.get('markets', [])
if 'KXNFLGAME' in m.get('ticker', '')]Reference: Bug #12 in BETA_BUGS_TRACKING.md
File: setup.py or requirements
Severity: π΄ CRITICAL
Status: Crashes on import with NumPy 2.x
Issue: SDK compiled against NumPy 1.x, fails with NumPy 2.3.3+
Required Changes:
- Recompile SDK against NumPy 2.0 API
- Add explicit
numpy<2.0dependency in setup.py if not recompiling - Add version compatibility check on import
- Document NumPy requirements clearly
Short-term Fix:
# In setup.py
install_requires=[
'numpy>=1.24.0,<2.0', # Explicit version constraint
...
]Long-term Fix: Recompile all C extensions against NumPy 2.0.
Reference: Bug #13 in BETA_BUGS_TRACKING.md
File: neural/trading/websocket.py
Severity: π HIGH
Status: Cannot filter subscriptions efficiently
Issue:
subscribe() method doesn't accept market_tickers for filtered subscriptions.
Required Changes:
def subscribe(
self,
channels: list[str],
market_tickers: Optional[list[str]] = None,
params: Optional[Dict[str, Any]] = None,
request_id: Optional[int] = None
) -> int:
"""Subscribe to channels with optional market filtering."""
req_id = request_id or self._next_id()
subscribe_params = {"channels": channels}
if market_tickers:
subscribe_params["market_tickers"] = market_tickers
if params:
subscribe_params.update(params)
payload = {
"id": req_id,
"cmd": "subscribe",
"params": subscribe_params
}
self.send(payload)
return req_idReference: Bug #14 in BETA_BUGS_TRACKING.md
File: neural/trading/websocket.py
Severity: π MEDIUM
Status: Hard to debug issues
Issue: Generic error messages, no context about what failed.
Required Changes:
- Add specific error messages for common failures
- Include authentication details in debug logs
- Better exception handling with context
- Log WebSocket handshake details
Example:
try:
await self.connect()
except websockets.exceptions.InvalidStatusCode as e:
if e.status_code == 403:
logger.error(
"WebSocket authentication failed. "
"Check API key and private key. "
f"URL: {self.url}, "
f"Key ID: {self.api_key_id[:8]}..."
)
raiseFile: neural/trading/websocket.py
Severity: π MEDIUM
Status: No automatic reconnection
Issue: Supervisor doesn't automatically reconnect on connection loss.
Required Changes:
- Add exponential backoff reconnection
- Configurable max retries
- Preserve subscription state across reconnects
- Health checks and monitoring
Example:
class KalshiWebSocketSupervisor:
async def _reconnect_loop(self):
retry_count = 0
backoff = 1.0
while retry_count < self.max_retries:
try:
await self.client.connect()
# Restore subscriptions
await self._restore_subscriptions()
retry_count = 0
backoff = 1.0
except Exception as e:
retry_count += 1
await asyncio.sleep(backoff)
backoff = min(backoff * 2, 60)File: neural/data_collection/kalshi.py
Severity: π’ LOW
Status: Would improve developer experience
Suggested Addition:
def get_sports_markets(self, sport: str, event_ticker: str = None,
status: str = None, limit: int = 1000):
"""
Get markets for a sport with optional filtering.
Args:
sport: 'football', 'basketball', etc.
event_ticker: Filter by event (e.g., 'KXNFLGAME')
status: Filter by status ('open', 'closed', etc.)
limit: Max markets to return
Returns:
dict: Markets matching criteria
"""
markets = self.get_markets_by_sport(sport=sport, limit=limit)
filtered = markets.get('markets', [])
if event_ticker:
filtered = [m for m in filtered
if event_ticker in m.get('ticker', '')]
if status:
filtered = [m for m in filtered
if m.get('status') == status]
return {'markets': filtered}File: Documentation/examples
Severity: π’ LOW
Status: Confusing for users
Required:
- Document need for certifi package
- Provide SSL configuration examples
- Explain certificate verification
- Add troubleshooting guide
Example Documentation:
## SSL/TLS Setup
Install certifi for proper certificate verification:
pip install certifi
Configure SSL context:
import ssl
import certifi
ssl_context = ssl.create_default_context(cafile=certifi.where())
Use with WebSocket:
await websockets.connect(url, ssl=ssl_context)File: Examples directory
Severity: π’ LOW
Status: Would help with performance
Suggested Example:
# examples/connection_pooling.py
import asyncio
from neural import TradingClient
class ConnectionPool:
"""Manage multiple WebSocket connections efficiently."""
def __init__(self, api_key_id, private_key, max_connections=5):
self.api_key_id = api_key_id
self.private_key = private_key
self.max_connections = max_connections
self.connections = []
async def get_connection(self):
# Implementation
passFor each fix, add:
-
Unit Tests
- Test with valid credentials
- Test with invalid credentials
- Test error conditions
- Test edge cases
-
Integration Tests
- Test against production API
- Test reconnection logic
- Test subscription management
- Test concurrent operations
-
Performance Tests
- Message throughput
- Memory usage
- Connection stability
- Latency measurements
- Complete method signatures
- Parameter descriptions
- Return value documentation
- Usage examples
- Error conditions
- Getting started tutorial
- WebSocket integration guide
- Market discovery guide
- Error handling guide
- Performance optimization
- Document current bugs
- Provide workarounds
- Link to issue tracker
- Update with fixes
Before next beta release:
- Fix all Priority 1 issues
- Add tests for critical paths
- Update documentation
- Run integration tests against production
- Verify examples work
- Update changelog
- Bump version number
- Tag release
We're ready to contribute fixes back to Neural SDK:
- WebSocket Authentication - Working raw websockets implementation
- Market Discovery - Working
get_markets_by_sport()wrapper - NumPy Compatibility - Tested version constraints
- market_tickers Support - Working subscription format
All working implementations are in:
nfl/run_live_test.py- Working WebSocketnfl/game_discovery.py- Working market discoverynfl/test_kalshi_ws_raw.py- Test scripts
Ready to contribute back to SDK repository when maintainers are ready.
- BETA_BUGS_TRACKING.md - Complete bug list
- WEBSOCKET_INTEGRATION_GUIDE.md - Working patterns
- LIVE_TESTING_FINDINGS.md - Testing results
Document Version: 1.0
Last Updated: October 11, 2025
Next Review: With beta update release