Skip to main content

Monaco Protocol SDK v0.5.7

Batch Orders, MCP Server & Network Configuration Improvements

This release introduces batch order creation and replacement for high-frequency trading workflows, a fully rebuilt MCP server for AI assistant integrations, removes the manual WebSocket URL configuration requirement, and tightens the network parameter to prevent misconfiguration.

New Features

Batch Create Orders

Submit multiple orders in a single API call with the new batchCreate() method. Core SDK:
  • New Method: sdk.trading.batchCreate(orders: BatchCreateOrderParams[]) — POST /api/v1/orders/batch-create
  • Partial Success: Each order is processed independently — failures don’t block the rest
  • Per-Order Results: Detailed outcome per order including match result and error details if failed
  • Full Order Support: Supports both LIMIT and MARKET orders; time-in-force options (GTC, IOC, FOK) apply to LIMIT orders only
React SDK:
  • New Hook Method: batchCreate() available in useTrade()
Example: Core SDK
Example: React Hook
New Types:
  • BatchCreateOrderParams — Per-order input (tradingPairId, orderType, side, quantity, price?, timeInForce?, slippageTolerance?, expirationDate?, useMasterBalance?)
  • BatchCreateOrdersResponse — { success, total_requested, total_succeeded, total_failed, results }
  • BatchCreateResult — { order_id, success, match_result?, error? }
  • BatchError — { code, message }

Batch Replace Orders

Replace multiple orders atomically in a single API call with the new batchReplace() method. Core SDK:
  • New Method: sdk.trading.batchReplace(orders: BatchReplaceOrderParams[]) — POST /api/v1/orders/batch-replace
  • Atomic Per-Order: Each replacement cancels the original and creates a new order independently
  • New Order IDs: Each successful replacement returns a new order ID
  • Flexible Updates: price and quantity are both optional — omit either to keep the original value
React SDK:
  • New Hook Method: batchReplace() available in useTrade()
Example: Core SDK
Example: React Hook
New Types:
  • BatchReplaceOrderParams — { orderId, price?, quantity?, useMasterBalance? }
  • BatchReplaceOrdersResponse — { success, total_requested, total_succeeded, total_failed, results }
  • BatchReplaceResult — { original_order_id, success, new_order_id?, updated_fields?, match_result?, error? }

Movements Filters

Server-side filtering is now available on the user movements endpoint. Core SDK — getPaginatedUserMovements():
  • New parameter: entry_type — filter by entry type
  • New parameter: transaction_type — filter by transaction type
  • New parameter: asset_id — filter by asset UUID New types (@0xmonaco/types):
  • LedgerEntryType — union of entry type values
  • TransactionType — union of transaction type values
MCP server — get_movements tool:
  • Now accepts entry_type, transaction_type, and asset_id as optional filter inputs

MCP Server

The Monaco MCP server has been rebuilt from the ground up. It exposes Monaco’s full API surface as tools that any MCP-compatible AI assistant (Claude, Cursor, Windsurf) can call directly — no SDK code required. What’s new in v0.5.7:
  • 26 tools across 9 modules: search, market, orderbook, trades, trading, profile, fees, vault, and faucet
  • Public-only mode: run with zero configuration to get read-only market data instantly — MONACO_PRIVATE_KEY and MONACO_CLIENT_ID are optional
  • Auto RPC defaults: MONACO_RPC_URL defaults per network — no manual URL configuration needed
  • Node 16 compatibility: polyfills for fetch and WebSocket for environments like Claude Desktop that run older Node versions
For setup instructions and a full list of available tools, see MCP Server.

Breaking Changes

useUserMovements Now Accepts an Options Object

The useUserMovements hook signature has changed from a positional maxMovements number to an options object.
All previous options are available under the same names in the options object. The filter params (entry_type, transaction_type, asset_id) are also passed here.

wsUrl Removed from SDKConfig and MonacoProvider

The wsUrl configuration option has been removed. The WebSocket URL is now automatically resolved from the network parameter — no manual configuration required. Core SDK — What Changed:
React SDK — What Changed:
Why this change:
  • Eliminates a common source of misconfiguration
  • WebSocket and API URLs are always consistent with each other
  • Simpler SDK initialization

Network Type Now Accepts Only Preset Values

The network parameter no longer accepts arbitrary URL strings. Only preset network names are valid. Passing an unsupported value throws InvalidConfigError. What Changed:

Upgrade Instructions

Install New Versions

Migration Steps

1. Update useUserMovements call sites

2. Remove wsUrl from SDK initialization

Find all MonacoSDK constructor calls and remove the wsUrl property:

3. Remove wsUrl from MonacoProvider

4. Remove wsUrl from environment variables

If you had VITE_MONACO_WS_URL or similar env vars, they are no longer needed.

5. (Optional) Adopt batch order methods

Take advantage of the new batch APIs for high-frequency workflows:

For complete documentation, see Order Management, useTrade hook, and API Reference.