What is Self-Trade Prevention?
Self-trading refers to the act of a user conducting trades with themselves or a designated entity. This behavior can significantly impact the normal price trends and depth fluctuations in the market. To ensure the accuracy of market data, prevent price manipulation, and maintain fair trading, the implementation of STP functionality is proposed across the entire market.
Markets Affected
Self-trading Prevention (STP) will be applied to all linear and inverse contracts, margin trading, and spot trading on the entire CoinEx platform. To ensure accurate opening price estimates, STP mode will not be effective during the spot market auction matching. This applies to orders placed with STP mode during the order placement and cancellation period of the auction.
Scope of Self-Trade Prohibition
Self-trading is prohibited within the same account. For instance, if the main account A has sub-accounts A1 and A2, trading between the following accounts will be prohibited:
- A and A
- A1 and A1
- A2 and A2
STP Modes
When placing orders via API, the STP mode can be set. Regardless of whether the order type is Taker or Maker, STP will be effective. However, when the strategy is activated, the Taker order’s STP mode will prevail.
- CT: Immediately cancel the remaining Taker orders
- CM: Immediately cancel the remaining Maker orders
- BOTH: Immediately cancel the remaining Taker and Maker orders
Impact of Order Effective Time on STP
- When an order is set to FOK, STP does not execute.
- When an order is set to IOC or Maker Only, it must meet both IOC/MO and STP conditions.
How to Set STP Mode for Orders
STP can be set via the "stp_mode" field at the following API endpoints:
- api/v2/spot/order/http/put-order
- api/v2/futures/order/http/put-order
- api/v2/futures/position/http/close-position