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

# Update Market Config

> Update on-chain market configuration parameters

Updates the lending market's risk parameters, fee rates, supply caps, and auction settings. Requires `ISSUER_ROLE` on the market contract. Returns unsigned calldata, then records the applied config when you confirm with `txHash`.

<Warning>
  `liquidationThreshold` changes are capped at 10% per call by the smart contract.
</Warning>

## Path Parameters

<ParamField path="marketId" type="string" required>Market ID.</ParamField>

## Body Parameters

<ParamField body="config" type="object" required>
  <Expandable>
    <ParamField body="collateralFactor" type="integer" required>Max LTV in basis points (1000–9500).</ParamField>
    <ParamField body="liquidationThreshold" type="integer" required>Liquidation trigger in basis points (1000–9800).</ParamField>
    <ParamField body="liquidationPenalty" type="integer" required>Penalty in basis points (0–5000).</ParamField>
    <ParamField body="protocolFeeRate" type="integer" required>Issuer fee rate in basis points (0–10000).</ParamField>
    <ParamField body="minBorrowAmount" type="string" required>Minimum USDC borrow (e.g. `"100"`).</ParamField>
    <ParamField body="maxPriceAge" type="integer" required>Max oracle price age in seconds (300–604800).</ParamField>
    <ParamField body="closeFactor" type="integer" required>Max liquidatable fraction in basis points (1000–5000).</ParamField>
    <ParamField body="maxTotalCollateral" type="string" required>Global collateral cap (`"0"` = unlimited).</ParamField>
    <ParamField body="maxUserCollateral" type="string" required>Per-user collateral cap (`"0"` = unlimited).</ParamField>
    <ParamField body="useDutchAuction" type="boolean" required>Enable Dutch auction liquidation mode.</ParamField>
    <ParamField body="auctionDuration" type="integer" required>Auction length in seconds (600–86400).</ParamField>
    <ParamField body="auctionStartPremium" type="integer" required>Starting price multiplier in basis points (10000–20000).</ParamField>
    <ParamField body="auctionMinPremium" type="integer" required>Ending price multiplier in basis points (8000–10000).</ParamField>
  </Expandable>
</ParamField>

<ParamField body="txHash" type="string">
  Hash of the transaction you broadcast for this operation. Send it to confirm the transaction and record the result. Omit it to receive the calldata.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.trusset.org/lending-stocks/api/markets/{marketId}/config" \
    -H "X-API-Key: trusset_your_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "config": {
        "collateralFactor": 7500,
        "liquidationThreshold": 8500,
        "liquidationPenalty": 500,
        "protocolFeeRate": 2500,
        "minBorrowAmount": "100",
        "maxPriceAge": 86400,
        "closeFactor": 5000,
        "maxTotalCollateral": "0",
        "maxUserCollateral": "0",
        "useDutchAuction": false,
        "auctionDuration": 3600,
        "auctionStartPremium": 13000,
        "auctionMinPremium": 9500
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": { "txHash": "0xabc...def" }
  }
  ```
</ResponseExample>
