> ## 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 User Position

> Check user's overall position across the entire Morpho ecosystem.

Inlcuding all vault and market position metrics and relavant metadata of said vaults
and markets.



## OpenAPI

````yaml /v1/combined_spec.json get /v1/morpho/user_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/user_position:
    get:
      tags:
        - Morpho
      summary: Check User Position
      description: >-
        Check user's overall position across the entire Morpho ecosystem.


        Inlcuding all vault and market position metrics and relavant metadata of
        said vaults

        and markets.
      operationId: v1_morpho_user_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 wallet address of the desired user position.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MorphoCheckUserPositionResponse'
        '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_user_position(chain=models.V1MorphoUserPositionChain.BASE, user_address="0x81d310Eb515E05EB26322e2DeDE9e75b754885A4")

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

              console.log(result);
            }

            run();
components:
  schemas:
    MorphoCheckUserPositionResponse:
      properties:
        state:
          $ref: '#/components/schemas/UserState'
          description: A snapshot of the user's overall state in the Morpho ecosystem.
        vaultPositions:
          items:
            $ref: >-
              #/components/schemas/compass__api_backend__v1__models__morpho__read__response__check_user_position__VaultPosition
          type: array
          title: Vaultpositions
          description: A list of the user's vault positions.
        marketPositions:
          items:
            $ref: '#/components/schemas/MarketPosition'
          type: array
          title: Marketpositions
          description: A list of the user's market positions.
      type: object
      required:
        - state
        - vaultPositions
        - marketPositions
      title: MorphoCheckUserPositionResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UserState:
      properties:
        vaultsPnlUsd:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Vaultspnlusd
        vaultsAssetsUsd:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Vaultsassetsusd
        marketsPnlUsd:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Marketspnlusd
        marketsBorrowAssetsUsd:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Marketsborrowassetsusd
        marketsCollateralUsd:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Marketscollateralusd
        marketsSupplyAssetsUsd:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Marketssupplyassetsusd
      type: object
      required:
        - vaultsPnlUsd
        - vaultsAssetsUsd
        - marketsPnlUsd
        - marketsBorrowAssetsUsd
        - marketsCollateralUsd
        - marketsSupplyAssetsUsd
      title: UserState
    compass__api_backend__v1__models__morpho__read__response__check_user_position__VaultPosition:
      properties:
        id:
          type: string
          title: Id
        state:
          $ref: >-
            #/components/schemas/compass__api_backend__v1__models__morpho__read__response__check_user_position__VaultState
        vault:
          $ref: '#/components/schemas/Vault'
      type: object
      required:
        - id
        - state
        - vault
      title: VaultPosition
    MarketPosition:
      properties:
        market:
          $ref: >-
            #/components/schemas/compass__api_backend__v1__models__morpho__read__response__check_user_position__Market
        healthFactor:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Healthfactor
        priceVariationToLiquidationPrice:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Pricevariationtoliquidationprice
        state:
          $ref: >-
            #/components/schemas/compass__api_backend__v1__models__morpho__read__response__check_user_position__MarketState
      type: object
      required:
        - market
        - healthFactor
        - priceVariationToLiquidationPrice
        - state
      title: MarketPosition
    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
    compass__api_backend__v1__models__morpho__read__response__check_user_position__VaultState:
      properties:
        pnlUsd:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Pnlusd
        assets:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Assets
        assetsUsd:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Assetsusd
        shares:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Shares
      type: object
      required:
        - pnlUsd
        - assets
        - assetsUsd
        - shares
      title: VaultState
    Vault:
      properties:
        address:
          type: string
          title: Address
        name:
          type: string
          title: Name
        symbol:
          type: string
          title: Symbol
        whitelisted:
          type: boolean
          title: Whitelisted
        asset:
          $ref: >-
            #/components/schemas/compass__api_backend__v1__models__morpho__read__response__check_user_position__Asset
        dailyApys:
          $ref: >-
            #/components/schemas/compass__api_backend__v1__models__morpho__read__response__check_user_position__ApyData
        weeklyApys:
          $ref: >-
            #/components/schemas/compass__api_backend__v1__models__morpho__read__response__check_user_position__ApyData
        monthlyApys:
          $ref: >-
            #/components/schemas/compass__api_backend__v1__models__morpho__read__response__check_user_position__ApyData
      type: object
      required:
        - address
        - name
        - symbol
        - whitelisted
        - asset
        - dailyApys
        - weeklyApys
        - monthlyApys
      title: Vault
    compass__api_backend__v1__models__morpho__read__response__check_user_position__Market:
      properties:
        uniqueKey:
          type: string
          title: Uniquekey
      type: object
      required:
        - uniqueKey
      title: Market
    compass__api_backend__v1__models__morpho__read__response__check_user_position__MarketState:
      properties:
        pnlUsd:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Pnlusd
        borrowAssets:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Borrowassets
        borrowShares:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Borrowshares
        borrowAssetsUsd:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Borrowassetsusd
        collateral:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Collateral
        collateralUsd:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Collateralusd
        supplyAssets:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Supplyassets
        supplyShares:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Supplyshares
        supplyAssetsUsd:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Supplyassetsusd
      type: object
      required:
        - pnlUsd
        - borrowAssets
        - borrowShares
        - borrowAssetsUsd
        - collateral
        - collateralUsd
        - supplyAssets
        - supplyShares
        - supplyAssetsUsd
      title: MarketState
    compass__api_backend__v1__models__morpho__read__response__check_user_position__Asset:
      properties:
        name:
          type: string
          title: Name
        symbol:
          type: string
          title: Symbol
        address:
          type: string
          title: Address
        decimals:
          type: integer
          title: Decimals
        priceUsd:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Priceusd
        logoURI:
          anyOf:
            - type: string
            - type: 'null'
          title: Logouri
      type: object
      required:
        - name
        - symbol
        - address
        - decimals
        - priceUsd
        - logoURI
      title: Asset
    compass__api_backend__v1__models__morpho__read__response__check_user_position__ApyData:
      properties:
        apy:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Apy
        netApy:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Netapy
      type: object
      required:
        - apy
        - netApy
      title: ApyData
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````