> ## 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 Wildcat Market data & user position.

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



## OpenAPI

````yaml /v1/combined_spec.json get /v1/wildcat/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/wildcat/market:
    get:
      tags:
        - Wildcat
      summary: Get Market & User Position
      description: >-
        Get Wildcat Market data & user position.


        The user position is only included if 'user_address' parameter is
        included.
      operationId: v1_wildcat_market
      parameters:
        - name: chain
          in: query
          required: true
          schema:
            type: string
            enum:
              - 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: market_address
          in: query
          required: true
          schema:
            type: string
            title: Market Address
            default: '0xC9499006a149C553d18171747ED19Aa7C6Dd19E2'
          description: The market address of the desired market data.
        - name: user_address
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: User Address
            default: '0xD804b4b6FEC79015a32E2D560E588726eE414Fd4'
          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/WildcatGetMarketResponse'
        '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.wildcat.wildcat_market(chain=models.V1WildcatMarketChain.ETHEREUM, market_address="0xC9499006a149C553d18171747ED19Aa7C6Dd19E2", user_address="0xD804b4b6FEC79015a32E2D560E588726eE414Fd4")

                # 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.wildcat.wildcatMarket({
                chain: "ethereum",
                marketAddress: "0xC9499006a149C553d18171747ED19Aa7C6Dd19E2",
                userAddress: "0xD804b4b6FEC79015a32E2D560E588726eE414Fd4",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    WildcatGetMarketResponse:
      properties:
        market_address:
          type: string
          title: Market Address
          description: The address of the market.
        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.
        available_to_lend:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Available To Lend
          description: The borrower's remaining available credit.
        loaned:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Loaned
          description: >-
            The total value of all funds supplied by lenders, including
            interest.
        max_borrowing_capacity:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Max Borrowing Capacity
          description: The maximum limit of funds that borrowers can access in the market.
        gross_interest_accrued:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Gross Interest Accrued
          description: >-
            The total gross interest generated by the loan before being split
            between lenders, reserves, and protocol fees.
        minimum_deposit:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Minimum Deposit
          description: >-
            The minimum amount of underlying asset required for a single deposit
            transaction.
        minimum_reserve_ratio:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Minimum Reserve Ratio
          description: >-
            A required percentage of market funds that must remain liquid and
            unavailable for borrowing.
        base_lender_apr:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Base Lender Apr
          description: >-
            The fixed annual percentage rate (excluding any protocol fees) that
            borrowers pay to lenders for assets within the market.
        protocol_fee_apr:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Protocol Fee Apr
          description: >-
            An additional APR that accrues to the protocol by slowly increasing
            required reserves. Derived by the fee configuration of the protocol
            as a percentage of the current base APR.
        effective_lender_apr:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Effective Lender Apr
          description: >-
            The current interest rate being paid to lenders: the base APR plus
            penalty APR if applicable.
        penalty_apr:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Penalty Apr
          description: >-
            An additional interest rate charged if the market remains
            delinquent—failing to maintain required reserves—after the grace
            period has elapsed.
        maximum_grace_period:
          type: integer
          title: Maximum Grace Period
          description: >-
            The number of seconds borrowers have to resolve reserve deficiencies
            or correct delinquency in the market before penalties take effect.
        available_grace_period:
          type: integer
          title: Available Grace Period
          description: >-
            The portion of the grace period left for borrowers to fix
            non-compliance issues, such as restoring reserves.
        withdrawal_cycle_duration:
          type: integer
          title: Withdrawal Cycle Duration
          description: >-
            The number of seconds for which withdrawal requests are grouped and
            processed.
        underlying_token:
          $ref: '#/components/schemas/UnderlyingToken'
          description: Underlying token (asset) used by the market.
        user_position:
          anyOf:
            - $ref: >-
                #/components/schemas/compass__api_backend__v1__models__wildcat__read__response__market__UserPosition
            - type: 'null'
          description: The user's position in the vault.
      type: object
      required:
        - market_address
        - name
        - symbol
        - decimals
        - available_to_lend
        - loaned
        - max_borrowing_capacity
        - gross_interest_accrued
        - minimum_deposit
        - minimum_reserve_ratio
        - base_lender_apr
        - protocol_fee_apr
        - effective_lender_apr
        - penalty_apr
        - maximum_grace_period
        - available_grace_period
        - withdrawal_cycle_duration
        - underlying_token
      title: WildcatGetMarketResponse
    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
    compass__api_backend__v1__models__wildcat__read__response__market__UserPosition:
      properties:
        market_token_balance:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Market Token Balance
          description: The quantity of market share tokens the user holds.
        underlying_token_balance:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Underlying Token Balance
          description: >-
            The total current value of the user's market tokens, denominated in
            the underlying asset.
      type: object
      required:
        - market_token_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
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````