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

# Check Market Position

> Check how many shares you've borrowed and the equivalent token amount of a given
market.



## OpenAPI

````yaml /v1/combined_spec.json get /v1/morpho/market_position
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/morpho/market_position:
    get:
      tags:
        - Morpho
      summary: Check Market Position
      description: >-
        Check how many shares you've borrowed and the equivalent token amount of
        a given

        market.
      operationId: v1_morpho_market_position
      parameters:
        - name: chain
          in: query
          required: true
          schema:
            type: string
            enum:
              - arbitrum
              - base
              - ethereum
            title: Chain
            default: base
        - name: user_address
          in: query
          required: true
          schema:
            type: string
            title: User Address
            default: '0x81d310Eb515E05EB26322e2DeDE9e75b754885A4'
          description: The user address of the desired market position.
        - name: unique_market_key
          in: query
          required: true
          schema:
            type: string
            pattern: ^0x.*
            title: Unique Market Key
            default: '0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5'
          description: >-
            The key that uniquely identifies the market. This can be found using
            the 'Get Markets' endpoint.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MorphoCheckMarketPositionResponse'
        '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.morpho.morpho_market_position(chain=models.V1MorphoMarketPositionChain.BASE, user_address="0x81d310Eb515E05EB26322e2DeDE9e75b754885A4", unique_market_key="0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5")

                # 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.morpho.morphoMarketPosition({
                chain: "base",
                userAddress: "0x81d310Eb515E05EB26322e2DeDE9e75b754885A4",
                uniqueMarketKey: "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    MorphoCheckMarketPositionResponse:
      properties:
        borrow_shares:
          type: integer
          title: Borrow Shares
        borrow_amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Borrow Amount
          description: The amount of the loan token borrowed.
        collateral_amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Collateral Amount
          description: The amount of the collateral token supplied.
        current_loan_to_value:
          type: string
          title: Current Loan To Value
          description: >-
            The Loan-To-Value ratio measures the proportion of debt relative to
            collateral value. If this ratio exceeds the
            'liquidation_loan_to_value_threshold', the position is liquidatable.
        liquidation_loan_to_value_threshold:
          type: string
          title: Liquidation Loan To Value Threshold
          description: >-
            Maximum borrowing percentage before liquidation risk. E.g: LLTV of
            80% means for a collateral value equivalent of $100, the maximum one
            can borrow in value is $80. If above like $80.0001, the position is
            liquidatable.
      type: object
      required:
        - borrow_shares
        - borrow_amount
        - collateral_amount
        - current_loan_to_value
        - liquidation_loan_to_value_threshold
      title: MorphoCheckMarketPositionResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````