> ## Documentation Index
> Fetch the complete documentation index at: https://docs.strike.markets/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Short Position

> Open a short position with specified margin and leverage

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.strike.markets/short" \
    -H "X-API-Key: stk_your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "margin": "100.0",
      "leverage": 10,
      "symbol": "BTC-USD"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.strike.markets/short', {
    method: 'POST',
    headers: {
      'X-API-Key': 'stk_your_api_key_here',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      margin: "100.0",
      leverage: 10,
      symbol: "BTC-USD"
    })
  });

  const data = await response.json();
  console.log('Short position created:', data);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.strike.markets/short',
      headers={
          'X-API-Key': 'stk_your_api_key_here',
          'Content-Type': 'application/json'
      },
      json={
          'margin': '100.0',
          'leverage': 10,
          'symbol': 'BTC-USD'
      }
  )

  data = response.json()
  print('Short position created:', data)
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "message": "Short position created successfully",
    "txHash": "0x1234567890abcdef1234567890abcdef12345679",
    "gasUsed": 180000,
    "positionId": 12346,
    "symbol": "BTC-USD",
    "szi": "-0.002217",
    "margin": "100.0",
    "entryPrice": "45123.50",
    "liquidationPrice": "49012.85",
    "status": "open",
    "createdAt": "2024-01-15T14:30:00Z",
    "spread": "5.25"
  }
  ```
</ResponseExample>

## Overview

Create a short position on Strike Protocol with specified margin and leverage. A short position profits when the asset price decreases.

<Warning>
  This endpoint requires authentication with a valid API key.
</Warning>

## Authentication

Include your API key in the X-API-Key header:

```
X-API-Key: stk_your_api_key_here
```

## Request Body

<ParamField body="margin" type="string" required>
  Margin amount in USD. Must be a positive number as a string.

  **Minimum**: 1 USD equivalent\
  **Example**: "100.0"
</ParamField>

<ParamField body="leverage" type="integer" required>
  Leverage multiplier for the position.

  **Range**: 1 to 1000\
  **Example**: 10
</ParamField>

<ParamField body="symbol" type="string" required>
  Trading pair symbol.

  **Supported values**: "BTC-USD", "ETH-USD", "SOL-USD"\
  **Example**: "BTC-USD"
</ParamField>

## Response Fields

<ResponseField name="success" type="boolean">
  Indicates if the position was created successfully
</ResponseField>

<ResponseField name="positionId" type="integer">
  Unique identifier for the created position
</ResponseField>

<ResponseField name="txHash" type="string">
  Blockchain transaction hash for the position creation
</ResponseField>

<ResponseField name="margin" type="string">
  Margin amount used for the position
</ResponseField>

<ResponseField name="leverage" type="integer">
  Leverage multiplier applied
</ResponseField>

<ResponseField name="size" type="string">
  Total position size (margin × leverage)
</ResponseField>

<ResponseField name="entryPrice" type="string">
  Price at which the position was opened
</ResponseField>

<ResponseField name="liquidationPrice" type="string">
  Price at which the position will be liquidated
</ResponseField>

## Error Responses

<ResponseField name="400 Bad Request" type="object">
  Invalid request parameters or insufficient balance

  ```json theme={null}
  {
    "error": 400,
    "message": "Insufficient balance for margin requirement"
  }
  ```
</ResponseField>

<ResponseField name="401 Unauthorized" type="object">
  Missing or invalid authentication token

  ```json theme={null}
  {
    "error": 401,
    "message": "Authorization header missing"
  }
  ```
</ResponseField>

<ResponseField name="429 Too Many Requests" type="object">
  Rate limit exceeded (10 requests per minute for trading endpoints)

  ```json theme={null}
  {
    "error": "RATE_LIMIT_EXCEEDED",
    "message": "Rate limit exceeded. Please wait 45 seconds.",
    "retry_after": 45
  }
  ```
</ResponseField>

## Next Steps

After creating a short position:

1. **Monitor Position** - Use [Get Positions](/api-reference/positions/get-positions) to track your position
2. **Check Dashboard** - View comprehensive data with [Dashboard](/api-reference/account/dashboard)
3. **Close Position** - Manually close with [Close Position](/api-reference/trading/close)
4. **Emergency Exit** - Use [Emergency Exit](/api-reference/trading/emergency-exit) if needed

<Warning>
  Short positions carry unlimited loss potential and require careful risk management. Monitor positions closely and consider using stop losses.
</Warning>

<Tip>
  Short positions are suitable when you expect the asset price to decrease. Consider using lower leverage for short positions due to their higher risk profile.
</Tip>


## OpenAPI

````yaml POST /short
openapi: 3.1.0
info:
  title: Strike Protocol API
  description: >-
    Strike Protocol is a perpetual futures trading platform that allows users to
    trade with leverage (1-1000x) on various crypto assets. This API provides
    access to trading operations, account management, market data, analytics,
    and user systems.
  version: 1.0.0
  contact:
    name: Strike Protocol
    url: https://strike.markets
  license:
    name: MIT
servers:
  - url: https://api.strike.markets
    description: Production server
security:
  - apiKeyAuth: []
paths:
  /short:
    post:
      summary: Create Short Position
      description: Open a short position with specified margin and leverage
      operationId: createShortPosition
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShortPositionRequest'
      responses:
        '200':
          description: Position created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradeResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid or missing authentication token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ShortPositionRequest:
      type: object
      required:
        - margin
        - leverage
        - symbol
      properties:
        margin:
          type: string
          description: Margin amount in USD
        leverage:
          type: integer
          minimum: 1
          maximum: 1000
          description: Leverage multiplier (1-1000)
        symbol:
          type: string
          description: Market symbol (e.g., BTC-USD)
    TradeResponse:
      type: object
      properties:
        success:
          type: boolean
        positionId:
          type: integer
        txHash:
          type: string
        margin:
          type: string
        leverage:
          type: integer
        size:
          type: string
        entryPrice:
          type: string
        liquidationPrice:
          type: string
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Strike Protocol API key authentication

````