Skip to main content

Monaco Protocol v0.5.2

gRPC API Introduction

This release introduces the Monaco gRPC API, a high-performance alternative to our REST API designed for low-latency trading applications. The gRPC API provides the same functionality as the REST API with significantly reduced overhead and native streaming support.

What’s New

gRPC API
  • Full Trading Support: Create, cancel, and replace orders via gRPC
  • Real-time Market Data: Orderbook snapshots, recent trades, and OHLCV candles
  • Account Management: Profile, balances, movements, and sub-account limits
  • Authentication: Wallet-based (SIWE) and backend service authentication
  • Transfers: Deposit and withdrawal signature generation

gRPC Services Overview

The Monaco gRPC API exposes the following services:

Connection Details

The gRPC API is exposed via path-based routing on the same ALB as the REST API:
The ALB routes requests based on path prefixes:
  • /ws/* routes to the WebSocket service
  • gRPC method paths such as /monaco.api.* route to the gRPC service with protocolVersion: GRPC
  • All other paths route to the REST API

Quick Start

1. Generate client code from proto Download the proto file and generate client code for your language:
2. Connecting to the gRPC API Since the gRPC API uses HTTP/2 method-path routing on the ALB, clients need to connect with the correct configuration:
3. Authentication Flow
4. Creating an Order
5. Getting Market Data (No Auth Required)
Note on Path-Based Routing The ALB listener rule routes gRPC method paths such as /monaco.api.* and /grpc.health.v1.* to the gRPC service. Clients connect to the host on 443 and do not include a /grpc prefix.

Service Reference

AuthService

OrdersService

AccountsService

MarketDataService (Public)

FeesService

TransfersService

ApplicationsService (Backend Only)

FaucetService (Testnet Only)

Order Types and Time-in-Force

Order Types:
  • LIMIT - Limit order (price required)
  • MARKET - Market order (no price, uses slippage tolerance)
Time-in-Force Options:
  • GTC - Good Till Cancelled (default)
  • IOC - Immediate or Cancel
  • FOK - Fill or Kill
  • GTD - Good Till Date (requires expiration_date)

Error Handling

gRPC uses standard status codes. Common codes:

Proto File

The complete proto definition is available at:
  • GitHub: protos/*

Technical Details

Server Implementation
  • Built with Tonic (Rust gRPC framework)
  • HTTP/2 multiplexing for concurrent requests
  • Standard gRPC health checks (grpc.health.v1.Health)
  • OpenTelemetry integration for distributed tracing
Performance Benefits over REST
  • Binary Protocol Buffers serialization (smaller payloads)
  • HTTP/2 connection multiplexing (no head-of-line blocking)
  • Native streaming support (future: real-time orderbook updates)
  • Strong typing with code generation

Current Limitations

Please note:
  • Stability: API may change before stable release
  • Streaming: Server-side streaming not yet implemented
  • Rate Limits: Same limits as REST API apply
  • Documentation: Proto file is the source of truth

Migration from REST

The gRPC API provides equivalent functionality to all REST endpoints. Key differences:

Feedback

We welcome feedback on:
  • API design and ergonomics
  • Missing functionality
  • Performance issues
  • Documentation clarity
Please share your feedback with the Monaco team.

Testnet Faucet & New Assets

New Testnet Assets

This release includes a migration that resets testnet assets with the following tokens:

Trading Pairs

All tokens are paired against USDC:
  • WBTC/USDC, WETH/USDC, WSOL/USDC, WSEI/USDC
  • SPX/USDC, AMZN/USDC, GOOG/USDC, META/USDC, NVDA/USDC, TSLA/USDC

Faucet Endpoint

A new faucet endpoint allows authenticated users to mint all testnet tokens at once. Endpoint: POST /api/v1/faucet/mint Authentication: Required (JWT Bearer token) Rate Limit: Configurable via faucet_daily_limit feature flag (default: 1 request per 24 hours) Response:
Faucet Amounts per Token:
Note: The REST API remains fully supported.