Skip to main content

Order Types & Execution

This guide provides the technical specifications for BigONE's order system. It details the exact parameter combinations required for each order type to avoid 400 Bad Request errors.


1. Parameter Matrix for Spot Trading

In Spot trading (POST /viewer/orders), strict validation is applied.

Order Typesidepriceamountstop_priceoperatorNote
LIMITRequiredRequiredRequired--Standard hanging order.
MARKETRequired-Required--amount = Base Asset Quantity.
STOP_LIMITRequiredRequiredRequiredRequiredRequiredPlaces LIMIT after trigger.
STOP_MARKETRequired-RequiredRequiredRequiredPlaces MARKET after trigger.
warning
  • "-" means the field should NOT be sent. If sent, it may cause an error or be ignored (best practice: do not send).
  • MARKET Buy: Currently, BigONE Spot API typically requires amount (Base Asset) for Market Buys. If you want to "Spend 100 USDT", you must estimate the BTC amount yourself or check if quote_quantity is supported for that specific endpoint version.

2. Parameter Matrix for Contract Trading

Contract trading (POST /orders) uses a slightly different schema.

Order Typesidepricesizestop_pricereduceOnlyNote
LIMITRequiredRequiredRequired-OptionalStandard.
MARKETRequired-Required-OptionalExecuted at best price.
STOP_LIMIT-Required-Required-See Conditional Order Section below.
Contract Conditional Orders

In the Contract API, Stop/Trigger orders are often handled via a specific conditional object or distinct parameters depending on the API version.

  • Standard Orders: Use LIMIT / MARKET.
  • Stop Loss / Take Profit: These are often attached to a Position or sent with type=STOP_MARKET and reduceOnly=true.

3. Time In Force (Execution Flags)

These flags modify how a LIMIT order is processed. They are ignored for MARKET orders.

POST_ONLY

  • Payload: "post_only": true
  • Logic:
    • If Order Price < Best Ask (for Buy): Order is Accepted (Maker).
    • If Order Price >= Best Ask (for Buy): Order is Rejected or Cancelled.
  • Error Code: 50047 (Liquidity taken too much) or similar cancellation state.

IOC (Immediate or Cancel)

  • Payload: "immediate_or_cancel": true
  • Logic:
    • Matches available liquidity immediately.
    • Unfilled portion is Cancelled (not added to book).
    • Response: You will receive an Order ID, but its state will likely be FILLED or CANCELLED instantly.

4. Detailed Behavior Scenarios

Scenario A: The "Fat Finger" Protection

You want to buy BTC. Current Price is $50,000. You accidentally send a LIMIT BUY at $55,000.

  1. Standard LIMIT: The system matches you against the best sells ($50,000, $50,001...) up to $55,000.
    • Result: You buy immediately at market price, paying Taker fees.
  2. With post_only: true: The system sees your price ($55,000) crosses the best ask ($50,000).
    • Result: Order is Rejected. You are saved from paying Taker fees or buying at a bad spread.

Scenario B: Stop Loss Logic

You hold a Long BTC Position. Current Price $50,000. You want to stop loss at $49,000.

  1. STOP_MARKET:
    • stop_price: 49000
    • operator: LTE (Less Than or Equal)
    • Behavior: When Mark Price hits 49,000, a MARKET SELL is triggered.
    • Risk: If price crashes to 48,000 instantly, you sell at 48,000.
  2. STOP_LIMIT:
    • stop_price: 49000
    • price: 48900 (Limit Price)
    • Behavior: When Mark Price hits 49,000, a LIMIT SELL at 48,900 is placed.
    • Risk: If price crashes straight to 48,000, your Limit (48,900) might not fill, leaving you holding the bag.

5. Validation Error Codes

If you mess up the parameters, expect these errors:

  • 10007 (Parameter Error):
    • Sending price for a MARKET order (in some strict validators).
    • Missing operator for a Stop order.
    • Sending amount with too many decimal places (violating asset_pair scale).
  • 50047 (Liquidity Issue):
    • post_only order would have matched immediately.

Conclusion

  • Spot: Be strict. price and amount are Strings. Check the matrix.
  • Contract: Be careful with reduceOnly. Use it for closing positions.
  • Algo Trading: Always use post_only if your strategy relies on Maker rebates.