> ## 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.

# Get Positions

> Get all positions for a specific wallet address

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.strike.markets/positions/0x742d35cc6C6C7532B1140Da4C8A2f6C8ECfC9B46"
  ```

  ```javascript JavaScript theme={null}
  const walletAddress = "0x742d35cc6C6C7532B1140Da4C8A2f6C8ECfC9B46";

  const response = await fetch(`https://api.strike.markets/positions/${walletAddress}`);
  const positions = await response.json();

  console.log('User positions:', positions);
  ```

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

  wallet_address = "0x742d35cc6C6C7532B1140Da4C8A2f6C8ECfC9B46"

  response = requests.get(f'https://api.strike.markets/positions/{wallet_address}')
  positions = response.json()

  print('User positions:', positions)
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "open": [
      {
        "id": 12345,
        "walletAddress": "0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46",
        "symbol": "BTC-USD",
        "szi": "0.006667",
        "margin": "300.0",
        "entryPrice": "45000.00",
        "liquidationPrice": "41234.15",
        "exitPrice": null,
        "realizedPnl": "0.00",
        "pnlFee": "0.00",
        "status": "open",
        "createdAt": "2024-01-15T14:30:00Z",
        "closedAt": null,
        "settledAt": null,
        "accumulatedFunding": "2.50",
        "spread": "5.25"
      }
    ],
    "closed": [
      {
        "id": 12340,
        "walletAddress": "0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46",
        "symbol": "BTC-USD",
        "szi": "0.018182",
        "margin": "100.0",
        "entryPrice": "44000.00",
        "liquidationPrice": "40150.00",
        "exitPrice": "45500.00",
        "realizedPnl": "127.85",
        "pnlFee": "8.75",
        "status": "closed",
        "createdAt": "2024-01-10T09:00:00Z",
        "closedAt": "2024-01-12T15:30:00Z",
        "settledAt": null,
        "accumulatedFunding": "3.50",
        "spread": "4.75"
      }
    ],
    "settled": [
      {
        "id": 12330,
        "symbol": "SOL-USD",
        "wallet_address": "0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46",
        "szi": "0.078947",
        "margin": "75.0",
        "entry_price": "95.00",
        "liquidation_price": "90.25",
        "exit_price": "90.25",
        "realized_pnl": "-75.00",
        "total_fee": "0.00",
        "status": "settled",
        "created_at": "2024-01-05T08:30:00Z",
        "closed_at": "2024-01-06T14:15:00Z",
        "settled_at": "2024-01-06T14:15:00Z"
      }
    ]
  }
  ```
</ResponseExample>

## Overview

Retrieve all positions for a specific wallet address, organized by their current status. This endpoint provides comprehensive position data including real-time PnL calculations for open positions.

<Note>
  This endpoint does NOT require authentication and can be called for any wallet address. Position data is publicly accessible on the blockchain.
</Note>

## Path Parameters

<ParamField path="wallet_address" type="string" required>
  Ethereum wallet address to retrieve positions for.

  **Format**: 42-character hex string starting with "0x"\
  **Example**: "0x742d35cc6C6C7532B1140Da4C8A2f6C8ECfC9B46"
</ParamField>

## Response Structure

### Position Collections

<ResponseField name="open" type="array">
  Currently active positions with reserved margin
</ResponseField>

<ResponseField name="closed" type="array">
  Positions manually closed by user, may be pending payout
</ResponseField>

<ResponseField name="settled" type="array">
  Positions fully processed (liquidated or payout completed)
</ResponseField>

### Position Object Properties

<ResponseField name="id" type="integer">
  Unique identifier for the position (contract position ID)
</ResponseField>

<ResponseField name="symbol" type="string">
  Trading pair symbol (e.g., "BTC-USD", "ETH-USD", "SOL-USD", "BNB-USD", "XRP-USD", "HYPE-USD")
</ResponseField>

<ResponseField name="wallet_address" type="string">
  Owner's wallet address (lowercase hex format)
</ResponseField>

<ResponseField name="szi" type="string">
  Position size in base asset units (positive=long, negative=short)
</ResponseField>

<ResponseField name="margin" type="string">
  Initial margin amount used to open the position (USD)
</ResponseField>

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

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

<ResponseField name="exit_price" type="string">
  Price at which position was closed (null for open positions)
</ResponseField>

<ResponseField name="realized_pnl" type="string">
  Final realized profit/loss when closed (0.00 for open positions)
</ResponseField>

<ResponseField name="total_fee" type="string">
  Total fees paid on the position (0.00 for open positions)
</ResponseField>

<ResponseField name="status" type="string">
  Position status: "open", "closed", or "settled"
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO timestamp when the position was created
</ResponseField>

<ResponseField name="closed_at" type="string">
  ISO timestamp when the position was closed (null for open positions)
</ResponseField>

<ResponseField name="settled_at" type="string">
  ISO timestamp when position was fully settled (null for open/closed positions)
</ResponseField>

## Position Status Definitions

### Open Positions

* **Status**: "open"
* **Characteristics**: Active positions with ongoing market exposure
* **PnL**: Real-time unrealized profit/loss calculations
* **Actions**: Can be closed manually or liquidated automatically
* **Margin**: Reserved from account balance

### Closed Positions

* **Status**: "closed"
* **Characteristics**: Manually closed by user through [Close Position](/api-reference/trading/close)
* **PnL**: Final realized profit/loss (unrealizedPnl shows 0)
* **Closure**: User-initiated at market price
* **Settlement**: Immediate or queued based on available funds

### Settled Positions

* **Status**: "liquidated" or "settled"
* **Characteristics**: Automatically closed by the system
* **Liquidation**: Closed when reaching liquidation price
* **Settlement**: System-initiated closure
* **Timing**: Occurs automatically based on market conditions

## Error Responses

<ResponseField name="400 Bad Request" type="object">
  Invalid wallet address format

  ```json theme={null}
  {
    "error": 400,
    "message": "Invalid wallet address format"
  }
  ```
</ResponseField>

<ResponseField name="404 Not Found" type="object">
  Wallet address not found in system (no positions)

  ```json theme={null}
  {
    "error": 404,
    "message": "No positions found for this wallet address"
  }
  ```
</ResponseField>

## Related Endpoints

* **[Dashboard](/api-reference/account/dashboard)** - Includes position data plus other account information
* **[Queue Positions](/api-reference/positions/queue-positions)** - Check payout queue status for closed positions
* **[Close Position](/api-reference/trading/close)** - Close open positions manually
* **[Emergency Exit](/api-reference/trading/emergency-exit)** - Emergency exit from positions

<Tip>
  Monitor open positions frequently as unrealized PnL changes with market prices. Consider setting up alerts for positions approaching liquidation.
</Tip>

<Warning>
  Position data includes sensitive trading information. While publicly accessible, use appropriate security measures when displaying this data in applications.
</Warning>


## OpenAPI

````yaml GET /positions/{wallet_address}
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:
  /positions/{wallet_address}:
    get:
      summary: Get Positions
      description: Get all positions for a specific wallet address
      operationId: getPositions
      parameters:
        - name: wallet_address
          in: path
          required: true
          description: Ethereum wallet address
          schema:
            type: string
            pattern: ^0x[a-fA-F0-9]{40}$
      responses:
        '200':
          description: Positions retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PositionCollections'
        '400':
          description: Invalid wallet address
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security: []
components:
  schemas:
    PositionCollections:
      type: object
      properties:
        openPositions:
          type: array
          items:
            $ref: '#/components/schemas/PositionResponse'
        closedPositions:
          type: array
          items:
            $ref: '#/components/schemas/PositionResponse'
        settledPositions:
          type: array
          items:
            $ref: '#/components/schemas/PositionResponse'
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    PositionResponse:
      type: object
      properties:
        positionId:
          type: integer
        symbol:
          type: string
        side:
          type: string
          enum:
            - long
            - short
        margin:
          type: string
        leverage:
          type: integer
        size:
          type: string
        entryPrice:
          type: string
        markPrice:
          type: string
        liquidationPrice:
          type: string
        unrealizedPnl:
          type: string
        status:
          type: string
        createdAt:
          type: string
          format: date-time
        closedAt:
          type: string
          format: date-time
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Strike Protocol API key authentication

````