### Receiving MWallet Fast Trade Update JSON Example Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels_mwallet.md Example JSON message for the faster `mwallet_fast_trade_update` channel. It's similar to `mwallet_trade_update` but excludes fee-related fields and does not provide a snapshot. ```json { "c": "user", "e": "mwallet_fast_trade_update", "t": [{ "i": 78, "M": "ethusdt", "sd": "bid", "p": "3320.49", "v": "0.1", "fn":"77.38889", "T": 1633359451377, "TU": 1633359451378, "m": false, "oi": 123 }], "T": 1521726960357 } ``` -------------------------------- ### Receiving MWallet Trade Update JSON Example Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels_mwallet.md Example JSON message representing an update for an mwallet trade. This is sent when a new trade occurs for the user after the initial snapshot. The `e` field is `mwallet_trade_update`. ```json { "c": "user", "e": "mwallet_trade_update", "t": [{ "i": 78, "M": "ethusdt", "sd": "bid", "p": "3320.49", "v": "0.1", "f": "0.00015", "fc": "eth", "fn":"77.38889", "T": 1633359451377, "TU": 1633359451378, "m": false, "oi": 123 }], "T": 1521726960357 } ``` -------------------------------- ### Market Status Snapshot Response Example (JSON) Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_market_status.md This JSON object shows an example of a "snapshot" response received from the "market_status" channel. It contains the channel (`c`), event type (`e`), an array of market status objects (`ms`), and a timestamp (`T`). The `ms` array provides the status of multiple markets upon initial subscription. ```json { "c": "market_status", "e": "snaptshot", "ms": [{ "M": "btctwd", "st": "active", "bu": "btc", "bup": 8, "mba": 0.0004, "qu": "twd", "qup": 1, "mqa": 250, "mws": true }, ...], "T": 1659428472313 } ``` -------------------------------- ### Receiving MWallet Account Snapshot JSON Example Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels_mwallet.md Example JSON message representing a snapshot of the user's mwallet balances upon subscribing to the `mwallet_account` channel. The `e` field is `mwallet_account_snapshot` and the `B` array contains balance objects for each currency. ```json { "c": "user", "e": "mwallet_account_snapshot", "B": [ { "cu": "btc", "av": "123.4", "l": "0.5", "stk": null }, ... ], "T": 1521726960357 } ``` -------------------------------- ### Receiving MWallet Order Snapshot JSON Example Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels_mwallet.md Example JSON message representing a snapshot of the user's current open mwallet orders upon subscribing to the `mwallet_order` channel. The `e` field is `mwallet_order_snapshot` and the `o` array contains order objects. ```json { "c": "user", "e": "mwallet_order_snapshot", "o": [ { "i": 87, "sd": "bid", "ot": "limit", "p": "3320.49", "sp": null, "ap": "0.0", "v": "0.1", "rv": "0.1", "ev": "0.0", "S": "wait", "M": "ethusdt", "tc": 0, "T": 1633415952000, "TU": 1633415952701, "ci": "client-oid-1", "gi": 123 }, ...], "T": 1633415952715 } ``` -------------------------------- ### Receiving MWallet Trade Snapshot JSON Example Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels_mwallet.md Example JSON message providing a snapshot of recent mwallet trades upon subscribing to the `mwallet_trade` channel. The `e` field is `mwallet_trade_snapshot` and the `t` array contains trade objects. ```json { "c": "user", "e": "mwallet_trade_snapshot", "t": [{ "i": 78, "M": "ethusdt", "sd": "bid", "p": "3320.49", "v": "0.1", "f": "0.00015", "fc": "eth", "fn":"77.38889", "T": 1633415966000, "TU": 1633415966001, "m": false, "oi": 87 }, ...], "T": 1521726960357 } ``` -------------------------------- ### Receiving MWallet Account Update JSON Example Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels_mwallet.md Example JSON message representing an update to mwallet account balances. This is sent when the available, locked, or staked balance of any currency changes. The `e` field is `mwallet_account_update`. ```json { "c": "user", "e": "mwallet_account_update", "B": [ { "cu": "btc", "av": "123.4", "l": "0.5", "stk": null }, ... ], "T": 1521726960357 } ``` -------------------------------- ### Market Status Update Response Example (JSON) Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_market_status.md This JSON object shows an example of an "update" response received from the "market_status" channel. Unlike the snapshot, updates typically contain only the market objects (`ms`) that have changed. It includes the channel (`c`), event type (`e`), the updated market status array (`ms`), and a timestamp (`T`). ```json { "c": "market_status", "e": "update", "ms": [{ "M": "btctwd", "st": "active", "bu": "btc", "bup": 8, "mba": 0.0004, "qu": "twd", "qup": 1, "mqa": 250, "mws": true }], "T": 1659428472313 } ``` -------------------------------- ### Receiving MWallet Order Update JSON Example Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels_mwallet.md Example JSON message representing an update to an mwallet order. This message is sent when an order's state or details change after the initial snapshot. The `e` field is `mwallet_order_update`. ```json { "c": "user", "e": "mwallet_order_update", "o": [{ "i": 210233270, "sd": "bid", "ot": "limit", "p": "100.0", "sp": null, "ap": "0.0", "v": "0.1", "rv": "0.1", "ev": "0.0", "S": "cancel", "M": "ethusdt", "tc": 0, "T": 1633415966000, "TU": 1633415966001, "gi": null, "ci": null }], "T":1633415966510} ``` -------------------------------- ### Example Ticker Snapshot Response - MAX WebSocket JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_ticker.md Illustrates the JSON format of a ticker snapshot message received from the MAX WebSocket API upon successful subscription. It contains abbreviated fields for channel ("c"), event type ("e"), market ("M"), ticker data ("tk"), and a timestamp ("T"). ```JSON { "c": "ticker", "e": "snapshot", "M": "btctwd", "tk": { "M": "btctwd", // same as the above "M" "O": "280007.1", "H": "280017.2", "L": "280005.3", "C": "280004.5", "v": "71.01", "V": "71.01" // volumes in BTC }, "T": 123456789 } ``` -------------------------------- ### Example Ticker Update Response - MAX WebSocket JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_ticker.md Illustrates the JSON format of a ticker update message received from the MAX WebSocket API when the ticker data changes. It uses the same abbreviated field names as the snapshot and includes the updated ticker details. ```JSON { "c": "ticker", "e": "update", "M": "btctwd", "tk": { "M": "btctwd", // same as the above "M" "O": "280007.1", "H": "280017.2", "L": "280005.3", "C": "280004.5", "v": "71.01", "V": "71.01" // volumes in BTC }, "T": 123456789 } ``` -------------------------------- ### Order Book Snapshot Response Format (JSON) Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_orderbook.md Example JSON structure for an initial order book snapshot received upon successful subscription. Includes the channel ('c'), event type ('e'='snapshot'), market ('M'), asks ('a'), bids ('b'), timestamp ('T'), first ('fi') and last ('li') update IDs, and event version ('v'). The 'a' and 'b' fields contain price-volume pairs. ```JSON { "c": "book", "e": "snapshot", "M": "btcusdt", "a": [["5337.3", "0.1"]], "b": [["5333.3", "0.5"]], "T": 1591869939634, "fi":12141725, // First update ID in event "li":12141725, // Last update ID in event "v":1725602999632 // Event version } ``` -------------------------------- ### Order Book Update Response Format (JSON) Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_orderbook.md Example JSON structure for subsequent order book updates received after the initial snapshot. Similar fields to the snapshot, but 'e' is "update", and 'a' (asks) or 'b' (bids) arrays only contain the price levels that have changed. Empty arrays indicate no changes for that side in this update. ```JSON { "c": "book", "e": "update", "M": "btcusdt", "a": [["5337.3", "0.01037"]], "b": [], "T": 1591869939634, "fi":12141726, // Frist update ID in event "li":12141726, // Last update ID in event "v":1725602999632 // Event version } ``` -------------------------------- ### Trade Channel Snapshot Response (JSON) Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_trade.md This JSON snippet illustrates the structure of the initial 'snapshot' message received after successfully subscribing to the trade channel. It provides a list of recent trades for the specified market, including price (p), volume (v), timestamp (T), and trade direction (tr). ```json { "c": "trade", "e": "snapshot", "M": "btctwd", "t":[{ "p": "5337.3", "v": "0.1", "T": 123456789, "tr": "up" }], "T": 123456789 } ``` -------------------------------- ### Receiving Kline Snapshot via WebSocket (JSON Response) Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_kline.md This JSON object is a sample response received on the 'kline' channel with the event type 'snapshot'. It provides an initial or historical state of the kline data for the specified market and resolution, including start/end times, OHLC values, volume, last trade ID, and a 'closed' flag. ```json { "c": "kline", "M": "ethusdt", "e": "snapshot", "T": 1684743644396, "k": { "ST": 1684743600000, "ET": 1684743659999, "M": "ethusdt", "R": "1m", "O": "1815.11", "H": "1815.11", "L": "1815.11", "C": "1815.11", "v": "0", "ti": 58684589, "x": false } } ``` -------------------------------- ### Receiving AD Ratio Snapshot Message (JSON) Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels_mwallet.md Defines the JSON structure for the initial AD Ratio snapshot message received over the user WebSocket channel. It includes details like the channel, event type, current AD data (ratio, asset, debt), relevant index prices, and a timestamp. ```JSON { "c": "user", "e": "ad_ratio_snapshot", "ad": { "ad": "38.08306432", "as": "132071.22", "db": "3467.97775784", "idxp": [ { "M": "btcusdt", "p": "63190.045" }, ... ], "TU": 1521726960300 }, "T": 1521726960357 } ``` -------------------------------- ### MWallet Pool Quota Snapshot Response (JSON) Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_mwallet_pool_quota.md This JSON object represents a snapshot message received from the WebSocket server for the pool_quota channel. It provides the current state of the available loan quota for the specified currency (`cu`) as the `av` field. `T` is the message timestamp. ```json { "c": "pool_quota", "e": "snapshot", "qta": { "cu": "usdt", // currency "av": "501353.81385068", // available quota "TU": 1641551141618 }, "T":1641772933737 } ``` -------------------------------- ### Subscribing to Ticker Channel - MAX WebSocket JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_ticker.md Describes the JSON object required to send a subscription request to the MAX WebSocket ticker channel. It includes the mandatory "channel" field set to "ticker" and the "market" field specifying the desired trading pair. ```JSON { "channel": "ticker", "market": "btctwd" } ``` -------------------------------- ### Account Snapshot Message Structure - MAX WebSocket - JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels.md This JSON object represents an initial snapshot message received on the authenticated 'account' channel. It provides a list ('B') of all currency balances in the user's wallet. Required authentication with the 'account' filter is necessary. ```json { "c": "user", "e": "account_snapshot", "B": [ { "cu": "btc", "av": "123.4", "l": "0.5", "stk": null, "TU": 1659390246343 }, ... ], "T": 1659412100181 } ``` -------------------------------- ### Trade Channel Update Response (JSON) Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_trade.md This JSON snippet demonstrates the format of subsequent 'update' messages received from the trade channel. Each update contains details for newly executed trades, similar to the snapshot structure, including price (p), volume (v), timestamp (T), and trade direction (tr). ```json { "c": "trade", "e": "update", "M": "btctwd", "t":[{ "p": "5337.3", "v": "0.1", "T": 123456789, "tr": "up" }], "T": 123456789 } ``` -------------------------------- ### Receiving MWallet Borrowing Snapshot Message (JSON) Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels_mwallet.md Defines the JSON structure for the initial MWallet borrowing snapshot message received over the user WebSocket channel. It includes the channel, event type, an array of debt objects detailing principal and interest per currency, and timestamps. ```JSON { "c": "user", "e": "borrowing_snapshot", "db": [ { "cu": "usdt", "dbp": "500.0", "dbi": "0.00004488", "TU": 1521726960300 }, ... ], "T": 1521726960357 } ``` -------------------------------- ### Subscribing to Order Book Channel (JSON) Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_orderbook.md Defines the JSON format for subscribing to the order book channel via WebSocket. Requires specifying the "channel" as "book" and the target "market" (e.g., "btctwd"). An optional "depth" parameter can limit the response level (supported values: 1, 5, 10, 20, 50, default 50). ```JSON { "channel": "book", "market": "btctwd", "depth": 1 // optional } ``` -------------------------------- ### Maintaining Connection with Ping/Pong in JavaScript Source: https://github.com/maicoin/max-websocket-docs/blob/master/README.md This JavaScript snippet demonstrates how to keep an active WebSocket connection to the MAX Exchange API. It utilizes the 'ws' library to connect to the specified endpoint, sets up an interval to send a ping message every 30 seconds after the connection opens, and logs the server's corresponding pong response. ```javascript const WebSocket = require('ws'); const url = "wss://max-stream.maicoin.com/ws" const ws = new WebSocket(url); ws.on('open', function open() { setInterval(() => { ws.ping("test") }, 30000); }) ws.on('pong', function incoming(data) { // it will show "server pong test" on the screen console.log('server pong', data.toString()); }); ``` -------------------------------- ### Receiving AD Ratio Update Message (JSON) Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels_mwallet.md Defines the JSON structure for subsequent AD Ratio update messages received over the user WebSocket channel. Similar to the snapshot, it provides updated AD data (ratio, asset, debt), index prices, and timestamps. ```JSON { "c": "user", "e": "ad_ratio_update", "ad": { "ad": "38.08306432", // ad_ratio "as": "132071.22", // asset_in_usdt "db": "3467.97775784", // debt_in_usdt "idxp": [ // index price { "M": "btcusdt", // market "p": "63190.045" // price }, ... ], "TU": 1521726960300 // updated_time }, "T": 1521726960357 } ``` -------------------------------- ### Subscribing to Market Status Channel (JSON) Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_market_status.md This JSON object represents the request message sent to the WebSocket server to subscribe to the "market_status" channel. It requires the "channel" field set to "market_status". No other parameters are needed for the basic subscription. ```json { "channel": "market_status" } ``` -------------------------------- ### Subscribe to Trade Channel (JSON) Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_trade.md This JSON snippet shows the required format for sending a message to subscribe to real-time trade data for a specific market on the MAX WebSocket API. You need to specify the 'channel' as 'trade' and the desired 'market' symbol. ```json { "channel": "trade", "market": "btctwd" } ``` -------------------------------- ### Receiving Kline Update via WebSocket (JSON Response) Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_kline.md This JSON object is a sample response received on the 'kline' channel with the event type 'update'. It provides real-time updates to the current kline data for the subscribed market and resolution, reflecting the latest price and volume changes within the active candlestick period. ```json { "c": "kline", "M": "ethusdt", "e": "update", "T": 1684743650395, "k": { "ST": 1684743600000, "ET": 1684743659999, "M": "ethusdt", "R": "1m", "O": "1815.11", "H": "1815.11", "L": "1815.11", "C": "1815.11", "v": "0", "ti": 58684589, "x": false } } ``` -------------------------------- ### Order Snapshot Message Structure - MAX WebSocket - JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels.md This JSON object represents an initial snapshot message received on the authenticated 'order' channel. It provides a list ('o') of all currently open orders for the authenticated user. Required authentication with the 'order' filter is necessary. ```json { "c": "user", "e": "order_snapshot", "o": [{ "i": 87, "sd": "bid", "ot": "limit", "p": "21499.0", "sp": "21499.0", "ap": "21499.0", "v": "0.2658", "rv": "0.0", "ev": "0.2658", "S": "done", "M": "ethtwd", "tc": 1, "T": 1659419048000, "TU": 1659419048406, "gi": 123, "ci": "client-oid-1" }, ...], "T": 1521726960357 } ``` -------------------------------- ### Subscribing to Kline Data via WebSocket (JSON Request) Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_kline.md This JSON object represents the message payload required to subscribe to the 'kline' channel on the WebSocket API. It requires specifying the target 'market' and optionally allows setting a specific 'resolution' for the kline data (defaults to '1m' if not provided). ```json { "channel": "kline", "market": "ethusdt", "resolution": "1m" // optional } ``` -------------------------------- ### Subscribing to MWallet Pool Quota Channel (JSON) Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_mwallet_pool_quota.md This JSON object represents a request to subscribe to the MWallet pool quota channel on the WebSocket server. It specifies the channel name and the currency for which the quota information is requested. Upon successful subscription, the server will send snapshot and update messages. ```json { "channel": "pool_quota", "currency": "usdt" } ``` -------------------------------- ### Receiving MWallet Borrowing Update Message (JSON) Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels_mwallet.md Defines the JSON structure for subsequent MWallet borrowing update messages received over the user WebSocket channel. It indicates an update event and provides an array of debt objects with potentially updated principal and interest per currency, along with timestamps. ```JSON { "c": "user", "e": "borrowing_update", "db": [ { "cu": "usdt", "dbp": "500.0", "dbi": "0.00004488", "TU": 1521726960300 } ], "T": 1521726960357 } ``` -------------------------------- ### Trade Snapshot Message Structure - MAX WebSocket - JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels.md This JSON object represents an initial snapshot message received on the authenticated 'trade' channel. It provides a list ('t') of the last 100 trades for the authenticated user. Required authentication with the 'trade' filter is necessary. ```json { "c": "user", "e": "trade_snapshot", "t": [{ "i": 68444, "M": "ethtwd", "sd": "bid", "p": "21499.0", "v": "0.2658", "f": "3.2", "fc": "twd", "fd": false, "fn": "5714.4342", "T": 1659216053748, "TU": 1659216054046, "m": true, "oi": 3253823664 }, ...], "T": 1659412100259 } ``` -------------------------------- ### MWallet Pool Quota Update Response (JSON) Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_mwallet_pool_quota.md This JSON object represents an update message received from the WebSocket server for the pool_quota channel. It provides the latest available loan quota for the specified currency (`cu`) in the `av` field when the value changes. `T` is the message timestamp. ```json { "c": "pool_quota", "e": "update", "qta": { "cu": "usdt", // currency "av": "501353.81385068", // available quota "TU": 1641551141618 }, "T":1641772933737 } ``` -------------------------------- ### Sending Basic Authentication Request - JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/authentication.md This JSON snippet shows the structure of the basic authentication request message sent over the websocket to authenticate for private channels without specifying specific data filters. It includes the action, API key, nonce, signature, and an optional client ID. ```JSON { "action": "auth", "apiKey": "...", "nonce": 1591690054859, "signature": "....", "id": "client-id" } ``` -------------------------------- ### Subscribing to Public Channels JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_channels.md This JSON payload is used to subscribe to one or more public channels on the MAX WebSocket API. It requires specifying the action as 'sub', providing a list of 'subscriptions' objects containing channel and market information, and optionally an 'id' to reference the request in the response. ```JSON { "action": "sub", "subscriptions": [ {"channel": "book", "market": "btctwd", "depth": 1}, {"channel": "trade", "market": "btctwd"} ], "id": "client1" } ``` -------------------------------- ### Fast Trade Update Message Structure - MAX WebSocket - JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels.md This JSON object represents an update message received on the authenticated 'fast_trade' channel, providing faster trade updates by excluding fee-related fields. It provides a list ('t') containing one or more new trade objects. Required authentication with the 'fast_trade' filter is necessary. ```json { "c": "user", "e": "fast_trade_update", "t": [{ "i": 68444, "M": "ethtwd", "sd": "bid", "p": "21499.0", "v": "0.2658", "fn": "5714.4342", "T": 1659216053748, "TU": 1659216054046, "m": true, "oi": 3253823664 }], "T": 1521726960357 } ``` -------------------------------- ### Account Update Message Structure - MAX WebSocket - JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels.md This JSON object represents an update message received on the authenticated 'account' channel when a balance changes for any currency. It provides a list ('B') containing one or more updated balance objects. Required authentication with the 'account' filter is necessary. ```json { "c": "user", "e": "account_update", "B": [ { "cu": "btc", "av": "123.4", "l": "0.5", "stk": null, "TU": 1659390246343 } ], "T": 1659412100181 } ``` -------------------------------- ### Public Channel Unsubscription Success Response JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_channels.md This JSON object indicates that the server successfully processed an unsubscription request. It includes the event type ('e'), lists the channels that were successfully unsubscribed from ('s'), echoes the original request ID ('i'), and provides a timestamp ('T'). ```JSON { "e": "unsubscribed", "s": [ {"channel": "book", "market": "btctwd", "depth": 1}, {"channel": "trade", "market": "btctwd"} ], "i": "client1", "T": 123456789 } ``` -------------------------------- ### Generating Authentication Signature - NodeJS Source: https://github.com/maicoin/max-websocket-docs/blob/master/authentication.md This Javascript snippet demonstrates how to generate the 'nonce' (current timestamp in milliseconds) and the 'signature' using HMAC-SHA256 with your API secret. These values are required for the websocket authentication message. ```Javascript const API_KEY = "api key from max website"; const API_SECRET = "api secret from max website"; const crypto = require("crypto"); const hmac = crypto.createHmac("sha256", API_SECRET); const nonce = Date.now(); const signature = hmac.update(""+nonce).digest("hex"); ``` -------------------------------- ### Unsubscribing from Public Channels JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_channels.md This JSON payload is used to unsubscribe from specific public channels. It requires setting the 'action' to 'unsub', providing a list of 'subscription' objects specifying the channels and markets to unsubscribe from, and optionally the request 'id'. Note that the provided snippet is missing a comma before the 'id' field. ```JSON { "action": "unsub", "subscription": [ {"channel": "book", "market": "btctwd", "depth": 1}, {"channel": "trade", "market": "btctwd" } ] "id": "client1" } ``` -------------------------------- ### Public Channel Subscription Success Response JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/public_channels.md This JSON object represents the success response received from the server after successfully subscribing to the specified public channels. It indicates the event type ('e'), lists the channels that were successfully subscribed ('s'), echoes the original request ID ('i'), and includes a timestamp ('T'). ```JSON { "e": "subscribed", "s": [ {"channel": "book", "market": "btctwd", "depth": 1}, {"channel": "trade", "market": "btctwd"} ], "i": "client1", "T": 123456789 } ``` -------------------------------- ### Sending Filtered Authentication Request - JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/authentication.md This JSON snippet shows the structure of the authentication request message including the 'filters' parameter to specify which types of private channel updates (e.g., order, trade, account) you wish to receive. Providing filters overrides the default behavior. ```JSON { "action": "auth", ... "filters": ["order", "trade"] // ignore account update } ``` -------------------------------- ### Receiving Authentication Success Response - JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/authentication.md This JSON snippet shows the structure of the success response message received from the server upon successful authentication for private websocket channels. It includes the event type ('authenticated'), the client ID used in the request, and a server timestamp. ```JSON { "e": "authenticated", "i": "client-id", "T": 1591686735192 } ``` -------------------------------- ### Trade Update Message Structure - MAX WebSocket - JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels.md This JSON object represents an update message received on the authenticated 'trade' channel when a new trade occurs for the user. It provides a list ('t') containing one or more new trade objects. Required authentication with the 'trade' filter is necessary. ```json { "c": "user", "e": "trade_update", "t": [{ "i": 68444, "M": "ethtwd", "sd": "bid", "p": "21499.0", "v": "0.2658", "f": "3.2", "fc": "twd", "fd": false, "fn": "5714.4342", "T": 1659216053748, "TU": 1659216054046, "m": true, "oi": 3253823664 }], "T": 1521726960357 } ``` -------------------------------- ### Order Update Message Structure - MAX WebSocket - JSON Source: https://github.com/maicoin/max-websocket-docs/blob/master/private_channels.md This JSON object represents an update message received on the authenticated 'order' channel when an order status changes. It provides a list ('o') containing one or more updated order objects. Required authentication with the 'order' filter is necessary. ```json { "c": "user", "e": "order_update", "o": [{ "i": 87, "sd": "bid", "ot": "limit", "p": "21499.0", "sp": "21499.0", "ap": "21499.0", "S": "done", "M": "ethtwd", "T": 1521726960123, "TU": 1521726960123, "v": "0.2658", "rv": "0.0", "ev": "0.2658", "tc": 1, "ci": "client-oid-1", "gi": 123 }, ...], "T": 1521726960357 } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.