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

# List User's Market Positions

> List the user's SY, PT, YT and LP positions for all markets on a given chain.



## OpenAPI

````yaml /v1/combined_spec.json get /v1/pendle/positions
openapi: 3.1.0
info:
  title: Compass API
  description: Compass Labs DeFi API
  version: 0.0.1
servers:
  - url: https://api.compasslabs.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v1/pendle/positions:
    get:
      tags:
        - Pendle
      summary: List User's Market Positions
      description: >-
        List the user's SY, PT, YT and LP positions for all markets on a given
        chain.
      operationId: v1_pendle_positions
      parameters:
        - name: chain
          in: query
          required: true
          schema:
            type: string
            enum:
              - arbitrum
              - base
              - ethereum
            title: Chain
            default: arbitrum
        - name: user_address
          in: query
          required: true
          schema:
            type: string
            title: User Address
            default: '0x68C314e30b543a35819e5625da563E6Da65D5dd4'
          description: The user address of the desired position.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PendleListUserPositionsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from compass_api_sdk import CompassAPI, models


            with CompassAPI(
                api_key_auth="<YOUR_API_KEY_HERE>",
            ) as compass_api:

                res = compass_api.pendle.pendle_positions(chain=models.V1PendlePositionsChain.ARBITRUM, user_address="0x68C314e30b543a35819e5625da563E6Da65D5dd4")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { CompassApiSDK } from "@compass-labs/api-sdk";

            const compassApiSDK = new CompassApiSDK({
              apiKeyAuth: "<YOUR_API_KEY_HERE>",
            });

            async function run() {
              const result = await compassApiSDK.pendle.pendlePositions({
                chain: "arbitrum",
                userAddress: "0x68C314e30b543a35819e5625da563E6Da65D5dd4",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    PendleListUserPositionsResponse:
      properties:
        positions:
          items:
            $ref: >-
              #/components/schemas/compass__api_backend__v1__models__pendle__read__response__positions__Position
          type: array
          title: Positions
          description: A list of the user's positions on the given chain.
      type: object
      required:
        - positions
      title: PendleListUserPositionsResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    compass__api_backend__v1__models__pendle__read__response__positions__Position:
      properties:
        chainId:
          type: integer
          title: Chainid
        totalOpen:
          type: integer
          title: Totalopen
        totalClosed:
          type: integer
          title: Totalclosed
        totalSy:
          type: integer
          title: Totalsy
        openPositions:
          items:
            $ref: '#/components/schemas/OpenPosition'
          type: array
          title: Openpositions
        closedPositions:
          items:
            $ref: '#/components/schemas/OpenPosition'
          type: array
          title: Closedpositions
        syPositions:
          items:
            $ref: '#/components/schemas/SyPosition'
          type: array
          title: Sypositions
        updatedAt:
          type: string
          format: date-time
          title: Updatedat
      type: object
      required:
        - chainId
        - totalOpen
        - totalClosed
        - totalSy
        - openPositions
        - closedPositions
        - syPositions
        - updatedAt
      title: Position
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    OpenPosition:
      properties:
        marketId:
          type: string
          title: Marketid
        pt:
          $ref: >-
            #/components/schemas/compass__api_backend__v1__models__pendle__read__response__positions__TokenBalance
        yt:
          $ref: >-
            #/components/schemas/compass__api_backend__v1__models__pendle__read__response__positions__TokenBalance
        lp:
          $ref: '#/components/schemas/LpBalance'
      type: object
      required:
        - marketId
        - pt
        - yt
        - lp
      title: OpenPosition
    SyPosition:
      properties:
        syId:
          type: string
          title: Syid
        balance:
          type: string
          title: Balance
      type: object
      required:
        - syId
        - balance
      title: SyPosition
    compass__api_backend__v1__models__pendle__read__response__positions__TokenBalance:
      properties:
        valuation:
          type: number
          title: Valuation
        balance:
          type: string
          title: Balance
      type: object
      required:
        - valuation
        - balance
      title: TokenBalance
    LpBalance:
      properties:
        valuation:
          type: number
          title: Valuation
        balance:
          type: string
          title: Balance
        activeBalance:
          type: string
          title: Activebalance
      type: object
      required:
        - valuation
        - balance
        - activeBalance
      title: LpBalance
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````