Skip to main content

Overview

When placing orders, specify how the system should handle potential self-trades using the stp parameter. This parameter determines the behavior when an order would match against another order from the same account.

STP Modes

The following STP modes are available:

Usage

Specify the STP mode when placing any type of order:

Example

Supported Endpoints

STP is supported on the following API endpoints:

Best Practices

  1. Default Behavior: If no STP mode is specified, the system defaults to no, allowing self-trades.
  2. Risk Management: For automated trading systems or when running multiple strategies, it’s recommended to use cancel_both or cancel_new to prevent unintentional self-trades.
  3. Market Making: When running market making strategies, consider using cancel_new to maintain existing orders’ queue position.

Response Handling

When an order is affected by STP rules, the order response includes the stp field indicating the applied mode. The order status will reflect the outcome based on the STP mode:
  • Orders canceled due to STP will have a “CANCELED” status
  • Successfully placed orders will proceed with normal status progression