GMX

GMX Positions API

The Positions API from GMX — 2 operation(s) for positions.

OpenAPI Specification

gmx-positions-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: '@gmx-io/gmx-public-api Allowances Positions API'
  version: 1.0.0
  license:
    name: Copyright
  contact: {}
servers:
- url: /v1
tags:
- name: Positions
paths:
  /positions:
    get:
      operationId: GetPositionsInfo
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PositionResponse'
                type: array
        '400':
          description: Bad Request - Invalid address
        '500':
          description: Internal Server Error
      tags:
      - Positions
      security: []
      parameters:
      - in: query
        name: address
        required: true
        schema:
          type: string
      - in: query
        name: includeRelatedOrders
        required: false
        schema:
          type: boolean
  /positions/{key}:
    get:
      operationId: GetPositionByKey
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PositionResponse'
        '400':
          description: Bad Request - Invalid key
        '404':
          description: Position not found
        '500':
          description: Internal Server Error
      tags:
      - Positions
      security: []
      parameters:
      - in: path
        name: key
        required: true
        schema:
          type: string
      - in: query
        name: includeRelatedOrders
        required: false
        schema:
          type: boolean
components:
  schemas:
    PositionResponse:
      properties:
        relatedOrders:
          items:
            $ref: '#/components/schemas/OrderResponse'
          type: array
        pendingClaimableFundingFeesUsd:
          type: string
        pendingFundingFeesUsd:
          type: string
        uiFeeUsd:
          type: string
        closingFeeUsd:
          type: string
        netValue:
          type: string
        leverageWithoutPnl:
          type: string
        leverageWithPnl:
          type: string
        leverage:
          type: string
        closePriceImpactDeltaUsd:
          type: string
        pendingImpactUsd:
          type: string
        priceImpactDiffUsd:
          type: string
        netPriceImapctDeltaUsd:
          type: string
        pnlAfterAllFeesPercentage:
          type: string
        pnlAfterAllFees:
          type: string
        netValueAfterAllFees:
          type: string
        pnlAfterFeesPercentage:
          type: string
        pnlAfterFees:
          type: string
        pnlPercentage:
          type: string
        hasLowCollateral:
          type: boolean
        remainingCollateralAmount:
          type: string
        remainingCollateralUsd:
          type: string
        collateralUsd:
          type: string
        liquidationPrice:
          type: string
        entryPrice:
          type: string
        markPrice:
          type: string
        poolName:
          type: string
        indexName:
          type: string
        data:
          type: string
        pendingImpactAmount:
          type: string
        uiFeeAmount:
          type: string
        traderDiscountAmount:
          type: string
        positionFeeAmount:
          type: string
        pnl:
          type: string
        isOpening:
          type: boolean
        claimableShortTokenAmount:
          type: string
        claimableLongTokenAmount:
          type: string
        fundingFeeAmount:
          type: string
        isLong:
          type: boolean
        decreasedAtTime:
          type: string
        increasedAtTime:
          type: string
        pendingBorrowingFeesUsd:
          type: string
        collateralAmount:
          type: string
        sizeInTokens:
          type: string
        sizeInUsd:
          type: string
        collateralTokenAddress:
          type: string
        marketAddress:
          type: string
        account:
          type: string
        contractKey:
          type: string
        key:
          type: string
      required:
      - pendingClaimableFundingFeesUsd
      - pendingFundingFeesUsd
      - uiFeeUsd
      - closingFeeUsd
      - netValue
      - closePriceImpactDeltaUsd
      - pendingImpactUsd
      - priceImpactDiffUsd
      - netPriceImapctDeltaUsd
      - pnlAfterAllFeesPercentage
      - pnlAfterAllFees
      - netValueAfterAllFees
      - pnlAfterFeesPercentage
      - pnlAfterFees
      - pnlPercentage
      - hasLowCollateral
      - remainingCollateralAmount
      - remainingCollateralUsd
      - collateralUsd
      - markPrice
      - poolName
      - indexName
      - data
      - pendingImpactAmount
      - uiFeeAmount
      - traderDiscountAmount
      - positionFeeAmount
      - pnl
      - claimableShortTokenAmount
      - claimableLongTokenAmount
      - fundingFeeAmount
      - isLong
      - decreasedAtTime
      - increasedAtTime
      - pendingBorrowingFeesUsd
      - collateralAmount
      - sizeInTokens
      - sizeInUsd
      - collateralTokenAddress
      - marketAddress
      - account
      - contractKey
      - key
      type: object
    OrderResponse:
      properties:
        requestId:
          type: string
          nullable: true
        dataList:
          items:
            type: string
          type: array
        autoCancel:
          type: boolean
        isFrozen:
          type: boolean
        shouldUnwrapNativeToken:
          type: boolean
        isLong:
          type: boolean
        srcChainId:
          type: string
        validFromTime:
          type: string
        updatedAtTime:
          type: string
        minOutputAmount:
          type: string
        callbackGasLimit:
          type: string
        executionFee:
          type: string
        acceptablePrice:
          type: string
        triggerPrice:
          type: string
        initialCollateralDeltaAmount:
          type: string
        sizeDeltaUsd:
          type: string
        decreasePositionSwapType:
          type: number
          format: double
        orderType:
          type: number
          format: double
        swapPath:
          items:
            type: string
          type: array
        initialCollateralTokenAddress:
          type: string
        marketAddress:
          type: string
        uiFeeReceiver:
          type: string
        callbackContract:
          type: string
        cancellationReceiver:
          type: string
        receiver:
          type: string
        account:
          type: string
        key:
          type: string
      required:
      - requestId
      - dataList
      - autoCancel
      - isFrozen
      - shouldUnwrapNativeToken
      - isLong
      - srcChainId
      - validFromTime
      - updatedAtTime
      - minOutputAmount
      - callbackGasLimit
      - executionFee
      - acceptablePrice
      - triggerPrice
      - initialCollateralDeltaAmount
      - sizeDeltaUsd
      - decreasePositionSwapType
      - orderType
      - swapPath
      - initialCollateralTokenAddress
      - marketAddress
      - uiFeeReceiver
      - callbackContract
      - cancellationReceiver
      - receiver
      - account
      - key
      type: object