API Reference

Order Debug

Method Name

private/order_debug

Debug a new order
Required minimum session key permission level is read_only

Parameters

amount string required
Order amount in units of the base
direction string required
Order direction
enum buy sell
instrument_name string required
Instrument name
limit_price string required
Limit price in quote currency.
This field is still required for market orders because it is a component of the signature. However, market orders will not leave a resting order in the book in case of a partial fill.
max_fee string required
Max fee per unit of volume, denominated in units of the quote currency (usually USDC).Order will be rejected if the supplied max fee is below the estimated fee for this order.
nonce integer required
Unique nonce defined as (e.g. 1695836058725001, where 001 is the random number).Note, using a random number beyond 3 digits will cause JSON serialization to fail.
signature string required
Ethereum signature of the order
signature_expiry_sec integer required
Unix timestamp in seconds. Order signature becomes invalid after this time, and the system will cancel the order.Expiry MUST be at least 5 min from now.
signer string required
Owner wallet address or registered session key that signed order
subaccount_id integer required
Subaccount ID
label string
Optional user-defined label for the order
mmp boolean
Whether the order is tagged for market maker protections (default false)
order_type string
Order type:
- limit: limit order (default)
- market: market order, note that limit_price is still required for market orders, but unfilled order portion will be marked as cancelled
enum limit market
reduce_only boolean
If true, the order will not be able to increase position's size (default false). If the order amount exceeds available position size, the order will be filled up to the position size and the remainder will be cancelled. This flag is only supported for market orders or non-resting limit orders (IOC or FOK)
referral_code string
Optional referral code for the order
reject_timestamp integer
UTC timestamp in ms, if provided the matching engine will reject the order with an error if reject_timestamp < server_time. Note that the timestamp must be consistent with the server time: use public/get_time method to obtain current server time.
time_in_force string
Time in force behaviour:
- gtc: good til cancelled (default)
- post_only: a limit order that will be rejected if it crosses any order in the book, i.e. acts as a taker order
- fok: fill or kill, will be rejected if it is not fully filled
- ioc: immediate or cancel, fill at best bid/ask (market) or at limit price (limit), the unfilled portion is cancelled
Note that the order will still expire on the signature_expiry_sec timestamp.
enum gtc post_only fok ioc
trigger_price string
(Required for trigger orders) Index or Market price to trigger order at
trigger_price_type string
(Required for trigger orders) Trigger with Mark Price. Index price type no supported yet.
enum mark index
trigger_type string
(Required for trigger orders) Stop-loss or Take-profit
enum stoploss takeprofit

Response

id string or integer required
result object required
result.action_hash string required
Keccak hashed action data
result.encoded_data string required
ABI encoded order data
result.encoded_data_hashed string required
Keccak hashed encoded_data
result.typed_data_hash string required
EIP 712 typed data hash
result.raw_data object required
Raw order data
result.raw_data.expiry integer required
result.raw_data.module string required
result.raw_data.nonce integer required
result.raw_data.owner string required
result.raw_data.signature string required
result.raw_data.signer string required
result.raw_data.subaccount_id integer required
result.raw_data.data object required
result.raw_data.data.asset string required
result.raw_data.data.desired_amount string required
result.raw_data.data.is_bid boolean required
result.raw_data.data.limit_price string required
result.raw_data.data.recipient_id integer required
result.raw_data.data.sub_id integer required
result.raw_data.data.trade_id string required
result.raw_data.data.worst_fee string required

Example

{request_example_shell}
{request_example_javascript}
{request_example_python}

The above command returns JSON structured like this:

{response_example_json}