Version: 1.0.8 True Markets CeFi WebSocket
Overview
This API allows clients to interact with the CeFi trading platform for real time instrument, market data and exchange transactions.
Authentication
Authenticated requests carry their credentials in the subscription message payload (not HTTP headers). Two signing schemes are supported:
- Institutional — HMAC-SHA256 over the canonical payload, using an API key (
keyid + sharedsecret). - Retail — ES256 (EC P-256) signature over the same canonical payload, using a registered asymmetric key (public key only held server-side).
Both sign timestamp + TRUEXWS + key + path, where path is the WebSocket endpoint path — use the canonical /v1/cefi/market; the legacy /api/v1 is also accepted but deprecated. See the security schemes below for exact rules.
Unauthenticated Endpoints
Many endpoints have an unauthenticated version which only requires the user to supply a valid timestamp (no older than 15 seconds and not in the future, relative to server UTC time). These endpoints batch updates and publish on an interval set by the exchange, typically 1 second.
Authenticated-Only Channels
Some channels require authentication and cannot be accessed without valid credentials:
- DROPCOPY: Order drop copy channel that provides real-time order state updates.
Links
- 📖 Full API Documentation: https://docs.truex.co/
- 📧 Support: [email protected]
/v1/cefi/market
channelsubscribe
sendMessage sent to server indicating what channels and data the user would like to subscribe to.
welcome
receiveMessage received when connecting to the server and establishing a websocket connection.
confirmation
receiveMessage sent from server containing channels and items the user is currently subscribed to.
instrument
receiveMessage sent from server with instrument data.
trade
receiveMessage sent from server containing the latest trade information for a subscribed instrument.
ebbo
receiveMessage sent from server containing the latest exchange best bid and offer information for a subscribed instrument.
depth
receiveMessage sent from server containing the latest market data change for a subscribed instrument.
auction
receiveMessage sent from server containing the latest opening-auction indicative for a subscribed instrument. A status of INVALID indicates the instrument is not currently in an opening auction; updates are emitted while an auction is in progress, plus one final zeroed update (status INVALID) when the auction completes.
dropcopy
receiveMessage sent from server containing order drop copy data for subscribed client IDs. Provides real-time order state updates including new orders, fills, cancellations, and modifications. Requires authentication - unauthenticated connections will be rejected. A DROPCOPY subscription placed while the exchange is still syncing its client catalog (shortly after a restart) receives a confirmation without that subscription and a message asking you to retry — resend the subscription in a few moments.
Servers
| Server | Host | Description |
|---|---|---|
| production | wss://api.truemarkets.co | Production CeFi market-data WebSocket (canonical). Connect at /v1/cefi/market. |
| uat | wss://api.uat.truemarkets.co | UAT CeFi market-data WebSocket sandbox (canonical). Connect at /v1/cefi/market. |
Security
NONE
httpApiKey · x-no-auth
This security scheme documents message-level behavior. Authentication fields are carried in the subscription message payload, not as HTTP query parameters.
Clients may subscribe to endpoints without an API key or computing an HMAC signature. These endpoints are rate limited by the server, coalescing and only sending data at a predetermined rate. Non-authenticated connections can be upgraded by supplying an API key and computed HMAC signature on the next request sent to the server.
Unauthenticated requests must have type SUBSCRIBE_NO_AUTH or UNSUBSCRIBE_NO_AUTH and must not include the following fields in the request: organization_id, key, signature.
*_NO_AUTH requests are only valid on unauthenticated sessions. If a connection is already authenticated, no-auth requests are rejected and do not modify authenticated subscriptions.
Required members
timestamp: A UTC Unix epoch in seconds.
HMAC
httpApiKey · x-api-key
This security scheme documents message-level behavior. Authentication fields are carried in the subscription message payload, not as HTTP query parameters.
Clients must compute and send an HMAC signature in the signature member of the request structure.
Compute the payload exactly as:
timestamp + TRUEXWS + key + path
Then compute the signature as:
Base64( HMAC_SHA256(secret, payload) )
Rules:
timestampis a Unix epoch in seconds.TRUEXWSis the literal stringTRUEXWS.keyis the API key UUID string.pathis the WebSocket endpoint path in the signed payload. Use the canonical/v1/cefi/market; the legacy/api/v1is also accepted but deprecated. The server accepts either, regardless of the host/URL you connect through.- Timestamp must not be in the future and must be no older than 15 seconds relative to server time.
Example payload:
1700000000TRUEXWS11112222-3333-4444-8555-666677778888/v1/cefi/market
Example signature (shell):
printf '%s' "$PAYLOAD" | openssl dgst -sha256 -hmac "$SECRET" -binary | base64
Required members
signature: The signature generated from processing the payload with the HMAC key.key: The ID of the HMAC key being used.timestamp: A UTC Unix epoch in seconds.
ES256
httpApiKey · x-api-key
This security scheme documents message-level behavior. Authentication fields are carried in the subscription message payload, not as HTTP query parameters.
Retail clients authenticate with an asymmetric EC P-256 (ES256) API key registered with True Markets (public key only is held server-side). The client signs with its private key.
Compute the same canonical payload as the HMAC scheme:
timestamp + TRUEXWS + key + path
Then sign it as ES256 (ECDSA over SHA-256) and encode the raw r || s (64 bytes) as base64url:
signature = base64url( ECDSA_P256_SHA256( private_key, payload ).r_concat_s )
Rules:
timestampis a Unix epoch in seconds; must be within 15 seconds of server time.TRUEXWSis the literal stringTRUEXWS.keyis the API key UUID string (the retail EC key id).pathis the WebSocket endpoint path — use the canonical/v1/cefi/market; the legacy/api/v1is also accepted but deprecated (same as HMAC).- The signature is the raw 64-byte
r || s, base64url-encoded (no padding) — DER-encoded signatures are not accepted.
Example payload:
1700000000TRUEXWS11112222-3333-4444-8555-666677778888/v1/cefi/market
A retail EC key whose user is not onboarded to CeFi (no bound client_id) is rejected.
Required members
signature: The base64urlr || sES256 signature over the payload.key: The retail EC (ES256) API key id.timestamp: A UTC Unix epoch in seconds.