Closed Positions

GET /completed_positions

Retrieve your closed positions. Requires a valid API key sent with the x-api-key header.

Query parameters

  • pair string

    Filter by market (e.g. USD_BTCCALL_PERP)

  • start integer

    Start of time period to get positions for (in milliseconds UNIX time)

  • end integer

    End of time period to get positions for (in milliseconds UNIX time)

  • limit integer

    Amount of positions to get (default is 100)

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • code integer

      Response code

    • msg string

      Diagnostic message

    • result array[object]

      Request result

      Position

      Hide result attributes Show result attributes object
      • pair string

        Market of position

      • size number

        Size of position

      • free number

        Margin assigned to the position

      • locked number

        Margin locked within the position

      • realized number

        Realised P&L (USD)

      • funding number

        Funding P&L (USD)

      • fees number

        Fee P&L (USD)

      • stats object

        Detailed Position Information

        Hide stats attributes Show stats attributes object
        • size number

          Size of position

        • notional number

          Notional size of position

        • margin number

          Margin assigned to the position

        • pnl number

          Total P&L (USD)

        • upnl number

          Unrealised P&L (USD)

        • rpnl number

          Realised P&L (USD)

        • equity number

          Unrealised P&L + Margin

        • roe number

          P&L / Initial Margin

        • mark number

          Mark Price

        • avg_entry number

          VWAP Entry Price

        • leverage number

          Effective Leverage

        • lp number

          Liquidation Price

        • bankrupt number

          Bankruptcy Price

        • direction string

          BUY or SELL

  • 503 application/json

    Error

    Hide response attributes Show response attributes object
    • code integer
    • msg string
    • result object
GET /completed_positions
curl \
 --request GET 'https://api.testnet.everstrike.io/completed_positions' \
 --header "x-api-key: $API_KEY"
Response examples (200)
{
  "code": 200,
  "msg": "null",
  "result": [
    {
      "USD_BTCCALL_PERP": {
        "fees": 0,
        "free": 1,
        "size": 1,
        "fills": [],
        "stats": {
          "lp": 3.7,
          "pnl": 0,
          "roe": 0,
          "mark": 2.1,
          "rpnl": 0,
          "size": 1,
          "upnl": 0,
          "equity": 1,
          "margin": 1,
          "bankrupt": 3.78,
          "leverage": 2.82,
          "notional": 0.14,
          "avg_entry": 3.4,
          "direction": "BUY"
        },
        "locked": 0,
        "funding": 0,
        "realized": 0
      }
    }
  ]
}
Response examples (503)
{
  "code": 503,
  "msg": "Invalid request",
  "result": {}
}