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

# Return Model

> Tranching return model storage and curve structures

The tranching return model maps utilization to the Junior share of residual Senior-side yield.

The active model is stored in a separate `ExponentTranchingMarketReturnModel` account so larger piecewise curves do not live directly inside the main market account.

## ExponentTranchingMarketReturnModel

```rust theme={null}
pub struct ExponentTranchingMarketReturnModel {
    pub market: Pubkey,
    pub return_model: TrancheReturnModel,
    pub reserved: [u8; 128],
}
```

| Field          | Description                                          |
| -------------- | ---------------------------------------------------- |
| `market`       | Main `ExponentTranchingMarket` this model belongs to |
| `return_model` | Active return allocation model                       |
| `reserved`     | Reserved bytes for future compatibility              |

## TrancheReturnModel

```rust theme={null}
pub enum TrancheReturnModel {
    UtilizationGuidedCurve(UtilizationGuidedCurveParams),
    PiecewiseLinearCurve(PiecewiseLinearCurveParams),
}
```

## UtilizationGuidedCurveParams

```rust theme={null}
pub struct UtilizationGuidedCurveParams {
    pub junior_share_at_target_utilization: Number,
    pub last_target_shift_ts: i64,
    pub max_target_shift_speed: Number,
    pub zero_utilization_junior_share_discount: Number,
    pub full_utilization_junior_share_premium: Number,
}
```

| Field                                    | Description                                             |
| ---------------------------------------- | ------------------------------------------------------- |
| `junior_share_at_target_utilization`     | Junior return share at the fixed 90% target utilization |
| `last_target_shift_ts`                   | Timestamp used for target-shift accounting              |
| `max_target_shift_speed`                 | Maximum target-share movement per second                |
| `zero_utilization_junior_share_discount` | Discount applied below target at zero utilization       |
| `full_utilization_junior_share_premium`  | Premium applied above target at full utilization        |

## PiecewiseLinearCurveParams

```rust theme={null}
pub struct PiecewiseLinearCurveParams {
    pub points: Vec<u64>,
}
```

The piecewise model stores 1000 possible utilization-indexed points. Non-zero points define the curve. The program interpolates between the nearest initialized lower and upper points.

## PiecewiseLinearCurvePoint

```rust theme={null}
pub struct PiecewiseLinearCurvePoint {
    pub utilization: Number,
    pub y: Number,
}
```

| Field         | Description                             |
| ------------- | --------------------------------------- |
| `utilization` | Utilization value between `0` and `1`   |
| `y`           | Junior return share at that utilization |

## Update enum

Market initialization and modification use `TrancheReturnModelUpdate`:

```rust theme={null}
pub enum TrancheReturnModelUpdate {
    UtilizationGuidedCurve(UtilizationGuidedCurveParams),
    PiecewiseLinearCurve(Vec<PiecewiseLinearCurvePoint>),
}
```

For `PiecewiseLinearCurve`, the update can pass only the points that should be set. The program stores them into the 1000-point backing array.
