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

# Tranche yield, premiums, and losses

> Retrieve historical tranche APYs, premium paid, and losses covered.

export const ApiResponse = ({children, errors = {}}) => {
  const [status, setStatus] = useState("200");
  const statuses = ["200", ...Object.keys(errors)];
  return <section className="api-response" aria-label="Response">
      <div className="api-response-header not-prose">
        <h2>Response</h2>
        <div className="api-response-format">
          {statuses.length > 1 ? <select aria-label="Response status" value={status} onChange={event => setStatus(event.target.value)}>
              {statuses.map(code => <option key={code} value={code}>{code}</option>)}
            </select> : <span>200</span>}
          <span className="api-response-mime">application/json</span>
        </div>
      </div>
      <div hidden={status !== "200"}>{children}</div>
      {status !== "200" && <div aria-live="polite">
          {Object.entries(errors[status]).map(([name, value]) => <ResponseField key={name} name={name} type={value === null ? "null" : Array.isArray(value) ? "array" : typeof value}>
              {name === "error" ? "Error message describing why the request failed." : "Additional error details."}
            </ResponseField>)}
        </div>}
    </section>;
};

## Path parameters

<ParamField path="address" type="string" required>
  Solana account address.
</ParamField>

<RequestExample dropdown>
  ```bash cURL theme={null}
  curl https://api.exponent.finance/tranching-markets/HM8iLNE2WEN6J1AuwSSCoM37wgeLQFwYZ4ymYLqAoapN/stats
  ```

  ```python Python theme={null}
  import requests

  response = requests.get("https://api.exponent.finance/tranching-markets/HM8iLNE2WEN6J1AuwSSCoM37wgeLQFwYZ4ymYLqAoapN/stats", timeout=30)
  response.raise_for_status()
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.exponent.finance/tranching-markets/HM8iLNE2WEN6J1AuwSSCoM37wgeLQFwYZ4ymYLqAoapN/stats");
  if (!response.ok) {
    throw new Error(`Request failed: ${response.status}`);
  }
  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ApiResponse errors={{"404": {"error": "<message>"}, "500": {"error": "<message>"}}}>
  <ResponseField name="address" type="string">
    Tranching market account address.
  </ResponseField>

  <ResponseField name="juniorApy1d" type="number | null">
    Mean junior-tranche APY over 1 day, as a decimal; null when unavailable.
  </ResponseField>

  <ResponseField name="juniorApy30d" type="number | null">
    Mean junior-tranche APY over 30 days, as a decimal; null when unavailable.
  </ResponseField>

  <ResponseField name="juniorApy7d" type="number | null">
    Mean junior-tranche APY over 7 days, as a decimal; null when unavailable.
  </ResponseField>

  <ResponseField name="lossCovered" type="string | null">
    Cumulative losses covered by the junior tranche, converted to token units.
  </ResponseField>

  <ResponseField name="premiumPaid" type="string | null">
    Cumulative premium paid between tranches, converted to token units.
  </ResponseField>

  <ResponseField name="seniorApy1d" type="number | null">
    Mean senior-tranche APY over 1 day, as a decimal; null when unavailable.
  </ResponseField>

  <ResponseField name="seniorApy30d" type="number | null">
    Mean senior-tranche APY over 30 days, as a decimal; null when unavailable.
  </ResponseField>

  <ResponseField name="seniorApy7d" type="number | null">
    Mean senior-tranche APY over 7 days, as a decimal; null when unavailable.
  </ResponseField>
</ApiResponse>

<ResponseExample>
  ```json 200 theme={null}
  {
    "address": "HM8iLNE2WEN6J1AuwSSCoM37wgeLQFwYZ4ymYLqAoapN",
    "seniorApy1d": 0.07327608937279768,
    "seniorApy7d": 0.07271759649965374,
    "seniorApy30d": 0.07426860343796927,
    "juniorApy1d": 0.19124774675405068,
    "juniorApy7d": 0.19511994705970825,
    "juniorApy30d": 0.19490460217713243,
    "premiumPaid": "3974.104567366",
    "lossCovered": "0"
  }
  ```

  ```json 404 theme={null}
  {
    "error": "<message>"
  }
  ```

  ```json 500 theme={null}
  {
    "error": "<message>"
  }
  ```
</ResponseExample>


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