Introduction to Self-Trade Prevention (STP)

1. What is self-trade prevention (STP)?


Self-Trade Prevention (STP) is a trading mechanism designed to prevent buy and sell orders from the same user (or different accounts belonging to the same entity) from unintentionally matching with each other in the trading system. The STP mechanism is especially important for maintaining a fair and transparent trading environment, helping to prevent market price manipulation and ensuring that trading activity accurately reflects genuine market interest.

MEXC's Self-Trade Prevention (STP) mechanism is used to prevent orders from the same user or users within the same "tradeGroupId" from matching with each other.

2. What is self-trading?


Possible situations where self-trading can occur:
1) Trades between orders from the same account.
2) Trades between different sub-accounts under the same main account.

3. What happens when STP is triggered?


When an order triggers the self-trade prevention mechanism, the system may apply one of the following four modes:

1) NONE Mode: The order is not affected by the STP mechanism. The system does not check the account or tradeGroupId, and the trade executes normally.

2) CANCEL_TAKER Mode: The remaining quantity of the taker order is immediately canceled to prevent the trade from executing.

3) CANCEL_MAKER Mode: The remaining quantity of the maker order is immediately canceled to prevent the trade from executing.

4) CANCEL_BOTH Mode: The remaining quantities of both the taker and maker orders are simultaneously canceled to prevent the trade from executing.

4. How to set the STP Mode for an order


STP mode can be set using the stpMode parameter in the following API calls:
  • POST /api/v3/order
  • POST /api/v3/batchOrders

5. What is "tradeGroupId"?


Accounts sharing the same tradeGroupId are treated as belonging to the same trading group. Orders submitted by members of the same trading group may trigger STP depending on the taker order's STP mode.

6. Which trading pairs support STP?


All trading pairs.

7. Which order types Support STP?


Only the following order types support STP:
  • LIMIT orders
  • MARKET orders
  • LIMIT_MAKER (post-only) orders
  • IMMEDIATE_OR_CANCEL (IOC) orders
Note: STP is not effective when the type is set to FOK (Fill-Or-Kill).

Coin Icon
现在注册即可获得 10,000 USDT 新人奖励

订阅 MEXC 精选

市场动态、新币上线、行业洞察,每周为您精选送达
订阅即表示您同意接收 MEXC 周报和邮件通讯,并同意我们的《隐私政策》。内容仅供参考,不构成任何投资建议。

加入 MEXC 公告电报群

最新上币、热门活动、重大更新——全部在官方 Telegram 实时推送。

Introduction to Self-Trade Prevention (STP)

1. What is self-trade prevention (STP)?


Self-Trade Prevention (STP) is a trading mechanism designed to prevent buy and sell orders from the same user (or different accounts belonging to the same entity) from unintentionally matching with each other in the trading system. The STP mechanism is especially important for maintaining a fair and transparent trading environment, helping to prevent market price manipulation and ensuring that trading activity accurately reflects genuine market interest.

MEXC's Self-Trade Prevention (STP) mechanism is used to prevent orders from the same user or users within the same "tradeGroupId" from matching with each other.

2. What is self-trading?


Possible situations where self-trading can occur:
1) Trades between orders from the same account.
2) Trades between different sub-accounts under the same main account.

3. What happens when STP is triggered?


When an order triggers the self-trade prevention mechanism, the system may apply one of the following four modes:

1) NONE Mode: The order is not affected by the STP mechanism. The system does not check the account or tradeGroupId, and the trade executes normally.

2) CANCEL_TAKER Mode: The remaining quantity of the taker order is immediately canceled to prevent the trade from executing.

3) CANCEL_MAKER Mode: The remaining quantity of the maker order is immediately canceled to prevent the trade from executing.

4) CANCEL_BOTH Mode: The remaining quantities of both the taker and maker orders are simultaneously canceled to prevent the trade from executing.

4. How to set the STP Mode for an order


STP mode can be set using the stpMode parameter in the following API calls:
  • POST /api/v3/order
  • POST /api/v3/batchOrders

5. What is "tradeGroupId"?


Accounts sharing the same tradeGroupId are treated as belonging to the same trading group. Orders submitted by members of the same trading group may trigger STP depending on the taker order's STP mode.

6. Which trading pairs support STP?


All trading pairs.

7. Which order types Support STP?


Only the following order types support STP:
  • LIMIT orders
  • MARKET orders
  • LIMIT_MAKER (post-only) orders
  • IMMEDIATE_OR_CANCEL (IOC) orders
Note: STP is not effective when the type is set to FOK (Fill-Or-Kill).

Coin Icon
现在注册即可获得 10,000 USDT 新人奖励

订阅 MEXC 精选

市场动态、新币上线、行业洞察,每周为您精选送达
订阅即表示您同意接收 MEXC 周报和邮件通讯,并同意我们的《隐私政策》。内容仅供参考,不构成任何投资建议。

加入 MEXC 公告电报群

最新上币、热门活动、重大更新——全部在官方 Telegram 实时推送。
及时获取 MEXC 最新上币、下币、交易活动与产品更新。探索新代币、Launchpad 项目、Earn 理财机会、AI 工具,以及合约交易优化等更多平台动态。及时获取 MEXC 最新上币、下币、交易活动与产品更新。探索新代币、Launchpad 项目、Earn 理财机会、AI 工具,以及合约交易优化等更多平台动态。