> For the complete documentation index, see [llms.txt](https://docs.asterdex.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.asterdex.com/trading/perpetuals/fees-and-specs/self-trade-prevention/how-to-configure-stp.md).

# How to Configure STP

### **Option 1 — Global setting:**

1. Log in and go to the **Perp** trading page
2. Click the **Settings** icon in the top-right corner

<figure><img src="https://4068247257-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWhSHuKmgnGREbVb12PK2%2Fuploads%2F12QlwtJNpvz4DOW2X72N%2F%E6%88%AA%E5%B1%8F2026-05-25%2015.06.22.png?alt=media&amp;token=b04572cb-87f9-4931-95db-b2ac5ecd7286" alt=""><figcaption></figcaption></figure>

3. Under the "Trading" section, find **Self-Trade Prevention** and click to open

<figure><img src="https://4068247257-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWhSHuKmgnGREbVb12PK2%2Fuploads%2FpZbO4y7qQ7FIwUB1BqvZ%2F%E6%88%AA%E5%B1%8F2026-05-25%2015.06.56.png?alt=media&amp;token=4256b5e1-fa0d-47b2-927e-ecebef2bed7d" alt=""><figcaption></figcaption></figure>

4. Select your preferred strategy in the pop-up and click **Confirm**

*Changes take effect immediately after saving. Portions already filled are not affected — the selected STP strategy applies only to the remaining unfilled quantity.*

<figure><img src="https://4068247257-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWhSHuKmgnGREbVb12PK2%2Fuploads%2FqEJ9KEdeJ1ZcQSYAuCfE%2F%E6%88%AA%E5%B1%8F2026-05-25%2015.07.30.png?alt=media&amp;token=c70dc9f5-577f-4098-88a8-a1a2eeec22bc" alt=""><figcaption></figcaption></figure>

### **Option 2 — API STP Strategy:**

* Add the `stpMode` parameter to the `POST /fapi/v3/order` endpoint
* API-level settings take priority over the global setting, but only apply to that specific order

### Specifying STP Strategy via API <a href="#specifying-stp-strategy-via-api" id="specifying-stp-strategy-via-api"></a>

Use the optional parameter `stpMode` in `POST /fapi/v3/order` to set a strategy for an individual order:

`stpMode: "EXPIRE_MAKER" // Cancel Maker Only stpMode: "EXPIRE_TAKER" // Cancel Taker Only stpMode: "EXPIRE_BOTH" // Cancel Both`

* If omitted, the account's global STP setting (`EXPIRE_MAKER`) is used automatically
* API-specified strategies take priority over the global setting, and apply to that order only

### Example: Cancel Maker Only in Action <a href="#example-cancel-maker-only-in-action" id="example-cancel-maker-only-in-action"></a>

A user runs two strategies simultaneously on the BTCUSDT perpetual contract, with STP set to **Cancel Maker Only**.

**Strategy A** places a limit sell order on the order book: sell 0.1 BTC at 69,000 USDT (maker)

**Strategy B** then places a market buy order: buy 0.1 BTC at market — the best available ask happens to be 69,000 USDT (Strategy A's order)

The matching engine detects that both orders belong to the same account and triggers STP:

`Maker sell order (69,000 limit) → Immediately cancelled, status: EXPIRE Taker buy order (market) → Continues execution, matches against the next ask on the book`

The taker order ultimately fills at 69,001 USDT or higher against another seller, and the strategy continues running as intended.
