Order Status Updates

Subscribing for order status updates

To subscribe for order status updates, send the subscribe operation specifying the market name and the address.

Example:

{
  "op": "subscribe",
  "args": "orderUpdates:NEO-APH:AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y"
}

Unsubscribe for order status updates

Unsubscribing is performed in the same manner as subscribing, but by changing the operation to unsubscribe.

Example:

{
  "op": "unsubscribe",
  "args": "orderUpdates:NEO-APH:AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y"
}

Messages received when subscribed

The following messages are emitted when subscribed to an orderUpdate channel.

  • orderCreated - sent to maker to confirm order creation

    { "type": "orderCreated",
    "pair": "GAS-APH",
    "side": "ask",
    "data": { "offerId" : "{{offer id}}",
              "quantity": "{{quantity}}",
              "price": "{{price}}",
              "createdTime" : "{{createdTime}}",
              "blockIndex" : "{{blockIndex}}"
            }
    }
    
  • orderCreationFailed - sent to the maker to explain why order creation failed

    { "type": "orderCreationFailed",
      "pair": "GAS-APH",
      "side": "ask",
      "offerId": "{{offer id}}",
      "errorMessage": "{{error message}}",
      "blockIndex": "{{block index when failure occurred}}"
    }
    
  • orderCancelled - sent to maker to confirm order cancellation

    { "type": "orderCancelled",
      "pair": "GAS-APH",
      "side": "ask",
      "data": { "offerId": "{{offer id}}",
                "pendingQuantity": "{{quantity left pending at time of cancel}}",
                "remainingQuantity": "{{quantity remaining at the time of match}}",
                "initialQuantity": "{{the quantity initially int he order}}",
                "blockIndex" : "{{blockIndex}}"
              }
    }
    
  • orderMatchPending - sent to maker and taker when a match is pending

    { "type": "orderMatchPending",
      "pair": "GAS-APH",
      "side": "ask",
      "data": { "offerId": "{{offer id}}",
                "price": "{{price}}",
                "quantity": "{{the quantity being traded}}",
                "pendingQuantity": "{{the quantity pending match in the offer}}",
                "remainingQuantity": "{{the quantity remaining in the offer}}",
                "initialQuantity": "{{the quantity initially in the order}}",
                "matchPendingTime": "{{time when the order match was send}}",
                "txHash": "{{hash of the match transaction}}" 
              }
    }
    
  • orderMatched - sent to maker and taker when a trade occurs

    { "type": "orderMatched",
      "pair": "GAS-APH",
      "side": "ask",
      "data": { "offerId": "{{offer id}}",
                "price": "{{price}}",
                "quantity": "{{quantity matched}}",
                "pendingQuantity": "{{the quantity pending match in the offer}}",
                "remainingQuantity": "{{the quantity remaining in the offer}}",
                "initialQuantity": "{{the quantity initially in the order}}",
                "matchedTime" : "{{time}}",
                "blockIndex" : "{{block index the trade settled}}",
                "txHash": "{{hash of the match transaction}}" 
              }
    }
    
  • orderMatchFailed - sent to maker and taker when a match failed for some reason

    { "type": "orderMatchFailed",
      "pair": "GAS-APH",
      "side": "ask",
      "data": { "offerId": "{{offer id}}",
                "quantity": "{{quantity attempted to match}}",
                "pendingQuantity": "{{quantity left pending}}",
                "remainingQuantity": "{{quantity remaining to be filled}}",
                "initialQuantity": "{{the quantity initially int he order}}"
                "errorMessage": "{{error message}}",
                "blockIndex" : "{{blockIndex}}"
                "txHash": "{{hash of the match transaction}}" 
              }
    }