Submit order

Submit a new order to the CLOB.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Price and Quantity Scaling

The zerohash CLOB uses scaled integers for price and quantity values. Think of this like converting Dollars to Cents so you never have to deal with a decimal point.

How it works

You take your human-readable price or quantity and multiply it by the "Scale" factor found in List Instruments response.

  • Price: int(round(human_readable_price *price_scale))
  • Quantity: int(round(human_readable_price *fractional_qty_scale))

Example of sending a Buy Limit orders;

# Inputs
human_price = 78000.00
human_qty = 0.5

# Scales from BTC instrument object
p_scale = 100
q_scale = 100000000

# Logic: Multiply and round to remove decimal artifacts
scaled_price = str(int(round(human_price * p_scale)))
scaled_qty = str(int(round(human_qty * q_scale)))

payload = {
    "side": "SIDE_BUY",
    "time_in_force": "TIME_IN_FORCE_DAY",
    "type": "ORDER_TYPE_LIMIT",
    "order_qty": scaled_qty,   # "50000000"
    "price": scaled_price,     # "7800000"
    "clord_id": "ORDER-BTC-001",
    "symbol": "BTC/USD"
}
# Inputs
human_price = 0.012262
human_qty = 1000.0

# Scales from GALA instrument object
p_scale = 100000
q_scale = 100000000

# Logic: Multiply and round
scaled_price = str(int(round(human_price * p_scale)))
scaled_qty = str(int(round(human_qty * q_scale)))

payload = {
    "side": "SIDE_BUY",
    "time_in_force": "TIME_IN_FORCE_DAY",
    "type": "ORDER_TYPE_LIMIT",
    "order_qty": scaled_qty,   # "100000000000"
    "price": scaled_price,     # "1226"
    "clord_id": "ORDER-GALA-001",
    "symbol": "GALA/USD"
}
Body Params

All accepted fields request body for inserting a new order.

string

The account associated with the order. This can be either the participant_code assigned by zerohash or the account_label defined by the platform.

  • Custom account label : firms/{platform_code}/accounts/{account_label}.
  • General account label : firms/{platform_code}/accounts/{participant_code}.
string
enum

Fully-qualified user. Format: firms/F-{platform_code}/users/{participant_code}. This value is case sensitive.

Clearing House Designations

  • USA: 00SXCM (ZH Clearing House)
  • EU: ZHDSEU

Prefunded Model

  • USD balances are ledgered directly to the participants on their CLOB account.
    • Participants will be credit checked against their available balance on the zerohash platform.
  • Accounts must be registed with the prefunded field as true on the POST /accounts endpoint.
  • Trade settlement is handled directly between participants and occurs instantly upon execution.

Novated Model

  • Utilizes a central float account to manage the cumulative buying power of your customers.
    • USD balance is ledgeder to the platforms float account.
    • USD credit checks must be performed by the platform prior to order placement.
  • Accounts must be registed with the prefunded field as false on the POST /accounts endpoint.
  • Allows platforms to manage the buying power of their customers effectively, allowing for better operational efficiency.
Allowed:
boolean

Indicates if the order is an all-or-none order. An all-or-none order will only execute if the entire order quantity can be filled, otherwise it will remain as instructed with regards to time in force and type of the order.

boolean

Indicates if the order should be entered at the best available price on the same side of the market.

string

The notional value of the order to execute, used with market orders.

string
string
string

Client-provided order ID.

date-time | null

The time until which the order is valid. If the order has a time in force of TIME_IN_FORCE_GOOD_TILL_TIME, then this field will indicate the time until which the order will remain active before it is cancelled by the system.

boolean

Indicates if the order should bypass price validity checks and be accepted even if the price is outside of the normal price bands or limits set by the exchange.
This may be used in conjunction with order type as ORDER_TYPE_MARKET_TO_LIMIT and the side as SIDE_SELL to bypass the exchange minimum order placement values to liquidate customer positions.

boolean

Indicates if the order should be executed immediately at the best available price.

string
string
enum

The order capacity for the order, which indicates the capacity in which the participant is acting when placing the order. This may be used by the exchange for regulatory reporting purposes.

  • ORDER_CAPACITY_UNDEFINED: An unset value for order capacity uses the default behavior of the exchange, which is typically to treat the order as if it were entered in an individual capacity.
  • ORDER_CAPACITY_AGENCY: The participant is acting in an agency capacity, meaning they are placing the order on behalf of another party.
  • ORDER_CAPACITY_PRINCIPAL: The participant is acting in a principal capacity, meaning they are placing the order for their own account and risk.
  • ORDER_CAPACITY_PROPRIETARY: The participant is acting in a proprietary capacity, meaning they are placing the order for their own account but not for their own risk (e.g., a market maker).
  • ORDER_CAPACITY_INDIVIDUAL: The participant is acting in an individual capacity, meaning they are placing the order for their own account and risk.
  • ORDER_CAPACITY_RISKLESS_PRINCIPAL: The participant is acting in a riskless principal capacity, meaning they are placing the order on behalf of another party but will not assume any market risk (e.g., they will hedge out the position immediately).
  • ORDER_CAPACITY_AGENT_FOR_OTHER_MEMBER: The participant is acting as an agent for another member of the exchange.
Allowed:
string

The quantity of the order scaled by using the fractional_quantity_scale.

boolean

Indicates if the order should participate but not initiate, meaning it will only take liquidity and not provide it.
Often referred to as post-only, an order with this flag set will not match with existing orders at the time of entry, and if it would have matched, it will be cancelled instead. Orders with this flag set may still execute against orders that are entered subsequently that would match with it.

string

The limit price for the order scaled by using the price_scale.

string
string

Client assigned Self Match Prevention ID (required to use the optional Self Match Prevention functionality).

string
enum

The self-match prevention instruction

  • SELF_MATCH_PREVENTION_INSTRUCTION_UNDEFINED:
    An unset value for the self match prevention instruction uses the default behavior of the exchange, which is to reject the incoming order and allow resting orders to remain on the book.

  • SELF_MATCH_PREVENTION_INSTRUCTION_REJECT_AGGRESSOR:
    Reject the incoming aggressor order and allow resting orders to remain on the book.

  • SELF_MATCH_PREVENTION_INSTRUCTION_CANCEL_RESTING:
    Cancel any resting orders on the book that would self match and allow the aggressor to insert on the book.

  • SELF_MATCH_PREVENTION_INSTRUCTION_REMOVE_BOTH:
    Cancel any resting orders on the book that would self match and reject the aggressor insertion on the book.

Allowed:
string

The session ID

string

The side of the order, indicating whether it is a buy or sell order.

string
boolean

Indicates if the order is a strict limit order and must be executed at the specified price.

string

The trading pair for the order.

string

The sub-type of the symbol, if applicable.

string
enum

The time in force for the order, which indicates how long the order will remain active before it is executed or expires.

  • TIME_IN_FORCE_UNDEFINED: An unset value for time in force uses the default behavior of the exchange, which is typically to treat the order as a day order that expires at the end of the trading day.
  • TIME_IN_FORCE_GOOD_TILL_CANCEL: The order will remain active until it is executed or cancelled by the participant.
  • TIME_IN_FORCE_IMMEDIATE_OR_CANCEL: The order will be executed immediately at the best available price, and any portion of the order that is not filled will be cancelled.
  • TIME_IN_FORCE_FILL_OR_KILL: The order will be executed immediately at the best available price, and if the entire order cannot be filled, it will be cancelled.
  • TIME_IN_FORCE_GOOD_TILL_TIME: The order will remain active until it is executed or until a specified time in the future, at which point it will expire if it has not been filled.
Allowed:
string
enum

The trigger method for the order, used with stop and stop-limit orders to indicate the price that will trigger the order to become active.

  • CONDITION_TRIGGER_METHOD_UNDEFINED: The default trigger method if not specified. The exchange will use its default trigger method for stop orders, which is typically the last traded price but may vary by exchange.
  • CONDITION_TRIGGER_METHOD_LAST_PRICE: The stop order will be triggered based on the last traded price of the symbol.
  • CONDITION_TRIGGER_METHOD_SETTLEMENT_PRICE: The stop order will be triggered based on the settlement price of the symbol, which is typically calculated at the end of the trading day.
Allowed:
string
enum

The type of the order, indicating whether it is a limit or market order.

Allowed:
Headers
string
required

HMAC-SHA256 signature of the request, base64-encoded. See the Authentication guide for the exact signing formula.

string
required

Current Unix timestamp in seconds. Must be within 60 seconds of server time or the request is rejected.

Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json