> ## Documentation Index
> Fetch the complete documentation index at: https://docs.defiorbit.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Position Events

> Position history: supply, borrow, withdraw, repay, and liquidation for one chain. Each event has type, amount, amountUSD, priceUSD, asset details, and transactionHash. market_id is optional; each event names its market. Newest first.

**Credits:** 1 per successful call.



## OpenAPI

````yaml /openapi.yaml get /v1/lending/morpho/position/{chain_id}/events
openapi: 3.1.0
info:
  title: DeFi Orbit API
  version: 1.0.0
  description: Public REST API for DeFi Orbit positions, lending, portfolio, and usage.
servers:
  - url: https://api.defiorbit.xyz
security:
  - bearerAuth: []
tags:
  - name: Portfolio
  - name: Snapshots
  - name: Uniswap V3
  - name: Aerodrome V3
  - name: Orca
  - name: Aave V3
  - name: Morpho
  - name: Kamino
  - name: Usage
paths:
  /v1/lending/morpho/position/{chain_id}/events:
    get:
      tags:
        - Morpho
      summary: Get Position Events
      description: >-
        Position history: supply, borrow, withdraw, repay, and liquidation for
        one chain. Each event has type, amount, amountUSD, priceUSD, asset
        details, and transactionHash. market_id is optional; each event names
        its market. Newest first.


        **Credits:** 1 per successful call.
      operationId: get_v1_lending_morpho_position_chain_id_events
      parameters:
        - name: chain_id
          in: path
          required: true
          schema:
            type: integer
            description: Chain ID.
            example: 1
            x-default: 1
        - name: wallet
          in: query
          required: true
          schema:
            type: string
            description: Wallet address.
            example: '0xbf7620d0377b0660a6cbaef5cdfe2e00eddc1495'
            x-default: '0xbf7620d0377b0660a6cbaef5cdfe2e00eddc1495'
        - name: market_id
          in: query
          required: false
          schema:
            type: string
            description: Isolated Morpho market id.
        - name: page
          in: query
          required: false
          schema:
            type: integer
            description: 'Page. Default: 1.'
            default: 1
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            description: 'Maximum 25. Default: 10.'
            default: 10
            maximum: 25
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/RequestId'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                            marketId:
                              type: string
                            blockNumber:
                              type: integer
                            logIndex:
                              type: number
                            timestamp:
                              type: number
                              description: Unix seconds.
                            transactionHash:
                              type: string
                            asset:
                              type: object
                              properties:
                                address:
                                  type: string
                                symbol:
                                  type: string
                                name:
                                  type: string
                                decimals:
                                  type: integer
                                logoURI:
                                  type: string
                                  description: >-
                                    Token logo URL, or null when none is
                                    available.
                              required:
                                - address
                                - symbol
                                - name
                                - decimals
                                - logoURI
                            amount:
                              type: string
                            amountUSD:
                              type: string
                            priceUSD:
                              type: string
                            shares:
                              type: string
                            counterparty:
                              type: string
                            isCollateral:
                              type: boolean
                          required:
                            - type
                            - marketId
                            - blockNumber
                            - logIndex
                            - timestamp
                            - transactionHash
                            - asset
                            - amount
                            - amountUSD
                            - priceUSD
                            - shares
                            - counterparty
                            - isCollateral
                      pagination:
                        $ref: '#/components/schemas/Pagination'
                    required:
                      - data
                      - pagination
              example:
                data:
                  - type: deposit
                    marketId: >-
                      0xabababababababababababababababababababababababababababababababab
                    blockNumber: 19000000
                    logIndex: 4
                    timestamp: 1717200000
                    transactionHash: '0xabc'
                    asset:
                      address: 0xweth
                      symbol: WETH
                      name: Wrapped Ether
                      decimals: 18
                      logoURI: ''
                    amount: '0.20'
                    amountUSD: '684.49'
                    priceUSD: '3422.45'
                    shares: '200000000000000000'
                    counterparty: '0xbf7620d0377b0660a6cbaef5cdfe2e00eddc1495'
                    isCollateral: true
                pagination:
                  page: 1
                  limit: 10
                  total: 4
                  next_page: null
                  prev_page: null
                request_id: req_...
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    RequestId:
      type: object
      required:
        - request_id
      properties:
        request_id:
          type: string
          description: Id to quote when you contact support.
    Pagination:
      type: object
      required:
        - page
        - limit
        - total
        - next_page
        - prev_page
      properties:
        page:
          type: integer
        limit:
          type: integer
        total:
          type: integer
          description: Matching rows, before this page is sliced.
        next_page:
          type: string
          nullable: true
          description: URL of the next page, or null on the last page.
        prev_page:
          type: string
          nullable: true
          description: URL of the previous page, or null on the first page.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
  responses:
    BadRequest:
      description: Missing or invalid parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_PARAMETER
              message: page must be a positive integer.
              request_id: req_...
    Unauthorized:
      description: Missing, malformed, invalid, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_API_KEY
              message: Missing API key.
              request_id: req_...
    PaymentRequired:
      description: The organization does not have enough credits.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INSUFFICIENT_CREDITS
              message: Insufficient API credits.
              request_id: req_...
    Forbidden:
      description: The organization is suspended, or the endpoint or feature is disabled.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: ACCOUNT_SUSPENDED
              message: This organization is suspended.
              request_id: req_...
    TooManyRequests:
      description: The organization exceeded its requests-per-second limit.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Requests per second for the organization.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests left in the current window.
          schema:
            type: integer
        X-RateLimit-Reset:
          description: Unix time when the window resets.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: RATE_LIMIT_EXCEEDED
              message: Rate limit exceeded. Please try again later.
              request_id: req_...
    InternalError:
      description: Unexpected server error, or pricing is not configured.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INTERNAL_ERROR
              message: An unexpected error occurred.
              request_id: req_...
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Paste your API key from the
        [dashboard](https://platform.defiorbit.xyz/dashboard/keys). The key
        starts with `do_sk_`.
      x-default: YOUR_API_KEY

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.