Skip to content

Commit 8dde89d

Browse files
authored
Merge pull request #165 from JJ-Cro/update19152025
feat: enhance OrderRequest interface with additional fields for options trading and advanced TP/SL configurations
2 parents d43598b + e8487e2 commit 8dde89d

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

src/types/rest/request/trade.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,17 +188,54 @@ export interface OrderRequest {
188188
/** Quantity to buy or sell */
189189
sz: numberInString;
190190
px?: string;
191+
/** Place options orders in USD. Only applicable to options. One of px/pxUsd/pxVol must be filled for option orders */
192+
pxUsd?: string;
193+
/** Place options orders based on implied volatility, where 1 represents 100%. Only applicable to options */
194+
pxVol?: string;
191195
reduceOnly?: boolean;
192196
/** A spot buy on BTC-USDT with "base_ccy" would mean the QTY (sz) is in USDT */
193197
tgtCcy?: 'base_ccy' | 'quote_ccy';
194198
banAmend?: boolean;
199+
/** Price amendment type: "0" = do not allow amendment, "1" = allow amendment within price limit. Default is "0" */
200+
pxAmendType?: '0' | '1';
201+
/** Quote currency used for trading. Only applicable to SPOT. Default is quote currency of instId */
202+
tradeQuoteCcy?: string;
203+
/** Self trade prevention mode: cancel_maker, cancel_taker, cancel_both. Default is cancel_maker */
204+
stpMode?: 'cancel_maker' | 'cancel_taker' | 'cancel_both';
195205
/** Take Profit & Stop Loss params */
196206
tpTriggerPx?: string;
197207
tpOrdPx?: string;
198208
slTriggerPx?: string;
199209
slOrdPx?: string;
200210
tpTriggerPxType?: PriceTriggerType;
201211
slTriggerPxType?: PriceTriggerType;
212+
/** TP/SL information attached when placing order (supports split TPs and advanced TP/SL configurations) */
213+
attachAlgoOrds?: {
214+
/** Client-supplied Algo ID when placing order attaching TP/SL */
215+
attachAlgoClOrdId?: string;
216+
/** Take-profit trigger price */
217+
tpTriggerPx?: string;
218+
/** Take profit trigger ratio, 0.3 represents 30%. Only one of tpTriggerPx and tpTriggerRatio can be passed */
219+
tpTriggerRatio?: string;
220+
/** Take-profit order price. -1 means market price */
221+
tpOrdPx?: string;
222+
/** TP order kind: "condition" or "limit". Default is "condition" */
223+
tpOrdKind?: 'condition' | 'limit';
224+
/** Stop-loss trigger price */
225+
slTriggerPx?: string;
226+
/** Stop loss trigger ratio, 0.3 represents 30%. Only one of slTriggerPx and slTriggerRatio can be passed */
227+
slTriggerRatio?: string;
228+
/** Stop-loss order price. -1 means market price */
229+
slOrdPx?: string;
230+
/** Take-profit trigger price type: last, index, or mark. Default is last */
231+
tpTriggerPxType?: 'last' | 'index' | 'mark';
232+
/** Stop-loss trigger price type: last, index, or mark. Default is last */
233+
slTriggerPxType?: 'last' | 'index' | 'mark';
234+
/** Size. Only applicable to TP order of split TPs, and it is required for TP order of split TPs */
235+
sz?: string;
236+
/** Whether to enable Cost-price SL. "0" = disable (default), "1" = Enable. Only applicable to SL order of split TPs */
237+
amendPxOnTriggerType?: '0' | '1';
238+
}[];
202239
/** Quick margin type */
203240
quickMgnType?: 'manual' | 'auto_borrow' | 'auto_repay';
204241
}

0 commit comments

Comments
 (0)