FAQ - Zero Hash CLOB Integration

Central Limit Order Book FAQs.

Does the FIX API connection require SSL?

The Zero Hash CLOB FIX API endpoints accept TCP connections secured by SSL. If your FIX client library cannot establish an SSL connection natively, you can run a local proxy that establishes a secure connection and allows unencrypted local connections.

Does Zero Hash Support CancelOnDisconnect?

Zero Hash has 3 CancelOnDisconnect settings available:

  1. CancelOnDisconnect: When the config option for a FIX session is CancelOnDisconnect=Y, then when the FIX counterparty connected to such a session disconnects in an unclean fashion, all of the DAY orders submitted under that session shall be canceled by our FIX Order Gateway. However, if the session is disconnected in a clean fashion (using the standard FIX Logout flow) then the orders submitted by that session will be kept on the books.
  2. CancelOnLogout (default): Whenever our FIX counterparty disconnects for any reason whether clean or unclean, the DAY orders submitted on that session will be canceled.
  3. NoCancels: Whenever our FIX counterparty disconnects for any reason whether clean or unclean, the orders submitted on that session will remain open and can be executed while the session is disconnected.

Note: GTD & GTC orders will not cancel on disconnect, only DAY orders.

To change your default CancelOnDisconnect settings, please contact Zero Hash support to request an update.

What is the FIX Sequence Number Reset Schedule?

In Production, Zero Hash will reset their sequence numbers every Monday at 16:00 EST and new sessions will begin at 16:30 EST. (Including public holidays that fall on Monday's)

In our Certification environment, Zero Hash will reset their sequence numbers every Monday at 14:00 EST and new sessions will begin at 14:30 EST. (Including public holidays that fall on Monday's)

FIX initiators can force reset their sequence numbers at any time by sending 141=Y on their login messages.

What data schema does the CLOB use in the Market Data feed?

In the Zero Hash CLOB, we use a Market By Order (MBO) order book which allows traders and systems to see the open orders at different price levels in the market. The MBO message is used to send incremental updates to the order book. It provides information about new orders, order modifications, and order cancellations.

  • Market By Order - MBO (Standard FIX 5.0 functionality supported by Zero Hash)
    • MBO offers more visibility of the order book and position in queue for orders.

Example FIX Message:

8=FIXT.1.1 | 9=250 | 35=X | 34=5 | 49=ZERO | 52=20230828-16:55:15.397282298 | 56=TRADER-1 | 262=BCH/USD_1_1 | 268=1 | 279=1 | 269=1 | 278=1F0XXHJA5S6BP | 55=BCH/USD | 48=BCH/USD | 22=8 | 167=FXSPOT | 1151=BCH | 270=190.84 | 271=100.00000000 | 272=20230828 | 273=16:55:15.391588252 | 59=0 | 37=1F0XXHJA5S6BP | 40=2 | 10=192 |

For more information on the CLOB Market Data Schema, read our article herehere.

What are the FIX API rate limits?

  • The default FIX Order Entry API rate limit is 50 requests per session per second. There are no rate limits applied on the FIX Market Data API.
  • The rate limit for market makers is 100 is 100 requests per session per second.

What message type will I receive if I reach the rate limits of the FIX API?

When a client has reached their rate limits on the FIX API, they will receive a business level reject message. Field 58 will contain an error message.

  • Message rate limit throttled for session FIXT.1.1:ZERO-> {YOURSENDERCOMPID}

Example message:

8=FIXT.1.1 | 9=155 | 35=j | 34=135 | 49=ZERO | 52=20230605-08:51:07.364433362 | 56={YOURSENDERCOMPID} | 57=2H7ABC | 45=62 | 58=Message rate limit throttled for session FIXT.1.1:ZERO->{YOURSENDERCOMPID} | 372=D | 380=0 | 10=249 |

What values do I pass in FIX field 1 and 50?

For platforms who will support retail customer trading, field 50 will be populated with the participant_code value returned via the POST /participants/customers/new REST API endpoint.

Field 1 will be populated with the customers trading account, which is created via the POST /accounts/new REST API endpoint and returned in the account_label or participant_code field depending on your implementation and use of custom account labels.

For Liquidity Provider, Zero Hash will provide you with your Account details for FIX field 1 and your Trader ID for FIX field 50 when your connection details and Sender and Target Comp IDs are shared.

How can I create CLOB trading accounts?

CLOB trading accounts can be created via REST API through the POST /accounts/new endpoint.

Custom Account Labels

If using custom account labels, you need to pass the account_label field and your unique account label value. You will pass the account_label value in FIX field 1 on your FIX order entry messages.

Request

{
        "participant_code": "WZW872", // PARTICIPANT CODE OF ACCOUNT OWNER
        "prefunded": true/false,
        "account_label": "U54765312" // YOUR PREFERRED ACCOUNT LABEL / IDENTIFIER
} 

Response

{  
    "message": {  
        "participant_code": "WZW872",  
        "account_group": "XA8YGC",  
        "account_label": "U54765312",  
        "prefunded": true  
    }  
}

General Account

If you do not use custom account labels, and your customer balances will be in the general account label, you should not pass the account_label field in your request. You will pass the participant_code in FIX field <1> on your FIX order entry messages.

Request

 {
       "participant_code": "WZW872", // PARTICIPANT CODE OF ACCOUNT OWNER
       "prefunded": true/false
}

Response

{
    "message": {
        "participant_code": "WZW872",
        "account_group": "XA8YGC",
        "account_label": "general",
        "prefunded": true
    }
}

What options are supported in ExecInst (FIX Field 18)?

  • "6": [PARTICIPATE DONT INITIATE] Order that participants in a transaction initiated by another party, may not initiate a transaction.
  • "c": [IGNORE PRICE VALIDITY CHECKS] Order will ignore minimum order size check and relative price limits (i.e. “price bands”), this can be used when liquidating a customers entire cryptocurrency balance if below $1.00.

This field can also be left blank and is not mandatory. Zero Hash does not support passing multiple values in FIX field 18.

Is TransactTime <Field 60> always in nanosecond precision?

Zero Hash will always send TransactTime <Field 60> with nanosecond precision as our default behavior. However, the client is free to submit with millisecond precision.

Would the client be free to send TransactTime with any precision?

Yes, Zero Hash supports both nanoseconds and millisecond precision in the TransactTime field (Tag 60).

Can the client use the canonical textual representation of UUIDs for ClOrdId and OrigClOrdId?

Yes, The client can use the canonical UUID textual representations of the fields and no issue with them being 36 characters.

What is the maximum length in char is for ClOrdId and OrigClOrdId?

  • ClOrdID and OrigClOrdID <Fields 11 & 41> are both string fields so no "limit" on size, but Zero Hash has tested up to 64 characters, so it is not advisable to cross this size.
  • OrigClOrdID <Field 41> should be filled with the ClOrdID of the order in question that would be canceled by the order cancellation request.

How do I identify fills on the order entry session?

Partial Fills and Fully Filled orders are sent as execution reports with OrdStatus(39) = 1 or OrdStatus(39) = 2 and ExecType(150) = F.

No other ExecType should be used to identify your fills.

What are ExecType(150) = J and ExecType(150) = K messages?

150=J & 150=K are indicative of the clearing status of the aggressing trade and should not be treated as new fills. The GET /trades REST API endpoint is the preferred method to obtaining the current clearing status of any trade.

Can I rely on OrdStatus(39) field to identify new fills?

No, the OrdStatus(39) field needs to be used in conjunction with ExecType(150) to determine the true status of any Execution Report message sent by Zero Hash.

How are the CLOB IDs mapped to the GET /trades endpoint?

Below is how CLOB FIX IDs returned in Fill or Partial Fill Execution Report messages are mapped into Zero Hash's GET /trades REST API response:

Note: If you are the aggressing party on the trade, your values will be in party_0 fields. If you are the passive party, your values will be mapped in party_1 fields.

GET /trades Fields CLOB FIX Tags

  • client_trade_id 17 ExecID
  • party_0_order_id (if aggressor) 37 OrderID
  • party_0_client_order_id (if aggressor) 11 ClOrdID
  • party_0_execution_id (if aggressor) 17 ExecID
  • party_1_order_id (if passive) 37 OrderID
  • party_1_client_order_id (if passive) 11 ClOrdID
  • party_1_execution_id (if passive) 17 ExecID

Does Zero Hash’s FIX API scale on either price or order quantity?

No, Zero Hash does not scale any values that have been submitted over our FIX API.

How can I identify orders in market data feed?

Once an order is sent to Zero Hash, ZH acknowledges the order and an OrderID <Field 37> is provided in the execution report. You can identify the orders via this OrderID. This OrderID is the same value that will be in field 37 on the FIX market data on new orders or updates.

Does Zero Hash offer REST API Access?

Yes. In order to authenticate to our REST API, you will need API credentials. API keys can be created once your Zero Hash implementation team grants you access to the Zero Hash Client Portal.

Once granted access, please refer to this refer to Creating API Keys article for details on how generate API keys.

Note: Your platform must be CLOB enabled to be able to access all CLOB related REST API endpoints. Please contact your implementation manager if you want your CLOB access.

Are the REST API numbers scaled?

On the Zero Hash API, the CLOB specific endpoints scale numbers. Only the endpoints specified in the central-limit-order-book https://docs.zerohash.com/web/#central-limit-order-book section. Fields that are price related are scaled with the price_scale while fields which related to quantity are scaled with fractional_qty_scale.

Retrieving the Scale Factor

To find the details of the scale factor for each symbol, you can query POST /orders/v1/list_instruments.

if __name__ == '__main__':

	response = send_signed_http_request('POST', '/orders/v1/list_instruments', {})

Fields that are price related are scaled with the price_scale while fields which related to quantity are scaled with fractional_qty_scale.

What is the value do I pass in field account?

Zero Hash will provide your platform code. This platform code will be used in this account field. The value to be passed in this field should follow the convention of:

  • firms/[platform code]/accounts/[account label]

Does Zero Hash scale the values of fields such as order_qty, cum_qty, avg_px, leaves_qty, etc.?

Yes, when using the CLOB API endpoints, certain fields are scaled in to capture fraction-based transactions of cryptocurrencies.

On the Zero Hash CLOB, fields that are price related are scaled with the price_scale while fields which related to quantity are scaled with fractional_qty_scale.

These price_scale and fractional_qty_scale varies per asset. To find the details for the asset you are interested in, you may query the endpoint:

What are the REST API rate limits?

The default REST API order entry rate limit is 50 requests per second. There are no rate limits applied on the REST Market Data API.

The rate limit for market makers is 100 requests per session per second.

How can I enter orders via REST API?

To place an order on the Zero Hash CLOB, you can use the Submit Order. Parameter details for this endpoint is available in our CLOB API documentation.

How can I search orders via REST API?

The search orders endpoint returns a list of your orders on the CLOB that match the requested query parameters. You may refer to our CLOB API documentation for more details.

Can I cancel orders via REST API?

Yes, to cancel an order on the Zero Hash CLOB, you may use the cancel order endpoint.

Parameter details for this endpoint is available in our CLOB API documentation.

Are trade stats available via REST API?

Yes, trade stats are available via the trade stats endpoint. It returns a list of trading stats for a given symbol. You may refer to our CLOB API documentation for more details.