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

> Get Vault data & User Position.

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



## OpenAPI

````yaml /v1/combined_spec.json get /v1/morpho/vault
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/vault:
    get:
      tags:
        - Morpho
      summary: Get Vault & User Position
      description: >-
        Get Vault data & User Position.


        The user position is only included if 'user_address' parameter is
        included.
      operationId: v1_morpho_vault
      parameters:
        - name: chain
          in: query
          required: true
          schema:
            type: string
            enum:
              - arbitrum
              - base
              - ethereum
            title: Chain
            default: ethereum
        - name: block
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Block
          description: Optional block number (defaults to latest).
        - name: vault_address
          in: query
          required: true
          schema:
            type: string
            title: Vault Address
            default: '0x182863131F9a4630fF9E27830d945B1413e347E8'
          description: The vault address of the desired vault position.
        - name: user_address
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: User Address
            default: '0xb8340945eBc917D2Aa0368a5e4E79C849c461511'
          description: >-
            The user address of the desired vault 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/VaultGetVaultResponse'
        '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_vault(chain=models.V1MorphoVaultChain.ETHEREUM, vault_address="0x182863131F9a4630fF9E27830d945B1413e347E8", user_address="0xb8340945eBc917D2Aa0368a5e4E79C849c461511")

                # 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.morphoVault({
                chain: "ethereum",
                vaultAddress: "0x182863131F9a4630fF9E27830d945B1413e347E8",
                userAddress: "0xb8340945eBc917D2Aa0368a5e4E79C849c461511",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    VaultGetVaultResponse:
      properties:
        name:
          type: string
          title: Name
          description: Name of the vault.
        symbol:
          type: string
          title: Symbol
          description: Symbol of the vault.
        decimals:
          type: integer
          title: Decimals
          description: Number of decimals used for the vault's share precision.
        total_assets:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total Assets
          description: Total amount of assets deposited in the vault.
        total_supply:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total Supply
          description: Total amount of shares issued from the vault.
        share_price:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Share Price
          description: The price of one vault share in terms of the underlying asset.
        underlying_token:
          $ref: '#/components/schemas/UnderlyingToken'
          description: Underlying token (asset) used by the vault.
        apy:
          $ref: '#/components/schemas/Apy'
          description: Average APY over various time periods.
        user_position:
          anyOf:
            - $ref: >-
                #/components/schemas/compass__api_backend__v1__models__vaults__read__response__vault__UserPosition
            - type: 'null'
          description: The user's position in the vault.
      type: object
      required:
        - name
        - symbol
        - decimals
        - total_assets
        - total_supply
        - share_price
        - underlying_token
        - apy
      title: VaultGetVaultResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UnderlyingToken:
      properties:
        address:
          type: string
          title: Address
        name:
          type: string
          title: Name
        symbol:
          type: string
          title: Symbol
        decimals:
          type: integer
          title: Decimals
      type: object
      required:
        - address
        - name
        - symbol
        - decimals
      title: UnderlyingToken
    Apy:
      properties:
        current:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Current
        apy_1_day:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Apy 1 Day
        apy_7_day:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Apy 7 Day
        apy_30_day:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Apy 30 Day
      type: object
      required:
        - current
        - apy_1_day
        - apy_7_day
        - apy_30_day
      title: Apy
    compass__api_backend__v1__models__vaults__read__response__vault__UserPosition:
      properties:
        amount_of_shares:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount Of Shares
          description: >-
            The number of vault share tokens representing the user’s
            proportional ownership of the assets in the vault.
        amount_in_underlying_token:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount In Underlying Token
          description: >-
            The equivalent value of the user’s vault shares, denominated in the
            vault’s underlying asset (deposit token).
      type: object
      required:
        - amount_of_shares
        - amount_in_underlying_token
      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
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````