Summary
create_order_object in order_object.py raises NotImplementedError("TPSL 'MARKET' price type is not supported yet") when OrderPriceType.MARKET is used for TP/SL triggers. However, the API documentation explicitly lists MARKET as a supported value for the priceType field on both takeProfit and stopLoss triggers.
Location
x10/perpetual/order_object.py, inside the nested create_tpsl_trigger_model function within __create_order_object:
if trigger_param.price_type == OrderPriceType.MARKET:
raise NotImplementedError("TPSL `MARKET` price type is not supported yet")
This guard is present in all versions up to and including 1.3.0.
Why this matters
Stop-loss orders placed as LIMIT may not fill during fast price moves / gaps. Market-type SL execution is critical for risk management — the API supports it, but the SDK prevents users from using it.
Expected behavior
OrderPriceType.MARKET should be accepted and serialized as "priceType": "MARKET" in the API payload, the same way LIMIT is handled. The rest of the SDK (serialization, settlement signing) already handles MARKET correctly — only this guard needs to be removed.
Suggested fix
Remove the two-line guard:
- if trigger_param.price_type == OrderPriceType.MARKET:
- raise NotImplementedError("TPSL `MARKET` price type is not supported yet")
Summary
create_order_objectinorder_object.pyraisesNotImplementedError("TPSL 'MARKET' price type is not supported yet")whenOrderPriceType.MARKETis used for TP/SL triggers. However, the API documentation explicitly listsMARKETas a supported value for thepriceTypefield on bothtakeProfitandstopLosstriggers.Location
x10/perpetual/order_object.py, inside the nestedcreate_tpsl_trigger_modelfunction within__create_order_object:This guard is present in all versions up to and including
1.3.0.Why this matters
Stop-loss orders placed as
LIMITmay not fill during fast price moves / gaps. Market-type SL execution is critical for risk management — the API supports it, but the SDK prevents users from using it.Expected behavior
OrderPriceType.MARKETshould be accepted and serialized as"priceType": "MARKET"in the API payload, the same wayLIMITis handled. The rest of the SDK (serialization, settlement signing) already handlesMARKETcorrectly — only this guard needs to be removed.Suggested fix
Remove the two-line guard: