Futures

Introduction to Self Trade Prevention (STP)

2024-07-15 09:000437

What is Self Trade Prevention (STP)?

Self Trade Prevention (STP) is a mechanism employed by trading platforms to prevent users from inadvertently trading with themselves, thereby reducing unnecessary transaction fees. STP is particularly important in maintaining a fair and transparent trading environment, as it helps to prevent manipulation of market prices and ensures that trading activity accurately reflects genuine market interest, creating a compliant and fair trading platform.

STP mechanism: A mechanism that blocks the matching of orders with the same user ID or any sub-accounts under it. This includes orders within the account, orders between the main account and sub-accounts, and orders between sub-accounts.

What happens when STP is triggered?

When an order could create a self-trade, the system can respond in one of four modes:

none: This mode exempts the order from self-trade prevention. User IDs are not compared, no orders are revoked, and the trade occurs.

cancel_taker: When executed, this mode cancels the taker order but the maker order remains.

cancel_maker: When executed, this mode cancels the maker order but the taker order remains.

cancel_both mode: When executed, this mode cancels both taker and maker orders.

STP will occur depending on the STP mode of the taker order. Thus, the STP mode of an order that goes on the order book is no longer relevant and will be ignored for all future order processing.

How to set STP mode for an order?

For order placing API and batch order placing API, the STP mode can be set using the field "stpMode".

For spot trade orders

For futures trade orders

For margin trade orders

Which product lines support STP?

Spot

Futures

USDT-M Futures

USDC-M Futures

Coin-M Futures (Perpetual Delivery)

Margin

Isolated margin

Cross margin

Which order types support STP?

When Time In Force is set to GTC/IOC, the following order types support STP:

Limit order

Market order

Trigger order

TP/SL order

Note that STP is invalid when Time In Force is set to FOK.

Do modify orders support STP?

No. Modify orders do not support STP. Modify orders inherit the STP settings of the original order.

Join Bitget, the World's Leading Crypto Exchange and Web 3 Company