# Strategy Server Overview

The **Strategy Server** is the runtime that hosts user-developed trading
strategies. It loads the strategy JARs, manages the lifecycle of every
**strategy instance**, distributes market data and order events to those
instances, and enforces risk limits before any order leaves the process.

## Responsibilities

### Strategy execution

- **Instance management.** Create, start, stop, and delete strategy
  instances.
- **Multi-threading.** Distribute strategy instances across CPU cores
  for load balancing.

### Market data distribution

- **MDA connections.** Maintain connections to **Market Data Adapters**
  for every required instrument.
- **Subscription management.** Subscribe to instruments on behalf of
  the strategies.
- **Event distribution.** Route market-data events to the right strategy
  instance.

### Order entry coordination

- **TA connections.** Connect to **Trading Adapters** for every required
  account.
- **Order routing.** Route order requests from strategies to the right
  adapter.
- **Response handling.** Deliver order responses and events back to the
  originating strategy.

### Risk management

Risk limits are configured per account and per trading instrument. The
configurable limits cover order count, position size, counter-position
size (for spot), and minimum order size, expressed in native units, USD,
or both.

**Order-count limits**

- `maxOrderCount`: maximum open orders per side (bid/ask).

**Position limits**

- `maxPosition`: maximum position per side, in native units.
- `maxUsdPosition`: maximum position per side, in USD.
- `maxNetPosition` / `maxUsdNetPosition`: maximum net position for
  instruments with isolated positions.

**Counter-position limits** (spot)

- `maxCounterPosition` / `maxUsdCounterPosition`: maximum quote-currency
  exposure, in native units or USD.

**Order-size limits**

- `minOrderSize`: minimum size of an outgoing order.

### Theoretical profit and loss

The Strategy Server calculates a **Theoretical Profit and Loss** (TPL)
for every trade of every running strategy.

## See also

- [Strategy Server API](strategy-server-api). REST and WebSocket APIs.
- [SDK Overview](../strategy-development/sdk-setup.md). Developing
  strategies.
- [System Architecture](../getting-started/system.md). Overall system
  design.
