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

# Deposit to Vault

> Deposit funds into a target lending Vault. On an additional deposit, the previous stake account and reward schedule is deleted and a new one is created.



## OpenAPI

````yaml post /markets/lending_vaults/deposit
openapi: 3.1.3
info:
  title: Loopscale API
  version: 1.0.0
servers:
  - url: https://tars.loopscale.com/v1
    description: Loopscale Production Server
security: []
paths:
  /markets/lending_vaults/deposit:
    post:
      tags:
        - Markets
      summary: Vault deposit
      description: >-
        Deposit funds into a target lending Vault. On an additional deposit, the
        previous stake account and reward schedule is deleted and a new one is
        created.
      operationId: vaultDeposit
      parameters:
        - name: user-wallet
          in: header
          required: true
          schema:
            type: string
          description: Wallet address of the depositing user
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VaultDepositRequest'
      responses:
        '200':
          description: Serialized transaction and update stake account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VaultTransactionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/GeneralError'
components:
  schemas:
    VaultDepositRequest:
      type: object
      required:
        - principalAmount
        - minLpAmount
        - vault
      properties:
        principalAmount:
          type: number
          description: Amount of Principal tokens to deposit (in lamports)
        minLpAmount:
          type: number
          description: >-
            Minimum number of LP tokens you are willing to accept in exchange
            for your principal deposit, in the event Vault increases in value
            between quote and execution
        vault:
          type: string
          description: Lending Vault address
    VaultTransactionResponse:
      type: object
      properties:
        transaction:
          type: object
          required:
            - message
            - signatures
          properties:
            message:
              type: string
              description: Base64-encoded versioned transaction message
            signatures:
              type: array
              items:
                type: object
                required:
                  - publicKey
                  - signature
                properties:
                  publicKey:
                    type: string
                  signature:
                    type: string
        stakeAccount:
          type: string
          description: Address of the stake account holding LP tokens (if >0)
  responses:
    BadRequest:
      description: Bad Request
      content:
        text/plain:
          schema:
            type: string
            example: 'Something went wrong: You have an error in your SQL syntax.'
    GeneralError:
      description: General Server Error
      content:
        text/plain:
          schema:
            type: string
            example: >-
              Failed to deserialize the JSON body into the target type: missing
              field `mints` at line 1 column 1.

````