NAV Navbar
API
  • Overview
  • REST
  • Authentication
  • Rate limits
  • Errors
  • Private Endpoints
  • Orders
  • Fills
  • Transactions
  • Balances
  • Public Endpoints
  • Products
  • Ticker
  • Order Book
  • Trade History
  • Candles
  • Stats
  • Time
  • WebSocket
  • Subscribe
  • Sequence Numbers
  • Rate limits
  • Private Events
  • Order
  • Balance
  • Deposit
  • Public Events
  • Heartbeat
  • Ticker
  • Book
  • Trades
  • Overview

    Introduction

    WCX offers both REST and WebSocket APIs. This documentation outlines API functionality and provides code examples in the right-side column.

    You can use the API to programmatically place new orders, check your balance, or stream real-time price and order book updates, among other things.

    All request and response bodies are encoded in JSON (application/json). All requests must be made over SSL.

    Data Types

    Timestamp

    All timestamps are in milliseconds since UNIX epoch. Some endpoints, particularly those relating to the matching engine, will return millisecond timestamps with microsecond precision, encoded as string.

    1511482279491.739

    All date libraries in modern languages should be able to handle this without issue.

    Numbers

    We recommend passing all numbers as strings in your requests, instead of integers or floats, to preserve precision and accurate processing.

    Numbers returned by the API, particularly decimals, will be returned as strings.

    REST

    Endpoint URL

    https://api.wcex.com

    Authentication

    Getting your API Key

    Your API key and secret are available on your Settings page. Use them to sign requests to private API endpoints.

    Signing a Request

    import crypto from 'crypto'
    
    // Signing a New Order request
    
    const API_SECRET = "6a0ef...";
    
    const TIMESTAMP = Date.now();
    
    const body = JSON.stringify({
        product: "ETH-BTC",
        side: "sell",
        size: "10",
        price: "0.04",
        condition: "PO"
    });
    
    const message_to_sign = TIMESTAMP + "POST" + "/new-order" + body;
    
    const hmac = crypto.createHmac('sha256', API_SECRET);
    
    return hmac.update(message_to_sign).digest('base64');
    
    

    Requests to private REST API endpoints must contain these headers:

    To sign a request, first create the message to sign, which is the concatenated string:

    timestamp + method + path + body

    where:

    Generate a SHA-256 HMAC of this string using your API secret, then Base64-encode the output to get WCX-SIG.

    Timestamp

    WCX-TIMESTAMP is the current timestamp, in milliseconds since UNIX epoch. Providing it helps prevent man-in-the-middle attacks and provides request replay protection.

    It has to be within 30 seconds of server time for the request to be valid. You can check the server time using the /time endpoint.

    Rate limits

    WCX rate limits its API to prevent abuse that would degrade the exchange's ability to maintain top-notch performance for all traders.

    By default, all endpoints are limited to 5 requests per second per IP. Requests that exceed this limit will receive a Rate Limit Exceeded error with status code 429.

    If you're doing sub-second trading, consider using our batch orders endpoints. They allow you to submit or cancel up to 10 orders in one request.

    For real-time data, we highly recommend you subscribe to WebSocket events instead of polling REST endpoints.

    Errors

    Bad requests receive an HTTP 4xx response with a message describing the error.

    Code Description
    401 Unauthorized – Authentication error
    402 Failed Request
    403 Forbidden
    404 Resource Not Found
    422 Unprocessable Entity – there was an issue parsing your request
    429 Rate Limit Exceeded – too many requests
    5xx Internal Server Error – there was a problem with our servers

    If the request is successful, a 200 (OK) status code is returned, along with an optional body as documented in this API reference.

    Private Endpoints

    Orders

    Place a New Order

    Place a post-only limit order to sell 10 ETH at 0.04.

    Request

    {
      "product": "ETH-BTC",
      "side": "sell",
      "size": "10",
      "price": "0.04",
      "condition": "PO"
    }
    

    Response

    {
      "id": "9d335cce-d581-45f6-8efc-bdab3d61c6e2",
      "product": "ETH-BTC",
      "type": "limit",
      "side": "sell",
      "size": "5.00000000",
      "price": "0.04",
      "condition": "PO",
      "filled": "0.00000000",
      "timestamp": "1511467005839.417"
    }
    

    HTTP Request

    POST /new-order

    Parameters

    Name Description
    product A valid product
    type Can be limit (default), market, stop, or stop-limit
    side Can be buy or sell
    size * Amount of base asset to buy or sell
    funds * Amount of counter asset to buy or sell
    price ** Price of your order

    * funds must be specified for buy market and buy stop orders. In all other cases, size must be specified. Only one of funds or size can be set.

    ** Price can be ignored for market orders, but is required for all other order types. For stop orders, this is the price at which the stop order triggers, otherwise known as the stop price.

    As an alternative to market orders, you can use limit orders with price set deep in the opposite book. This allows you to set size (instead of funds) and a price, which gives you an execution price guarantee.

    A list of products can be found by querying the /products endpoint.

    Limit order parameters

    For limit orders, you can specify an execution policy condition. This parameter is optional.

    Name Description
    condition Can be GTC (default), IOC, or PO

    GTC Good till cancelled orders will remain on the book until they're cancelled. This is the default order placement behavior.

    IOC Immediate-or-cancel orders will only remove liquidity from the book. When submitted, the order will fill partially or fully and any outstanding amount that is not matched is cancelled, so that no part of the order appears on the book.

    PO Post-only orders will only add liquidity to the book. If any part of the order results in taking liquidity, the order will be rejected and no part of it will execute.

    Stop-limit order parameters

    For stop-limit orders, limit_price must be specified in addition to the default request parameters.

    Name Description
    limit_price The limit price of a stop-limit order

    Client order ID

    You can send an optional client_order_id in your new order request. This field's value must be a UUID (v4) generated by you. It will be included in received, open, and set WebSocket events and can be used to track the state of your order.

    Order lifecycle

    Your account must have sufficient balance to submit an order. An order that is successfully received by the matching engine will be marked as received.

    If any part of the order results in adding liquidity to the book, it will be marked as open.

    Stop orders do not appear on the book. A successfully submitted stop order will be marked as set.

    An order that is completely filled and off the book will be marked as done.

    Response

    An order accepted by the matching engine will be assigned an order id which will appear in the response.

    filled specifies the amount that was matched as a result of your order.

    timestamp is the time your order was received by the matching engine.

    Cancel an Order

    Request

    {
      "id": "9d335cce-d581-45f6-8efc-bdab3d61c6e2",
      "product": "ETH-BTC"
    }
    

    Response

    {
      "id": "9d335cce-d581-45f6-8efc-bdab3d61c6e2"
    }
    

    HTTP Request

    POST /cancel-order

    Parameters

    Name Description
    id The ID of the order to cancel
    product The product the order is open for

    Providing product is optional, but it's recommended because it greatly speeds up the cancel operation by skipping the id-to-product lookup.

    Response

    A 200 status with the id of the cancelled order.

    If an order could not be cancelled (if it has been already filled, does not exist, etc.), an error is returned.

    Batch Orders

    Place two limit orders followed by a cancel order.

    Request

    {
      "product": "ETH-BTC",
      "orders": [{
        "side": "buy",
        "size": "15",
        "price": "0.03664"
      },
      {
        "side": "sell",
        "size": "12",
        "price": "0.054663",
        "condition": "PO"
      },
      {
        "id": "6c26914e-40f4-11e8-842f-0ed5f89f718b",
        "cancel": true
      }]
    }
    

    Response

    [{
      "id": "3e89d474-0569-4ea9-9f5e-6f81c1984d2f",
      "type": "limit",
      "side": "buy",
      "size": "15.00000000",
      "price": "0.03664",
      "filled": "0.00000000",
      "timestamp": "1511487005839.417"
    },
    {
      "id": "9d97aec3-5e86-4eac-a1b4-8404423837b2",
      "type": "limit",
      "side": "sell",
      "size": "12.00000000",
      "price": "0.054663",
      "condition": "PO",
      "filled": "0.00000000",
      "timestamp": "1511487005839.427"
    },
    {
      "id": "6c26914e-40f4-11e8-842f-0ed5f89f718b",
      "cancel": true,
      "type": "limit"
    }]
    

    HTTP Request

    POST /batch-order

    Parameters

    Name Description
    product A valid product
    orders An array of up to 10 new order or cancel order requests

    Orders will be executed by the matching engine in the order they are submitted.

    For cancellation requests, cancel: true must be set.

    Your account must have sufficient balance to honor all the new orders requests you place in your batch order; otherwise, the entire batch order request will fail.

    Response

    An array of order responses.

    List Orders

    Response

    [
        {
            "id": "b20265e7-8d28-476a-8758-c6113ad98c0b",
            "product": "ETH-BTC",
            "size": "2.34977543",
            "funds": "0.00000000",
            "filled": "0.00000000",
            "price": "0.053435",
            "side": "sell",
            "type": "limit",
            "timestamp": "1511252206104.628"
        },
        {
            "id": "b361e636-46cd-4a34-a532-d454c9e7b4b6",
            "product": "ETH-BTC",
            "size": "4.52120565",
            "funds": "0.00000000",
            "filled": "0.00000000",
            "price": "0.053147",
            "side": "sell",
            "type": "limit",
            "timestamp": "1511252184729.679"
        }
    ]
    

    List your open orders. Both limit and stop orders are returned, ordered by submission time.

    HTTP Request

    GET /orders

    Query Parameters

    You can optionally pass a limit query parameter to limit the number of orders returned. By default, 100 items are returned.

    Name Default Description
    limit 100 Number of orders to return (max is 100)

    E.g. /orders?limit=50.

    Keeping track of your order states

    We recommend listening to streaming WebSocket order events to maintain an up-to-date view of your open orders. It's faster and in many cases more accurate than polling this endpoint, because an order's state may change between the time you make an HTTP request and receive a response.

    Polling this endpoint is highly discouraged.

    Response

    An array of your open orders.

    Fills

    Response

    [
        { 
            "order_id_taker": "bf2b704c-010a-48ca-93fb-d0193f24420a",
            "order_id_maker": "31bf3a89-2a0a-40b0-9327-ec0a5cc3ce3c",
            "product": "ETH-BTC",
            "size": "0.77942322",
            "price": "0.05132",
            "side": "buy",
            "fee": "0.000039000",
            "timestamp": "1511482279491.739"
        },
        {
            "order_id_taker": "c6023aca-333a-44d9-98fe-279e279f3a86",
            "order_id_maker": "7f66a16c-0b47-4bd6-8add-6b2c33366082",
            "product": "ETH-BTC",
            "size": "0.97422208",
            "price": "0.051323",
            "side": "buy",
            "fee": "0.00146133",
            "timestamp": "1511482127568.782"
        }
    ]
    

    List your recent fills, ordered by fill time.

    HTTP Request

    GET /fills

    Query Parameters

    Name Default Description
    product all Limit fills returned to this product
    limit 100 Number of fills to return (max is 100)
    timestamp N/A Return fills that occurred before this time

    E.g. /fills?product=LTC-BTC&limit=50&timestamp=1511481127561.

    Keeping track of your fills

    We recommend listening to streaming WebSocket match events to maintain an up-to-date view of your fills. It's faster and more accurate than polling this endpoint.

    Polling this endpoint is highly discouraged.

    Response

    An array of your recent fills.

    Transactions

    Response

    [
        {
            "id": "5a1763b061c5ebb76371872d",
            "asset": "BTC",
            "amount": "0.00002000",
            "type": "fee",
            "timestamp": "1511482279491.739"
        },
        {
            "id": "5a1763b061c5ebb76371872e",
            "asset": "BTC",
            "amount": "0.04000000",
            "type": "trade",
            "timestamp": "1511482279491.739"
        },
        {
            "id": "5a136c8e61c5ebb76369bb36",
            "asset": "BTC",
            "amount": "1.00000000",
            "txid": "88129031ad5650faa1e1f0e42829e1dcb7f75d069b9d44b8ade27a2d3ab868bd",
            "type": "deposit",
            "timestamp": "1511222409359.000"
        }
    ]
    

    List your transactions.

    A transaction is an entry in your account ledger that affects your account balance. It can be an external transfer, such as a deposit or withdrawal, or an internal transfer, such as a trade or a fee.

    HTTP Request

    GET /transactions/:asset

    Parameters

    Name Description
    asset Asset for which to return transactions

    asset is required. E.g. BTC, LTC, ETH, etc.

    Query Parameters

    Name Default Description
    type all Can be all, deposit, withdraw, trade, fee, or rebate
    limit 100 Number of transactions to return (max is 100)
    timestamp N/A Return transactions that occurred before this time

    E.g. /transactions/BTC?type=deposit&limit=50&timestamp=1511481127561.

    Order settlement

    There is a small window between an order being executed by the matching engine and settled by the post-trade system. trade and fee transactions appear once the order is settled.

    Response

    An array of transactions on your account.

    Balances

    Response

    [ 
        {
            "asset": "ETH",
            "available": "887.50070583",
            "total": "996.72128261"
        },
        {
            "asset": "BTC",
            "available": "45.16729606",
            "total": "91.33222695"
        }
    ]
    

    List your balances, grouped by asset.

    HTTP Request

    GET /balances/:asset(s)

    Parameters

    Name Description
    asset(s) (optional) One or more comma-separated assets

    Omitting asset(s) will return all balances on your account. Only non-zero balances, or assets for which you have made at least one deposit will be returned.

    Available balance

    Your available balance is equal to your total balance minus the amount that's been placed on hold.

    When you place an order, the amount used for the order is placed on hold until the order is filled or cancelled.

    When you request a withdrawal, the amount of the withdrawal is placed on hold until the withdrawal is processed or cancelled.

    Response

    An array of balances on your account.

    Public Endpoints

    Products

    Response

    [
        "ETH-BTC",
        "LTC-BTC"
    ]
    

    List products available to trade.

    HTTP Request

    GET /products

    Response

    An array of products.

    Ticker

    Response

    {
        "product": "ETH-BTC",
        "price": "0.05132",
        "bid": "0.04",
        "ask": "0.05132",
        "bid_size": "5.00000000",
        "ask_size": "9.22057678",
        "timestamp": "1511482279492.542"
    }
    

    HTTP Request

    GET /ticker/:product

    Parameters

    Name Description
    product A valid product

    Polling this endpoint is discouraged in favor of subscribing to WebSocket events.

    Order Book

    Response

    {
        "bids":[
            ["0.04", "5.00000000", 1],
            ["0.039465", "4.24022501", 1]
        ],
        "asks":[
            ["0.05132", "9.22057678", 1],
            ["0.051323", "3.52460275", 1]
        ]
    }
    

    Get a list of open bid and ask levels for a product.

    HTTP Request

    GET /book/:product

    Parameters

    Name Description
    product A valid product

    Query Parameters

    Name Default Description
    limit 100 Number of orders, per side, to return (max is 100)

    E.g. /book/ETH-BTC?limit=50.

    Polling this endpoint is discouraged in favor of subscribing to WebSocket events.

    Response

    The current bids and asks for a product.

    Each item in the bids or asks array returned is an array consisting of the price, size, and number of orders open at this level.

    Trade History

    Response

    [
        {
            "product": "ETH-BTC",
            "order_id_taker": "bf2b704c-010a-48ca-93fb-d0193f24420a",
            "order_id_maker": "31bf3a89-2a0a-40b0-9327-ec0a5cc3ce3c",
            "size": "0.77942322",
            "price": "0.05132",
            "side": "buy",
            "timestamp": "1511482279492.417"
        },
        {
            "product": "ETH-BTC",
            "order_id_taker": "c6023aca-333a-44d9-98fe-279e279f3a86",
            "order_id_maker": "7f66a16c-0b47-4bd6-8add-6b2c33366082",
            "size": "0.97422208",
            "price": "0.051323",
            "side": "buy",
            "timestamp": "1511482127569.335"
        }
    ]
    

    Get the latest trades for a product.

    HTTP Request

    GET /trades/:product

    Parameters

    Name Description
    product A valid product

    Query Parameters

    Name Default Description
    limit 100 Number of orders, per side, to return (max is 100)
    timestamp N/A Return trades that occurred before this time

    E.g. /trades/ETH-BTC?limit=50&timestamp=1511481127561.

    Polling this endpoint is discouraged in favor of subscribing to WebSocket events.

    Response

    An array of the latest trades.

    side indicates the taker order side. A buy indicates an up-tick and a sell indicates a down-tick.

    Candles

    Response

    [
        [
            1511481600,
            0.051323,
            0.051323,
            0.05132,
            0.05132,
            "1009.753645"
        ],
        [
            1511467200,
            0.051323,
            0.051323,
            0.051323,
            0.051323,
            "3201.906964"
        ],
        [
            1511251200,
            0.044683,
            0.053744,
            0.042048,
            0.045321,
            "3310.527428"
        ]
    ]
    

    Get historical candles for a product. Candles returned are grouped by resolution.

    HTTP Request

    GET /candles/:product/:resolution

    Parameters

    Name Description
    product A valid product
    resolution Candle resolution to return. Can be 5, 15, 60, 240, or 1D.

    Query Parameters

    Name Default Description
    start 0 The time after which to fetch candles, in ms
    end Current time The time before which to fetch candles, in ms

    E.g. /candles/ETH-BTC/60?start=1511480127561&end=1511480129513 fetches 1h candles between the start and end timestamps.

    A maximum of 100 candles are returned per request.

    Response

    Each item in the array returned represents a candle with granularity resolution:

    volume is returned as string to preserve float number precision. If the candle is active, close is the last price.

    Stats

    Response

    {
        "product": "ETH-BTC",
        "last_price": "0.04136",
        "price_day_ago": "0.05128",
        "volume": "8883.0512",
        "timestamp": "1511482279492.542"
    }
    

    HTTP Request

    GET /stats/:product

    Parameters

    Name Description
    product A valid product

    Response

    timestamp represents the time the stats for the requested product were last updated.

    Time

    Response

    {
        "timestamp": 1511572042589
    }
    

    Get server time.

    HTTP Request

    GET /time

    WebSocket

    Endpoint URL

    wss://data.wcex.com

    Subscribe

    {
      "type": "subscribe",
      "product": "ETH-BTC",
      "channels": [
        "ticker",
        "book",
        "trades"
      ]
    }
    
    {
      "type": "unsubscribe"
    }
    

    To receive WebSocket events, you must first send a subscribe message with the product and channels you wish to subscribe to.

    You can unsubscribe in a similar fashion, by sending an unsubscribe message.

    Channels

    You can subscribe to the following channels:

    Public channels

    Private channels

    Authenticating

    {
      "type": "subscribe",
      "product": "ETH-BTC",
      "channels": [
        "ticker",
        "orders",
        "balances"
      ],
      "auth": {
        "key": "8b6bcdc6-5ef8-463b-833f-3681dc2c90d3",
        "sig": "5a1073b62e4dd62e4dd56244c89941...",
        "timestamp": 1511027890939
      }
    }
    

    To receive events from private channels, you must authenticate when sending the initial subscribe message.

    Authentication is similar to REST request signing and authentication. Pass in an auth field in your subscribe message containing:

    Sequence Numbers

    Events received through the WebSocket contain a sequence number. This is an integer value that will increase by 1 for each event sent for the duration of your connection.

    You can ensure that you're receiving WebSocket messages in the expected order, and without dropped messages, by keeping track of the sequence numbers.

    If you observe out of order sequence numbers, or dropped sequence numbers, you may need to disconnect and reconnect.

    Each WebSocket connection keeps track of sequence numbers independently, so if you have multiple WebSocket connections open, keep in mind to track sequence numbers separately.

    Rate limits

    WebSocket subscribe and unsubscribe messages are rate limited to 1 per 5 seconds per IP.

    If you're being rate-limited, you'll receive a response with type error.

    Private Events

    Order

    Received

    {
        "event": "received",
        "sequence": 43,
        "id": "bf2b704c-010a-48ca-93fb-d0193f24420a",
        "product": "ETH-BTC",
        "size": "0.77942322",
        "price": "0.05132",
        "side": "buy",
        "type": "limit",
        "timestamp": "1511482279492.417"
    }
    

    A received event is an acknowledgement by the matching engine that your order has been accepted for initial processing, regardless of whether it has filled or not.

    Received orders that begin to fill trigger one or more match events. Received orders that result in an open order on the book trigger an open event.

    Open

    {
        "event": "open",
        "sequence": 44,
        "id": "bf2b704c-010a-48ca-93fb-d0193f24420a",
        "product": "ETH-BTC",
        "size": "0.77942322",
        "filled": "0.2451223",
        "price": "0.05132",
        "side": "buy",
        "type": "limit",
        "timestamp": "1511482279492.417"
    }
    

    An open event means that your order is now visible on the book with a non-zero amount. Open orders remain on the book until they are filled or cancelled.

    size is the original size of the order. filled indicates how much of the order was filled after going on the book.

    Market and stop orders will never trigger an open event.

    Set

    {
        "event": "set",
        "sequence": 45,
        "id": "c6023aca-333a-44d9-98fe-279e279f3a86",
        "product": "ETH-BTC",
        "size": "0.88210022",
        "price": "0.05132",
        "side": "buy",
        "type": "stop",
        "timestamp": "1511432679991.121"
    }
    

    A set event indicates that a stop or stop-limit order has been set successfully. Stop-limit orders will also have a limit_price field that indicates the limit price for that order.

    Triggered

    {
        "event": "triggered",
        "sequence": 48,
        "id": "c6023aca-333a-44d9-98fe-279e279f3a86",
        "product": "ETH-BTC",
        "size": "0.88210022",
        "price": "0.05132",
        "side": "buy",
        "type": "stop",
        "timestamp": "1511434619393.320"
    }
    

    A triggered event indicates that your stop or stop-limit order has been triggered and will become visible on the book.

    Match

    {
        "event": "match",
        "sequence": 66,
        "product": "ETH-BTC",
        "order_id_taker": "7ec97c53-75b2-4e9b-bdfa-6eca818f8c8d",
        "order_id_maker": "5d818156-fc9a-4bfe-b0e3-1ef3f3f5d799",
        "size": "11.774650",
        "price": "0.04771",
        "side": "buy",
        "timestamp": "1511434619393.320"
    }
    

    A match event indicates that a trade occurred concerning one of your orders. side represents the taker side: a buy side match is an up-tick and a sell side match is a down-tick.

    Done

    {
        "event": "done",
        "sequence": 91,
        "id": "bf2b704c-010a-48ca-93fb-d0193f24420a",
        "product": "ETH-BTC",
        "price": "0.05132",
        "side": "buy",
        "timestamp": "1511434699393.991"
    }
    

    A done event indicates that your order has been fully filled and is no longer visible on the book.

    Cancelled

    {
        "event": "cancelled",
        "sequence": 812,
        "id": "31bf3a89-2a0a-40b0-9327-ec0a5cc3ce3c",
        "product": "ETH-BTC",
        "size": "1.22393981",
        "price": "0.03131",
        "side": "buy",
        "type": "limit",
        "timestamp": "1511434617391.877"
    }
    

    A cancelled event indicates that your cancel request has been processed by the matching engine.

    Balance

    {
        "event": "balance",
        "sequence": 42,
        "updates": [
            {
                "asset": "ETH",
                "available": "377.9934",
                "total": "9939.122"
            },
            {
                "asset": "BTC",
                "available": "18.1221",
                "total": "55.991"
            }
        ]
    }
    

    A balance event is a balance update notification sent whenever one or more of your balances changes.

    The total balance value will appear only if it has changed.

    Deposit

    {
        "event": "deposit",
        "sequence": 661,
        "amount": "3.556",
        "asset": "BTC",
        "timestamp": "1511482279491"
    }
    

    A deposit event indicates that a new deposit has been detected on your account. It will only be sent once per deposit.

    The deposit may still be unconfirmed. Use the balance event to get notified when the deposit is credited to your balance.

    Public Events

    Heartbeat

    {
        "event": "heartbeat",
        "sequence": 55,
        "timestamp": 1511482279491
    }
    

    WCX will send a heartbeat event every five seconds so you'll know your WebSocket connection is active. Hearbeats also include sequence numbers which you can use to check that no messages were missed.

    If you miss one or more heartbeats, or your sequence numbers contain gaps, your connection may be unreliable. We recommend that you disconnect and reconnect.

    Ticker

    Snapshot

    {
        "type": "snapshot",
        "channel": "ticker",
        "product": "ETH-BTC",
        "data": {
            "price": "0.04771",
            "bid": "0.04770",
            "ask": "0.04773",
            "bid_size": "33.881",
            "ask_size": "12.913",
            "timestamp": "1511482279491.883"
        }
    }
    

    When you first subscribe to the ticker channel, you'll receive a snapshot of the ticker.

    Event

    {
        "event": "ticker",
        "sequence": 211,
        "product": "ETH-BTC",
        "price": "0.04771",
        "bid": "0.04770",
        "ask": "0.04773",
        "bid_size": "33.881",
        "ask_size": "12.913",
        "timestamp": "1511482279491.883"
    }
    

    The ticker event provides real-time price updates and is sent every time a match occurs.

    Book

    Snapshot

    {
        "type": "snapshot",
        "channel": "book",
        "product": "ETH-BTC",
        "data": {
            "bids": [
                ["0.04", "4.90000000", 1],
                ["0.039465", "4.24022501", 1],
                ["0.039462", "0.81290040", 1],
                ["0.039375", "1.99379837", 1]
            ],
            "asks": [
                ["0.05132", "9.22057678", 1],
                ["0.051323", "3.52460275", 1],
                ["0.051885", "0.23329705", 1],
                ["0.053011", "1.88536196", 1]
            ]
        }
    }
    

    When you first subscribe to the book channel, you'll receive a snapshot of the order book containing up to 100 bids and 100 asks.

    Event

    {
        "event": "book",
        "sequence": 991,
        "product": "ETH-BTC",
        "updates": [
            ["0.04771", "1.44543", 1, 0],
            ["0.05892", "2.99112", 2, 1],
        ]
    }
    

    A book event provides real-time order book updates. It contains an updates array that contains arrays representing price level deltas.

    Each delta array contains:

    This event is batched and sent every 500 milliseconds at most.

    Trades

    Snapshot

    {
        "type": "snapshot",
        "channel": "trades",
        "product": "ETH-BTC",
        "data": [
            {
                "timestamp": "1511507963627.726",
                "product": "ETH-BTC",
                "taker_order_id": "605aa534-aa09-4c9d-bef5-9d8f70c00a72",
                "maker_order_id": "9d335cce-d581-45f6-8efc-bdab3d61c6e2",
                "size": "0.10000000",
                "price": "0.04",
                "side": "sell"
            },
            {
                "timestamp": "1511507893098.827",
                "product": "ETH-BTC",
                "taker_order_id": "be9f10c6-166c-4c45-bcc0-f7f34d10399b",
                "maker_order_id": "380e9304-091c-4ca7-852d-19ddf5ccc925",
                "size": "0.10000000",
                "price": "0.051313",
                "side": "sell"
            }
        ]
    }
    

    When you first subscribe to the trades channel, you'll receive a snapshot of the most recent trades (up to 100).

    Event

    {
        "event": "trade",
        "sequence": 439,
        "product": "ETH-BTC",
        "taker_order_id": "7ec97c53-75b2-4e9b-bdfa-6eca818f8c8d",
        "maker_order_id": "5d818156-fc9a-4bfe-b0e3-1ef3f3f5d799",
        "size": "11.774650",
        "price": "0.04771",
        "side": "buy",
        "timestamp": "1511434619393.320"
    }
    

    A trade event indicates that a trade occurred on the market. side represents the taker side: a buy side match is an up-tick and a sell side match is a down-tick.