Skip to main content

Monaco Protocol SDK v0.2.0

Trading Enhancements & Real-time Data

This release introduces significant trading improvements including market order slippage protection, advanced limit order features, and real-time order event streaming via WebSocket.

What’s New

WebSocket Real-time Data Streaming
  • Live Order Updates: Real-time streaming of order status changes with event types (OrderPlaced, OrderMatched, OrderPartiallyFilled, OrderFilled, OrderCancelled, OrderRejected, OrderExpired)
  • OHLCV Data Streaming: Real-time candlestick data across 6 timeframes (1m, 5m, 15m, 1h, 4h, 1d)
  • Automatic Reconnection: Built-in exponential backoff and connection health monitoring
  • Multiple Subscriptions: Subscribe to events for specific trading pairs and intervals simultaneously
Market Order Slippage Protection
  • Slippage Tolerance: Set maximum acceptable price deviation (0.1% to 10%)
  • Automatic Price Protection: Orders reject if slippage exceeds specified tolerance
  • Enhanced Order Response: Added actual_slippage_bps and max_slippage_bps to match results
  • Backend Validation: Server-side slippage validation with configurable limits
Limit Order Enhancements
  • Good Till Cancel (GTC): Automatic 90-day default expiration for limit orders
  • Custom Expiration Dates: Set specific expiration dates for limit orders

Technical Details

WebSocket Real-time Data Subscribe to real-time order events:
Subscribe to real-time OHLCV candlestick data:
WebSocket features automatic reconnection, heartbeat monitoring, and JWT authentication. See WebSocket documentation and OHLCV documentation for complete details. Market Orders with Slippage Protection Market orders now accept an optional slippageTolerance parameter:
The SDK converts decimal tolerance to basis points and sends to backend. Orders are rejected with “Slippage tolerance exceeded” error if insufficient liquidity exists within bounds. Limit Orders with GTC and Custom Expiration Limit orders now support custom expiration dates:
Orders default to 90-day expiration if no expirationDate is provided.

Packages Updated

Installation

Migration Notes

This is a backward-compatible release. Existing orders continue to work unchanged:
  • Market orders without slippageTolerance work as before, but we recommend adding slippage protection for volatile markets
  • Limit orders automatically receive 90-day GTC expiration if no expirationDate is specified
  • WebSocket is an optional feature - existing REST API usage remains unchanged

Documentation