Introduction to Self-Trade Prevention (STP)

What is Self-Trade Prevention (STP)

Self-Trade Prevention is a measure designed to restrict transactions between a user and either themselves or designated entities. Its purpose is to prevent self-trading within the same account or associated accounts, thus ensuring the smooth operation of the market and maintaining price stability.

 

Activation Rules

1. Self-Trade Prevention applies to all transaction types on CoinEx, including but not limited to USDⓈ-margined contracts, coin-margined contracts, margin trading, and spot trading.

2. To ensure accurate estimation of the opening price, 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.

3. Self-trading is prohibited within the same account. For example, if 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

 

Self-Trade Prevention Modes

You can set different STP modes when placing orders via API. STP modes take effect regardless of whether the order type is a Taker or Maker order. However, when the strategy is activated, the Taker order’s STP mode will prevail. 

Available modes include:

  • CT Mode: Immediately cancel remaining Taker orders
  • CM Mode: Immediately cancel remaining Maker orders (the remaining Taker orders remain unaffected; if those Taker orders are also limit orders, they remain pending as limit orders)
  • BOTH Mode: Immediately cancel both remaining Taker and Maker orders

 

Effective Time Restrictions

The effective time of STP depends on order types:

1. FOK (Fill or Kill): When an order is set to FOK, STP will not be activated;

2. IOC (Immediate or Cancel) or Maker Only: When an order is set to IOC or Maker Only, both IOC/MO conditions and STP conditions must be met.

 

How to Set STP Mode for Orders

STP mode can be set via the “stp_mode” field in APIs for order placement, batch order, and position closing.

  • Spot trading: api/v2/spot/order/http/put-order
  • Futures trading: api/v2/futures/order/http/put-order
  • Position closing: api/v2/futures/position/http/close-position

 

✏️ Explore More: CoinEx API Documentation >>

Disclaimer: The content provided on this website is for informational purposes only and does not constitute investment advice. The information provided is not intended to be a substitute for professional financial advice, consultation, or recommendations. Users are encouraged to consult with a qualified financial advisor before making any investment decisions. The website owners and authors do not assume any liability for any loss or damage that may result from reliance on the information provided. All investments carry risk, and past performance is not indicative of future results.