# Order Types

**Basic Order Types**

* Market Order: Executes immediately at the current market price.
* Limit Order: Executes at a specified price or better.
* Stop Market Order: Becomes a market order once the asset reaches the chosen stop price. Commonly used to limit losses or secure profits.
* Stop Limit Order: Becomes a limit order once the stop price is hit.
* Scale Order: Places a series of limit orders across a defined price range.
* TWAP (Time-Weighted Average Price): Splits a large order into smaller chunks, executed every 30 seconds to minimize market impact. Each suborder is limited to a maximum slippage of 3%.

***

**TWAP Mechanics**

* The TWAP algorithm targets execution based on elapsed time relative to total order duration.
* A new suborder is placed every 30 seconds.
* If early suborders don’t fill due to low liquidity or wide spreads, later suborders will increase in size (up to 3x the standard size) to catch up — while still respecting the 3% slippage cap.
* Like regular market orders, TWAP suborders won’t execute during post-only periods (e.g. during network upgrades).

***

**Additional Order Options**

* Reduce Only: Ensures the order only reduces an existing position, never increases or flips it.
* Good Til Canceled (GTC): Stays active on the order book until filled or manually canceled.
* Post Only (ALO): Adds the order to the book without matching immediately — ensures maker-only execution.
* Immediate or Cancel (IOC): Executes all or part of the order immediately; cancels any unfilled portion.
* Take Profit (TP): Triggers a market order when the target price is reached, helping lock in gains.
* Stop Loss (SL): Triggers a market order when the price hits a specified loss threshold, limiting downside.

> TP and SL orders are typically used to automate trade exits. You can customize the trigger price, limit price, and the portion of your position to be affected.

### What is TWAP? <a href="#what-is-twap" id="what-is-twap"></a>

TWAP (Time-Weighted Average Price) is an order execution strategy that breaks a large order into smaller trades, executed at regular intervals over a set duration.

Instead of placing one large order that may impact price, TWAP helps smooth execution, reducing slippage and market impact.

***

#### How TWAP Works <a href="#how-twap-works" id="how-twap-works"></a>

1. Order Size – The user specifies the total amount to buy/sell.
2. Duration – The time over which the order will be executed.
3. Intervals – The order is split into smaller chunks, executed evenly at each interval.
4. Execution – Orders are placed automatically until the total size is filled.

For example: Buying 100 ETH over 1 hour with 12 intervals means the system executes \~8.33 ETH every 5 minutes.

***

### Reduce-Only Mode <a href="#reduce-only-mode" id="reduce-only-mode"></a>

When Reduce-Only is enabled:

* The TWAP will only reduce your current position.
* It prevents the strategy from flipping your position (e.g., closing a long and accidentally opening a short).
* If no position exists, no orders are executed.

This ensures TWAP is used strictly for scaling out, not scaling in.

***

### Randomize Mode <a href="#randomize-mode" id="randomize-mode"></a>

When Randomize is enabled:

* The system slightly varies the size and/or timing of each order.
* This makes execution less predictable and harder to track.
* Helps mitigate predatory algorithms or bots attempting to anticipate TWAP orders.

Example: Instead of executing exactly 10 ETH every 5 minutes, the bot may execute 8.5 ETH, then 11.2 ETH, with timing offsets of a few seconds.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nikafinance.gitbook.io/docs/trade-and-earn/trade-perps/order-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
