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

# Create vault timelocks

> Create one or more timelock updates for vault collateral, rates, allocation, caps, and settings changes.



## OpenAPI

````yaml post /markets/lending_vaults/timelock/create
openapi: 3.1.0
info:
  title: Loopscale API
  version: 0.1.0
servers:
  - url: https://tars.loopscale.com/v1
    description: Loopscale Production Server
security: []
paths:
  /markets/lending_vaults/timelock/create:
    post:
      tags:
        - lending_vaults
      summary: Create vault timelocks
      description: >-
        Create one or more timelock updates for vault collateral, rates,
        allocation, caps, and settings changes.
      operationId: query_create_timelocks
      parameters:
        - name: User-Wallet
          in: header
          description: >-
            Base58 wallet of the acting user; the transaction is built for this
            wallet. Missing header returns 401
          required: true
          schema:
            type: string
        - name: payer
          in: header
          description: >-
            Base58 wallet that pays transaction fees; defaults to the
            `User-Wallet` wallet when omitted
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: Transaction-Settings
          in: header
          description: >-
            Optional JSON-encoded transaction settings (priority-fee percentile,
            compute limits, simulation mode)
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: Idempotent-Key
          in: header
          description: >-
            Optional idempotency key; a retried write with the same key replays
            the original response
          required: false
          schema:
            type:
              - string
              - 'null'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitLendingVaultTimelockTxnParams'
        required: true
      responses:
        '200':
          description: Serialized versioned transactions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VersionedTransactionReturn'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Idempotency-Key reused with a different request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    InitLendingVaultTimelockTxnParams:
      type: object
      required:
        - vaultAddress
      properties:
        collateralUpdates:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/StrategyCollateralUpdates'
        editStrategyArgs:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/EditStrategySettingsArgs'
        editVaultArgs:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/EditVaultArgs'
        updatePrincipalCaps:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/PrincipalCapsUpdateArgs'
        vaultAddress:
          type: string
    VersionedTransactionReturn:
      type: object
      description: versioned txn return
      required:
        - message
        - signatures
      properties:
        message:
          type: string
          description: serialized message
        signatures:
          type: array
          items:
            $ref: '#/components/schemas/VersionedTransactionSignature'
          description: serialized signatures
    ErrorResponse:
      type: object
      description: |-
        Canonical error envelope for every endpoint. The `x-request-id` response
        header carries the correlation id for the failing request.
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetails'
          description: error detail
    StrategyCollateralUpdates:
      type: object
      properties:
        addCollateral:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/AddCollateralArgs'
          propertyNames:
            type: string
        removeCollateral:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/RemoveCollateralArgs'
          propertyNames:
            type: string
        updateAssetAllocation:
          type: array
          items:
            $ref: '#/components/schemas/CollateralAllocationUpdateArgs'
        updateCollateral:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/CollateralParamsUpdateArgs'
          propertyNames:
            type: string
    EditStrategySettingsArgs:
      type: object
      properties:
        externalYieldSource:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ExternalYieldSourceParams'
        interestFee:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        liquidityBuffer:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        originationCap:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        originationFee:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        originationsEnabled:
          type:
            - boolean
            - 'null'
        principalFee:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
    EditVaultArgs:
      type: object
      required:
        - maxEarlyUnstakeFeeCbps
      properties:
        maxEarlyUnstakeFeeCbps:
          type: integer
          format: int64
          minimum: 0
    PrincipalCapsUpdateArgs:
      type: object
      required:
        - max1HrBorrowCap
        - max24HrBorrowCap
        - maxOutstandingBorrowCap
        - max1HrSupplyCap
        - max24HrSupplyCap
        - maxOutstandingSupplyCap
        - max1HrWithdrawCap
        - max24HrWithdrawCap
      properties:
        max1HrBorrowCap:
          type: string
        max1HrSupplyCap:
          type: string
        max1HrWithdrawCap:
          type: string
        max24HrBorrowCap:
          type: string
        max24HrSupplyCap:
          type: string
        max24HrWithdrawCap:
          type: string
        maxOutstandingBorrowCap:
          type: string
        maxOutstandingSupplyCap:
          type: string
    VersionedTransactionSignature:
      type: object
      description: versioned txn return
      required:
        - publicKey
        - signature
      properties:
        publicKey:
          type: string
          description: serialized message
        signature:
          type: string
          description: serialized signatures
    ErrorDetails:
      type: object
      description: Inner detail of the [`ErrorResponse`] envelope.
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
          description: HTTP status code, mirrored in the response status line
          example: 400
          minimum: 0
        message:
          type: string
          description: human-readable, client-safe message (sensitive data redacted)
          example: Request could not be processed.
        simulation:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SimulationDebug'
              description: >-
                Populated on transaction-generation endpoints when the
                build-path

                simulation reverts. Absent on all other error paths.
    AddCollateralArgs:
      type: object
      required:
        - durationsAndApys
      properties:
        durationsAndApys:
          type: object
          description: Request map of serialized-duration → apy, both as strings.
          additionalProperties:
            type: string
          propertyNames:
            type: string
        externalMarketInformationAddress:
          type:
            - string
            - 'null'
        marketInformation:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ParsedUpdateAssetDataParams'
              description: >-
                Parsed asset-data params (ignored for base vaults / custom
                strategy).
    RemoveCollateralArgs:
      type: object
      required:
        - durations
        - removeFromMarketInformation
      properties:
        durations:
          type: array
          items:
            $ref: '#/components/schemas/StrategyDuration'
        removeFromMarketInformation:
          type: boolean
    CollateralAllocationUpdateArgs:
      type: object
      required:
        - assetIdentifier
        - maxAllocationPct
      properties:
        assetIdentifier:
          type: string
        maxAllocationPct:
          type: string
    CollateralParamsUpdateArgs:
      type: object
      properties:
        apyUpdate:
          type:
            - object
            - 'null'
          description: Request map of serialized-duration → apy, both as strings.
          additionalProperties:
            type: string
          propertyNames:
            type: string
        ltvUpdate:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ParsedUpdateAssetDataParams'
              description: Parsed asset-data params.
    ExternalYieldSourceParams:
      type: object
      required:
        - newExternalYieldSource
      properties:
        newExternalYieldSource:
          type: integer
          format: int32
          minimum: 0
    SimulationDebug:
      type: object
      description: >-
        Diagnostics attached to a build-path simulation revert so clients can
        inspect

        the exact txn that would have failed on-chain. Only populated for
        txn-gen

        endpoints; other 4xx/5xx responses omit this field.
      required:
        - decoded
        - logs
      properties:
        decoded:
          type: string
          description: >-
            Human-readable decoded error (Anchor "Error Message: ..." when
            available,

            otherwise the raw program error code or `TransactionError` debug
            form).
        logs:
          type: array
          items:
            type: string
          description: Program logs from the reverting simulation, in order.
        serializedTransaction:
          type:
            - string
            - 'null'
          description: >-
            Base64-encoded, bincode-serialized `VersionedTransaction` that was

            simulated (signatures zeroed for sig-verify-disabled simulation).

            Decode with
            `bincode::deserialize::<VersionedTransaction>(&base64_decode(..))`.
    ParsedUpdateAssetDataParams:
      type: object
      description: >-
        Parsed per-collateral asset-data / oracle config update (LTV,
        liquidation

        threshold, oracle account/type, allocation cap).
      required:
        - assetIdentifier
      properties:
        assetIdentifier:
          type: string
        liquidationThreshold:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        ltv:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        maxAge:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        maxCollateralAllocationPct:
          type:
            - string
            - 'null'
        maxUncertainty:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        oracleAccount:
          type:
            - string
            - 'null'
        oracleType:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        quoteMint:
          type:
            - string
            - 'null'
        removeCollateral:
          type:
            - boolean
            - 'null'
    StrategyDuration:
      type: object
      required:
        - duration
        - durationType
      properties:
        duration:
          type: integer
          format: int32
          minimum: 0
        durationType:
          type: integer
          format: int32
          minimum: 0

````

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