Skip to main content
monaco-sdk is generated from Monaco’s OpenAPI spec and covers the REST API surface. Use it when you want HTTP/JSON compatibility and typed Rust methods for market data, account data, and trading workflows.

Add Dependencies

See crates.io/crates/monaco-sdk for the published crate.

Market Data

No authentication is required to read trading pairs.

Authenticate

Monaco authenticates with a wallet-authorized ed25519 session key. Generate a keypair, have the wallet sign a challenge that commits to it, then sign every authenticated request with the session key.

Sign Authenticated Requests

On native targets, the SDK can sign session-authenticated requests automatically:
Use your registered session signing key as session_key. RFC 9421 signing is opt-in and requires a server that supports it. Use RequestSigning::Legacy for existing servers. The authenticated client disables redirects; public operations remain unsigned. See HTTP message signatures for the signing profile and migration steps. The manual example below uses legacy signing. Legacy authenticated REST requests carry X-Monaco-PublicKey, X-Monaco-Timestamp, and X-Monaco-Signature. The signature covers:

Place a Limit Order

The raw generated client keeps idempotency_key optional and does not generate it. Set it yourself (idempotencyKey in JSON) before serialization and signing. Retain the prepared payload and key; persist them before sending if recovery must survive a process restart.
For a lost response, reuse create unchanged and sign again with a fresh timestamp. Use a distinct key for each batch-create item, generated before signing the batch. The key protects the original submission for 24 hours after acceptance; retries do not extend that window. Do not retry an unresolved submission after expiry. This example does not retry automatically. A GTC order rests on the book until filled or cancelled. See Order Management for other time-in-force options.

Cancel an Order