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 Type | side | price | amount | stop_price | operator | Note |
|---|---|---|---|---|---|---|
| LIMIT | Required | Required | Required | - | - | Standard hanging order. |
| MARKET | Required | - | Required | - | - | amount = Base Asset Quantity. |
| STOP_LIMIT | Required | Required | Required | Required | Required | Places LIMIT after trigger. |
| STOP_MARKET | Required | - | Required | Required | Required | Places MARKET after trigger. |
- "-" 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 ifquote_quantityis supported for that specific endpoint version.
2. Parameter Matrix for Contract Trading
Contract trading (POST /orders) uses a slightly different schema.
| Order Type | side | price | size | stop_price | reduceOnly | Note |
|---|---|---|---|---|---|---|
| LIMIT | Required | Required | Required | - | Optional | Standard. |
| MARKET | Required | - | Required | - | Optional | Executed at best price. |
| STOP_LIMIT | - | Required | - | Required | - | See Conditional Order Section below. |
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_MARKETandreduceOnly=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.
- If
- 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
FILLEDorCANCELLEDinstantly.
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.
- 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.
- 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.
- STOP_MARKET:
stop_price: 49000operator: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.
- STOP_LIMIT:
stop_price: 49000price: 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
pricefor aMARKETorder (in some strict validators). - Missing
operatorfor a Stop order. - Sending
amountwith too many decimal places (violatingasset_pairscale).
- Sending
- 50047 (Liquidity Issue):
post_onlyorder would have matched immediately.
Conclusion
- Spot: Be strict.
priceandamountare Strings. Check the matrix. - Contract: Be careful with
reduceOnly. Use it for closing positions. - Algo Trading: Always use
post_onlyif your strategy relies on Maker rebates.