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

# Get Market & User Position

> Get the market's implied APY, maturity date and the associated token data.

The user position is only included if 'user_address' parameter is included.



## OpenAPI

````yaml /v1/combined_spec.json get /v1/pendle/market
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/market:
    get:
      tags:
        - Pendle
      summary: Get Market & User Position
      description: >-
        Get the market's implied APY, maturity date and the associated token
        data.


        The user position is only included if 'user_address' parameter is
        included.
      operationId: v1_pendle_market
      parameters:
        - name: chain
          in: query
          required: true
          schema:
            type: string
            enum:
              - arbitrum
              - base
              - ethereum
            title: Chain
            default: arbitrum
        - name: block
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Block
          description: Optional block number (defaults to latest).
        - name: market_address
          in: query
          required: true
          schema:
            type: string
            title: Market Address
            default: '0x46d62a8dede1bf2d0de04f2ed863245cbba5e538'
          description: The market address of the desired position.
        - name: user_address
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: User Address
            default: '0x68C314e30b543a35819e5625da563E6Da65D5dd4'
          description: >-
            The user address of the desired market position. Only include if you
            would like the user position included in the response. Defaults to
            `None`.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PendleGetMarketResponse'
        '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_market(chain=models.V1PendleMarketChain.ARBITRUM, market_address="0x46d62a8dede1bf2d0de04f2ed863245cbba5e538", 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.pendleMarket({
                chain: "arbitrum",
                marketAddress: "0x46d62a8dede1bf2d0de04f2ed863245cbba5e538",
                userAddress: "0x68C314e30b543a35819e5625da563E6Da65D5dd4",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    PendleGetMarketResponse:
      properties:
        market_address:
          type: string
          title: Market Address
          description: The address of the market.
        implied_apy:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Implied Apy
          description: The implied APY of the market.
        maturity_date:
          type: string
          format: date-time
          title: Maturity Date
          description: The maturity date of the market. ISO 8601 format. UTC timezone.
        tokens:
          $ref: '#/components/schemas/MarketTokens'
          description: Token data relevant to the market.
        user_position:
          anyOf:
            - $ref: >-
                #/components/schemas/compass__api_backend__v1__models__pendle__read__response__market__UserPosition
            - type: 'null'
          description: The user's position in the market.
      type: object
      required:
        - market_address
        - implied_apy
        - maturity_date
        - tokens
      title: PendleGetMarketResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MarketTokens:
      properties:
        underlying_token:
          $ref: '#/components/schemas/Erc20Data'
        sy:
          $ref: '#/components/schemas/Erc20Data'
        pt:
          $ref: '#/components/schemas/Erc20Data'
        yt:
          $ref: '#/components/schemas/Erc20Data'
        accounting_asset:
          anyOf:
            - $ref: '#/components/schemas/Erc20Data'
            - type: 'null'
      type: object
      required:
        - underlying_token
        - sy
        - pt
        - yt
        - accounting_asset
      title: MarketTokens
    compass__api_backend__v1__models__pendle__read__response__market__UserPosition:
      properties:
        claimable_yield:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Claimable Yield
          description: The amount of yield that can be claimed in the underlying token.
        sy_balance:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Sy Balance
          description: The amount of SY tokens the user currently holds.
        pt_balance:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Pt Balance
          description: The amount of PT tokens the user currently holds.
        yt_balance:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Yt Balance
          description: The amount of YT tokens the user currently holds.
        lp_balance:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Lp Balance
          description: The amount of LP tokens the user currently holds.
        underlying_token_balance:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Underlying Token Balance
          description: The amount of underlying tokens the user currently holds.
        accounting_asset_balance:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Accounting Asset Balance
          description: The amount of accounting assets the user currently holds.
      type: object
      required:
        - claimable_yield
        - sy_balance
        - pt_balance
        - yt_balance
        - lp_balance
        - underlying_token_balance
      title: UserPosition
    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
    Erc20Data:
      properties:
        address:
          type: string
          title: Address
        symbol:
          type: string
          title: Symbol
        name:
          type: string
          title: Name
        decimals:
          type: integer
          title: Decimals
      type: object
      required:
        - address
        - symbol
        - name
        - decimals
      title: Erc20Data
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````