> ## 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.

# Update strategy

> Updates strategy settings and collateral terms. Large collateral-term updates may be split across multiple returned transactions.



## OpenAPI

````yaml post /markets/strategy/update
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/strategy/update:
    post:
      tags:
        - Markets
        - Strategy
      summary: Update strategy
      description: >-
        Updates strategy settings and collateral terms. Large collateral-term
        updates may be split across multiple returned transactions.
      operationId: updateStrategy
      parameters:
        - name: User-Wallet
          in: header
          required: true
          schema:
            type: string
          description: Wallet address of the lender managing the strategy.
        - name: payer
          in: header
          required: false
          schema:
            type: string
          description: >-
            Optional fee payer. Defaults to the `User-Wallet` address when
            omitted.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateStrategyRequest'
      responses:
        '200':
          description: >-
            One or more serialized transactions needed to apply the strategy
            update.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionedTransactionBatchResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/GeneralError'
components:
  schemas:
    UpdateStrategyRequest:
      type: object
      required:
        - strategy
      properties:
        strategy:
          type: string
          description: Onchain address of the strategy to update.
        collateralTerms:
          $ref: '#/components/schemas/StrategyCollateralUpdates'
        updateParams:
          $ref: '#/components/schemas/EditStrategySettingsArgs'
    VersionedTransactionBatchResponse:
      type: array
      items:
        $ref: '#/components/schemas/VersionedTransactionResponse'
    StrategyCollateralUpdates:
      type: object
      properties:
        addCollateral:
          type: object
          description: Map of collateral mint or identifier to new collateral settings.
          additionalProperties:
            $ref: '#/components/schemas/AddCollateralArgs'
        removeCollateral:
          type: object
          description: Map of collateral mint or identifier to removal settings.
          additionalProperties:
            $ref: '#/components/schemas/RemoveCollateralArgs'
        updateCollateral:
          type: object
          description: >-
            Map of collateral mint or identifier to updated LTV and APY
            settings.
          additionalProperties:
            $ref: '#/components/schemas/CollateralParamsUpdateArgs'
        updateAssetAllocation:
          type: array
          items:
            $ref: '#/components/schemas/CollateralAllocationUpdateArgs'
    EditStrategySettingsArgs:
      type: object
      properties:
        originationsEnabled:
          type: boolean
        liquidityBuffer:
          type: number
        interestFee:
          type: number
        originationFee:
          type: number
        principalFee:
          type: number
        originationCap:
          type: number
        externalYieldSource:
          $ref: '#/components/schemas/ExternalYieldSourceParams'
    VersionedTransactionResponse:
      type: object
      required:
        - message
        - signatures
      properties:
        message:
          type: string
          description: Base64-encoded versioned transaction message.
        signatures:
          type: array
          items:
            $ref: '#/components/schemas/VersionedTransactionSignature'
    AddCollateralArgs:
      type: object
      properties:
        durationsAndApys:
          type: object
          description: >-
            Map of serialized duration keys to APY values, matching the strategy
            update payload expected by the API.
          additionalProperties:
            type: string
        externalMarketInformationAddress:
          type: string
          description: >-
            Optional external market information account to source the
            collateral from.
        marketInformation:
          type: object
          description: >-
            Optional inline market-information update payload used when
            introducing new collateral.
          additionalProperties: true
    RemoveCollateralArgs:
      type: object
      required:
        - durations
        - removeFromMarketInformation
      properties:
        durations:
          type: array
          items:
            $ref: '#/components/schemas/StrategyDuration'
        removeFromMarketInformation:
          type: boolean
          description: >-
            If true, remove the collateral from market information when no terms
            remain.
    CollateralParamsUpdateArgs:
      type: object
      properties:
        ltvUpdate:
          type: object
          description: Optional LTV/oracle update payload for the collateral.
          additionalProperties: true
        apyUpdate:
          type: object
          description: Optional map of serialized duration keys to replacement APY values.
          additionalProperties:
            type: string
    CollateralAllocationUpdateArgs:
      type: object
      required:
        - assetIdentifier
        - maxAllocationPct
      properties:
        assetIdentifier:
          type: string
          description: Collateral asset identifier to update.
        maxAllocationPct:
          type: string
          description: >-
            Maximum allocation percentage for the collateral, serialized as a
            string.
    ExternalYieldSourceParams:
      type: object
      required:
        - newExternalYieldSource
      properties:
        newExternalYieldSource:
          type: integer
          description: External yield source identifier.
    VersionedTransactionSignature:
      type: object
      required:
        - publicKey
        - signature
      properties:
        publicKey:
          type: string
        signature:
          type: string
    StrategyDuration:
      type: object
      required:
        - duration
        - durationType
      properties:
        duration:
          type: integer
          description: Numeric duration value.
        durationType:
          type: integer
          description: Duration unit enum used by Loopscale.
  responses:
    BadRequest:
      description: Bad Request
      content:
        text/plain:
          schema:
            type: string
            example: Invalid strategy address
    GeneralError:
      description: General Server Error
      content:
        text/plain:
          schema:
            type: string
            example: Failed to deserialize the JSON body into the target type.

````