> For the complete documentation index, see [llms.txt](https://docs.pinto.money/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pinto.money/pinto-improvements/pi-5.md).

# PI-5: Soil Issuance and Parameter Changes

Executed on January 2, 2025 at 06:11 UTC.

## Summary <a href="#id-1a3e4019-aad5-8362-b8e5-019a303488f3" id="id-1a3e4019-aad5-8362-b8e5-019a303488f3"></a>

1. [**Maximum Temperature**](https://docs.pinto.money/resources/glossary#maximum-temperature) **Decimals:** Upgrade the Maximum Temperature from 0 to 6 decimal precision.
2. [**Soil**](https://docs.pinto.money/resources/glossary#soil) **Issuance Below Peg Changes:** Scale Soil issuance when time-weighted average ΔP ([TWAΔP](https://docs.pinto.money/resources/glossary#deltap)) <= 0 and instantaneous ΔP (INSTΔP) <= 0 by (1 - min([L2SR](https://docs.pinto.money/resources/glossary#liquidity-to-supply-ratio-l2sr), 0.99)) and set a minimum Soil issued to 1% of min(|TWAΔP|, |INSTΔP|), before rounding. ΔP measures a [Pinto](https://docs.pinto.money/resources/glossary#pinto) supply imbalance, while P denotes price.
3. **Soil Issuance Above Peg Changes:** Change the scalar on [Pods](https://docs.pinto.money/resources/glossary#pods) that became [Harvestable](https://docs.pinto.money/resources/glossary#harvestable-pods) at the beginning of the [Season](https://docs.pinto.money/resources/glossary#season) for Soil issuance above peg:
   * from 0.5 to 0.25 when the [Pod Rate](https://docs.pinto.money/resources/glossary#pod-rate) is Excessively High.
   * from 1 to 0.5 when the Pod Rate is Reasonably High.
   * from 1 to 1.2 when the Pod Rate is Excessively Low, price is Excessively High, and Soil demand is increasing.
4. **Soil Issuance Fix When INSTΔP > 0 and TWAΔP < 0:** Change Soil issuance when the inter-block MEV manipulation resistant instantaneous ΔP (INSTΔP) > 0 and TWAΔP < 0 to be 1% of |TWAΔP| scaled by:
   * 0.25 when the Pod Rate is Excessively High.
   * 0.5 when the Pod Rate is Reasonably High.
   * 1 when the Pod Rate is Reasonably Low.
   * 1.2 when the Pod Rate is Excessively Low.
5. **Case Adjustment Changes:** Lower the Maximum Temperature adjustments in several instances when TWAΔP <= 0 (detailed below).
6. **Intended** [**Crop Scalar**](https://docs.pinto.money/responding-to-state/crop-ratio-changes) **Adjustment:** PI-5 intended to increase certain Crop Scalar decreases from 1 to 2 percentage points per Season, but an encoding error left them unchanged. PI-6 implemented the correction.
7. **New Events:** Introduce new events `SeasonMetrics` and `RainStatus`, and add `beans` to `SeasonOfPlentyWell`.

## Links <a href="#id-9cde4019-aad5-8354-a986-81ef08cb1924" id="id-9cde4019-aad5-8354-a986-81ef08cb1924"></a>

* [Implementation PR](https://github.com/pinto-org/protocol/pull/7)
* Implementation Commit: [fa54250b36cf4b2173dff9a4633cf98a177be8bd](https://github.com/pinto-org/protocol/commit/fa54250b36cf4b2173dff9a4633cf98a177be8bd)
* [Safe Transaction](https://app.safe.global/transactions/tx?safe=base:0x2cf82605402912C6a79078a9BBfcCf061CbfD507\&id=multisig_0x2cf82605402912C6a79078a9BBfcCf061CbfD507_0x137187214292dcd7dc9cb1028059c6f2b44bc00732e99fd3daa54676012a2670)
* [Diamond Cut Transaction](https://basescan.org/tx/0xc914c1ae83310b23259d329cefc7f04560dbb1a37254688b517bad571b0a9145)

## Problems <a href="#ad9e4019-aad5-832e-9182-810ce81c8466" id="ad9e4019-aad5-832e-9182-810ce81c8466"></a>

### 1. Maximum Temperature Decimals <a href="#id-45be4019-aad5-8248-a2cb-01fb869dcf55" id="id-45be4019-aad5-8248-a2cb-01fb869dcf55"></a>

Maximum Temperature adjustments were limited to 100-basis-point changes, which reduced the granularity available to adjust the Maximum Temperature in each case.

### 2. Soil Issuance Below Peg Changes <a href="#id-925e4019-aad5-82c0-a787-01022ba17728" id="id-925e4019-aad5-82c0-a787-01022ba17728"></a>

Pinto did not factor the L2SR into its Soil issuance.

### 3. Soil Issuance Above Peg Changes <a href="#f76e4019-aad5-8219-8675-0178957c7449" id="f76e4019-aad5-8219-8675-0178957c7449"></a>

The protocol is willing to issue Pods every Season in order to measure changing demand for Soil, including when TWAΔP > 0, but the protocol did so at higher coefficients than this adjustment targets.

### 4. Soil Issuance Fix When INSTΔP > 0 and TWAΔP < 0 <a href="#id-3d8e4019-aad5-827e-8c99-810ab5525565" id="id-3d8e4019-aad5-827e-8c99-810ab5525565"></a>

When issuing Soil below peg, the protocol compared INSTΔP and TWAΔP and issued the minimum of the absolute values of the two in order to minimize debt issuance. However, when INSTΔP > 0 and TWAΔP < 0, the protocol issued |TWAΔP| Soil which led to excessive debt issuance in instances where there was a large |TWAΔP| but the protocol was over its value target at the time of the [`gm`](https://docs.pinto.money/resources/glossary#gm) call.

### 5. Case Adjustment Changes <a href="#c5be4019-aad5-8318-abd9-017b47eafa3d" id="c5be4019-aad5-8318-abd9-017b47eafa3d"></a>

The Maximum Temperature was likely increasing more aggressively than necessary in certain instances when TWAΔP <= 0, particularly when the Pod Rate is above its optimal level or when the Pod Rate is Reasonably Low and there is increasing demand for Soil.

### 6. Intended Crop Scalar Adjustment <a href="#id-912e4019-aad5-8216-8afe-01b1d8a1e2dd" id="id-912e4019-aad5-8216-8afe-01b1d8a1e2dd"></a>

The selected cases decreased the Crop Scalar by one percentage point per Season. PI-5 intended a two-percentage-point decrease, but its constant encoding did not implement it.

### 7. New Events <a href="#id-49fe4019-aad5-837c-892a-01c48f72cfda" id="id-49fe4019-aad5-837c-892a-01c48f72cfda"></a>

There was no straightforward off-chain method to get certain [Flood](https://docs.pinto.money/resources/glossary#flood) and Season data.

## Solutions <a href="#id-557e4019-aad5-8294-99e1-0173937fbd1d" id="id-557e4019-aad5-8294-99e1-0173937fbd1d"></a>

### 1. Maximum Temperature Decimals <a href="#id-1d2e4019-aad5-8256-a30d-812b5cd75393" id="id-1d2e4019-aad5-8256-a30d-812b5cd75393"></a>

* Expand the Temperature adjustment field `bT` to 4 bytes in `LibCases` and adjust the relevant bytes and handle decoding.
* Upcast `bT` to an `int32` and adjust the corresponding `TemperatureChange` event.
* Omit scaling of `s.sys.weather.temp` and assume 6 decimal precision by default.
* Update `LibDibbler` and the [Morning](https://docs.pinto.money/resources/glossary#morning) Auction to support decimals for Maximum Temperature.
* Scale the current Maximum Temperature by `1e6` upon PI execution.

### 2. Soil Issuance Below Peg Changes <a href="#ba3e4019-aad5-83f5-92b1-01847c54278f" id="ba3e4019-aad5-83f5-92b1-01847c54278f"></a>

* Introduce a `scaleSoilBelowPeg` function in `Sun.sol` that scales the Soil issuance below peg according to the L2SR.
* Add a new evaluation parameter `belowPegSoilL2SRScalar` in storage that scales L2SR before applying the 99% cap.
* Initialize `belowPegSoilL2SRScalar` to `1e6` so this parameter has no additional effect on Soil issuance.
* Enforce a minimum Soil issued of 1% of `min(|TWAΔP|, |INSTΔP|)` when INSTΔP <= 0, before rounding. Soil issuance is zero when INSTΔP = 0.

### 3. Soil Issuance Above Peg Changes <a href="#id-1aee4019-aad5-8379-bb73-01eefb303b35" id="id-1aee4019-aad5-8379-bb73-01eefb303b35"></a>

* Add new evaluation parameters `soilCoefficientRelativelyHigh` and `soilCoefficientRelativelyLow` to storage for the Reasonably High and Reasonably Low Pod Rate categories, respectively.
* Instantiate the new parameters to `0.5e18` and `1e18`, respectively, alongside the existing coefficients, so Soil issuance above peg is scaled by:
  * 0.25 when the Pod Rate is Excessively High.
  * 0.5 when the Pod Rate is Reasonably High.
  * 1 when the Pod Rate is Reasonably Low.
  * 1.2 when the Pod Rate is Excessively Low. This now includes Excessively High price with increasing Soil demand, which previously used a coefficient of 1.

### 4. Soil Issuance Fix When INSTΔP > 0 and TWAΔP < 0 <a href="#e83e4019-aad5-83d7-9dbf-817b9b815eb1" id="e83e4019-aad5-83d7-9dbf-817b9b815eb1"></a>

* When `twaDeltaB < 0` and `instDeltaB > 0`, set the Soil supply to 1% of |TWAΔP|, scaled by:
  * 0.25 when the Pod Rate is Excessively High.
  * 0.5 when the Pod Rate is Reasonably High.
  * 1 when the Pod Rate is Reasonably Low.
  * 1.2 when the Pod Rate is Excessively Low.

### 5. Case Adjustment Changes <a href="#ad9e4019-aad5-821c-ba58-81acc87a76bc" id="ad9e4019-aad5-821c-ba58-81acc87a76bc"></a>

Update `s.sys.casesV2` with the new Maximum Temperature adjustments bolded on the right. Across all L2SR tiers with TWAΔP <= 0, change +1 to 0 percentage points for Reasonably Low Pod Rate with increasing Soil demand. For Reasonably or Excessively High Pod Rate, change +2, +1, and 0 to +1, +0.5, and −0.5 percentage points for decreasing, steady, and increasing Soil demand, respectively.

![](https://pinto.money/pi/5/pi5-cases-highlighted.png)

PI-5 as executed. The intended Crop Scalar decrease from −0.01 to −0.02 was implemented in PI-6.

### 6. Intended Crop Scalar Adjustment <a href="#id-425e4019-aad5-83fa-ab07-01834a8a4dca" id="id-425e4019-aad5-83fa-ab07-01834a8a4dca"></a>

The intended two-percentage-point decrease applied to Reasonably Low L2SR, Reasonably High price, and Reasonably or Excessively High Pod Rate. PI-5 installed constants that still encoded a one-percentage-point decrease. PI-6 corrected the encoding.

### 7. New Events <a href="#id-8fce4019-aad5-8396-8612-81559127dabe" id="id-8fce4019-aad5-8396-8612-81559127dabe"></a>

* Add `beans` to the `SeasonOfPlentyWell` event.
* Add the `SeasonMetrics` event to keep track of various metrics each Season.
* Add the `RainStatus` event to keep track of when the protocol starts or stops [Raining](https://docs.pinto.money/resources/glossary#rain).

```
event SeasonMetrics(
    uint256 indexed season,
    uint256 deltaPodDemand,
    uint256 lpToSupplyRatio,
    uint256 podRate,
    uint256 thisSowTime,
    uint256 lastSowTime
);

event RainStatus(uint256 indexed season, bool raining);
```

## Rationale <a href="#id-9b4e4019-aad5-83b5-85d8-81cde6089f3d" id="id-9b4e4019-aad5-83b5-85d8-81cde6089f3d"></a>

### 1. Maximum Temperature Decimals <a href="#id-9b7e4019-aad5-8234-b7cf-8177610e007c" id="id-9b7e4019-aad5-8234-b7cf-8177610e007c"></a>

Changing the Maximum Temperature by a minimum of 100 basis points does not allow the protocol to respond with a sufficiently high level of granularity. By changing the minimum change to .0001 basis points (or 0.000001%), the protocol will be well equipped to change the Maximum Temperature as it grows in complexity well into the future.

### 2. Soil Issuance Below Peg Changes <a href="#id-4b5e4019-aad5-827a-bf86-0191dfa6fbee" id="id-4b5e4019-aad5-827a-bf86-0191dfa6fbee"></a>

The protocol does not need to issue enough Soil to return the price to peg if all of it were [Sown](https://docs.pinto.money/resources/glossary#sow). Issuing less Soil each Season gives the market more time to respond in ways other than issuing debt (&#x65;*.g.*, via [Converts](https://docs.pinto.money/resources/glossary#convert), new [Deposits](https://docs.pinto.money/resources/glossary#deposit), etc).

When the L2SR is high and P < 1, the protocol [should ](https://bean.money/beanstalk-state-space.pdf)rely more heavily on Converts from LP tokens to Pinto to increase the price rather than issuing more debt. Scaling Soil when P < 1 by 1 - L2SR reflects this. At higher L2SR, the protocol marginally prefers sacrificing liquidity through LP → Pinto Converts than to issue additional debt. See the [Beanstalk State Space](https://bean.money/beanstalk-state-space.pdf) for the underlying liquidity/debt framework.

A minimum of 1% of min(|TWAΔP|, |INSTΔP|) when INSTΔP <= 0 caps the effect of the (1 - L2SR) scalar at 99%, before integer rounding. Soil can still be zero when the input is zero or rounding removes the remaining amount.

### 3. Soil Issuance Above Peg Changes <a href="#a02e4019-aad5-8380-bf88-01efde2b0a83" id="a02e4019-aad5-8380-bf88-01efde2b0a83"></a>

When TWAΔP > 0, the protocol issues debt in order to measure changing demand for Soil and to avoid entering a situation where the protocol has no outstanding debt. This Soil issuance is based on the number of Pods that became Harvestable at the beginning of the Season.

However, the protocol is aiming to reduce replacement debt with respect to the amount of Soil that it issues relative to the number of Pods that became Harvestable. This solution allows for greater granularity with respect to the ratio of how much Soil is issued relative to how many Pods became Harvestable, and lowers the ratio in two Pod Rate categories to reduce replacement debt. Applying 1.2 to the previously excluded case makes all Excessively Low Pod Rate cases use the same coefficient.

### 4. Soil Issuance Fix When INSTΔP > 0 and TWAΔP < 0 <a href="#id-4d2e4019-aad5-82d0-8951-010bece1fd3a" id="id-4d2e4019-aad5-82d0-8951-010bece1fd3a"></a>

Issuing |TWAΔP| Soil when INSTΔP > 0 and TWAΔP < 0 does not achieve the goal of minimizing Soil issuance when INSTΔP > 0. Instead, when INSTΔP > 0, the protocol should take a similar approach to how it issues Soil when TWAΔP > 0, (*i.e.*, issue enough Soil to measure changing demand).

However, because in this scenario no Pods became Harvestable at the beginning of the Season, the Soil issuance mechanic when TWAΔP > 0 cannot be used. By instead issuing 1% of | TWAΔP | scaled according to the same coefficients based on the Pod Rate when TWAΔP > 0, the protocol is able to issue enough Soil to measure demand while factoring in the Pod Rate and limiting additional debt issuance.

### 5. Case Adjustment Changes <a href="#id-462e4019-aad5-83f5-bcbc-81bad83b885b" id="id-462e4019-aad5-83f5-bcbc-81bad83b885b"></a>

If the protocol increases the Maximum Temperature too quickly, it can disincentivize prospective lenders to lend to the protocol by creating a greater potential benefit for them to lend to the protocol later on. By leveraging the new Maximum Temperature decimal precision to increase the Maximum Temperature more conservatively, the protocol can minimize the incentive to wait to lend to the protocol and decrease the overall rate at which the Maximum Temperature increases which will likely enable the protocol to more sustainably issue debt over time.

### 6. Intended Crop Scalar Adjustment <a href="#id-311e4019-aad5-8291-b92e-81645c2ec639" id="id-311e4019-aad5-8291-b92e-81645c2ec639"></a>

The intended faster decrease would favor LP over Pinto exposure in the selected cases. PI-5 did not realize that adjustment because its encoded constants were unchanged. The correction belongs to PI-6.

### 7. New Events <a href="#a40e4019-aad5-8265-8296-81c220b3bfe8" id="a40e4019-aad5-8265-8296-81c220b3bfe8"></a>

The added metrics and Rain transitions allow off-chain consumers to reconstruct Season state, while the added `beans` field records the number of Pinto minted to each [Well](https://docs.basin.exchange/components/well) during a Flood.

## Contract Changes <a href="#id-1c3e4019-aad5-83ec-9a5f-019066b0ff3d" id="id-1c3e4019-aad5-83ec-9a5f-019066b0ff3d"></a>

### Initialization <a href="#id-9d1e4019-aad5-82e8-a50a-812308a0c02b" id="id-9d1e4019-aad5-82e8-a50a-812308a0c02b"></a>

`InitPI5.init()` at [`0x78a9b261e59dd31d2f50230103d07e3e65bbe02b`](https://basescan.org/address/0x78a9b261e59dd31d2f50230103d07e3e65bbe02b#code) initialized the Soil scalars and Pod Rate coefficients, installed the V2 case table, and multiplied the stored Maximum Temperature by `1e6` to preserve its value at six-decimal precision.

### Facet Changes <a href="#id-5fae4019-aad5-82e2-a3dc-0199c6a16b16" id="id-5fae4019-aad5-82e2-a3dc-0199c6a16b16"></a>

| **Facet**             | **Action** | **Previous Implementation**                                                                                                  | **New Implementation**                                                                                                       |
| --------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `SeasonFacet`         | Replace    | [`0x15cBDFaF5715F2a1B6e23b3ef7c4D67843a6C836`](https://basescan.org/address/0x15cBDFaF5715F2a1B6e23b3ef7c4D67843a6C836#code) | [`0xFC52fC3C8a29F74603006fF03915770014D9F049`](https://basescan.org/address/0xFC52fC3C8a29F74603006fF03915770014D9F049#code) |
| `FieldFacet`          | Replace    | [`0x0Ab2b647Fdfaa3Abffca2a10fe78Eb0dED438fAf`](https://basescan.org/address/0x0Ab2b647Fdfaa3Abffca2a10fe78Eb0dED438fAf#code) | [`0x8906b9131B7c6354f3e14b8656B546CfCfc9eDF1`](https://basescan.org/address/0x8906b9131B7c6354f3e14b8656B546CfCfc9eDF1#code) |
| `GaugeGettersFacet`   | Replace    | [`0x34eaa05624E0B8cFAB251571E429fD88Cec7ec12`](https://basescan.org/address/0x34eaa05624E0B8cFAB251571E429fD88Cec7ec12#code) | [`0x04912D77F69Bd03f8846A432B0AbacfC028bea33`](https://basescan.org/address/0x04912D77F69Bd03f8846A432B0AbacfC028bea33#code) |
| `SeasonGettersFacet`  | Replace    | [`0x995E1cA9Bd858bff94448dCC0E097bd4d564e74B`](https://basescan.org/address/0x995E1cA9Bd858bff94448dCC0E097bd4d564e74B#code) | [`0xFA0093b9CA5D00c9E6623767eb09489d90aBF150`](https://basescan.org/address/0xFA0093b9CA5D00c9E6623767eb09489d90aBF150#code) |
| `SeasonGettersFacet`  | Add        | Not applicable — new selectors                                                                                               | [`0xFA0093b9CA5D00c9E6623767eb09489d90aBF150`](https://basescan.org/address/0xFA0093b9CA5D00c9E6623767eb09489d90aBF150#code) |
| `ConvertGettersFacet` | Replace    | [`0xb70708268fff1b6038dEf6F7d29a3bEe037e901c`](https://basescan.org/address/0xb70708268fff1b6038dEf6F7d29a3bEe037e901c#code) | [`0x115E83Bcb217A06D13210009e7CD8b44cE1af509`](https://basescan.org/address/0x115E83Bcb217A06D13210009e7CD8b44cE1af509#code) |
| `SiloGettersFacet`    | Replace    | [`0x6aBFE707418D80a6E06b77853ED6c098B8aF6711`](https://basescan.org/address/0x6aBFE707418D80a6E06b77853ED6c098B8aF6711#code) | [`0x6C1dc649E93be43FfF670a2407Fa4Edc4996BB95`](https://basescan.org/address/0x6C1dc649E93be43FfF670a2407Fa4Edc4996BB95#code) |

### Other Contract / Parameter Changes <a href="#e4ce4019-aad5-83a0-901e-01448df063dd" id="e4ce4019-aad5-83a0-901e-01448df063dd"></a>

Maximum Temperature storage and case adjustments moved from whole percentage points to six decimal places. The initializer rescaled existing Temperature without changing its economic value.

Initialized `belowPegSoilL2SRScalar` to `1e6` (1) and `abovePegDeltaBSoilScalar` to `0.01e6` (1%). Above-target Soil coefficients changed from 0.5 to 0.25 for Excessively High Pod Rate and from 1 to 0.5 for Reasonably High Pod Rate. Reasonably Low remained 1 and the configured Excessively Low coefficient remained 1.2, as set by PI-3.

**External Library Deployments**

All seven linked libraries were redeployed. `LibEvaluate`, `LibWellMinting`, and `LibFlood` changed their own source files. `LibGauge`, `LibIncentive`, `LibShipping`, and `LibGerminate` did not. `FieldFacet`, `GaugeGettersFacet`, `ConvertGettersFacet`, and `SiloGettersFacet` have no externally linked libraries. `GaugeGettersFacet`, `ConvertGettersFacet`, and `SiloGettersFacet` retained their own source files and getter interfaces despite their replacement.

| Library          | Previous Implementation                                                                                                      | New Implementation                                                                                                           | Used By                           |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| `LibEvaluate`    | [`0x595eb8aa763325235f988eedc582d74046fd7bca`](https://basescan.org/address/0x595eb8aa763325235f988eedc582d74046fd7bca#code) | [`0x69c7d1feb4b963ff9b8338a765c13bb5c3b19792`](https://basescan.org/address/0x69c7d1feb4b963ff9b8338a765c13bb5c3b19792#code) | `SeasonFacet`                     |
| `LibGauge`       | [`0xe7e55a27a369bef6d20dd081ff7ddff90d6f7482`](https://basescan.org/address/0xe7e55a27a369bef6d20dd081ff7ddff90d6f7482#code) | [`0x07b75f35e90eb114035d3c67ac7738f11fb70a26`](https://basescan.org/address/0x07b75f35e90eb114035d3c67ac7738f11fb70a26#code) | `SeasonFacet`                     |
| `LibIncentive`   | [`0xfe1fe5508b33401c20e45fcd10161783de443479`](https://basescan.org/address/0xfe1fe5508b33401c20e45fcd10161783de443479#code) | [`0x4e5dae995c2e8eef23b44a95034064262326e703`](https://basescan.org/address/0x4e5dae995c2e8eef23b44a95034064262326e703#code) | `SeasonFacet`                     |
| `LibShipping`    | [`0x86c9bdf4b2a7ab22c90048f0d741b81c546895b7`](https://basescan.org/address/0x86c9bdf4b2a7ab22c90048f0d741b81c546895b7#code) | [`0x6ccdfc6fd7885a07e5d4ee5e998a66afe6a65705`](https://basescan.org/address/0x6ccdfc6fd7885a07e5d4ee5e998a66afe6a65705#code) | `SeasonFacet`                     |
| `LibWellMinting` | [`0x4e81e73a1ca24ff99a79914a887d13b9c641e2f2`](https://basescan.org/address/0x4e81e73a1ca24ff99a79914a887d13b9c641e2f2#code) | [`0xd972df7cfd286778951aa829a40e9ab7f7db1d5a`](https://basescan.org/address/0xd972df7cfd286778951aa829a40e9ab7f7db1d5a#code) | `SeasonFacet, SeasonGettersFacet` |
| `LibFlood`       | [`0x249ae0deb8f7ebccaa574c7396c7d099d87e7e3d`](https://basescan.org/address/0x249ae0deb8f7ebccaa574c7396c7d099d87e7e3d#code) | [`0x0b316cb760a677ed1c581041c7d2118bc66aa87c`](https://basescan.org/address/0x0b316cb760a677ed1c581041c7d2118bc66aa87c#code) | `SeasonFacet`                     |
| `LibGerminate`   | [`0x7c748262b168e85a5e0973021e44b163fcb578d9`](https://basescan.org/address/0x7c748262b168e85a5e0973021e44b163fcb578d9#code) | [`0x636234f909174c764d216ef9bd22175f01a107b2`](https://basescan.org/address/0x636234f909174c764d216ef9bd22175f01a107b2#code) | `SeasonFacet`                     |

### Function Changes <a href="#bd6e4019-aad5-82c6-a5de-812c24840477" id="bd6e4019-aad5-82c6-a5de-812c24840477"></a>

* Updated `LibCases` encoding/decoding, `Weather.updateTemperature()`, and `LibDibbler` calculations to use six-decimal Temperature precision. `FieldFacet.maxTemperature()` returns the stored scaled value. `totalSoil()` uses that value in above-peg Morning scaling without multiplying it again.
* Changed `getChangeFromCaseId(uint256)` to return an `int32 bT` instead of `int8`. Its other outputs remain `mT`, `mL`, and `bL`. Changed `getAbsTemperatureChangeFromCaseId(uint256)` to return the six-decimal signed Temperature adjustment as `int32`.
* Added `LibWellMinting.getTotalInstantaneousDeltaB()` to sum instantaneous `deltaB` across whitelisted Wells, and `totalInstantaneousDeltaB()` as its external getter.
* Updated `LibEvaluate.evaluateBeanstalk()` and `calcCaseIdAndHandleRain()` to return the evaluated state alongside the case ID, allowing `stepSun()` to use the computed L2SR. These are shared internal/library changes, not new diamond entry points.
* Added the internal `scaleSoilBelowPeg()` helper and updated `stepSun()` to issue `min(|TWAΔP|, |INSTΔP|) × (1 − min(L2SR, 0.99))` when both deltas are nonpositive, subject to integer rounding. `setSoil()` stores the result in `s.sys.soil`. At INSTΔP = 0, issuance becomes zero instead of the previous |TWAΔP|.
* Added `getExtEvaluationParameters()`, which returns the new Soil-scaling parameters.
* Added the internal `scaleSoilAbovePeg()` helper to apply four Pod Rate coefficients. The 1.2 coefficient now also applies when `caseId % 36 = 8`, which previously used 1. For positive TWAΔP, `setSoilAbovePeg()` scales the Soil corresponding to newly Harvestable Pods. For nonpositive TWAΔP and positive INSTΔP, `stepSun()` instead scales 1% of |TWAΔP|.
* Updated `LibCases.setCasesV2()` with lower Temperature adjustments in the selected nonpositive-TWAΔP cases. The intended Crop Scalar constants still encoded `−1e18` rather than `−2e18` in PI-5.

### Event Changes <a href="#f15e4019-aad5-827c-b82e-01dc9ed8700e" id="f15e4019-aad5-827c-b82e-01dc9ed8700e"></a>

* Changed `TemperatureChange.absChange` from `int8` to `int32` and emitted it in six-decimal Temperature units.
* Added `SeasonMetrics(season, deltaPodDemand, lpToSupplyRatio, podRate, thisSowTime, lastSowTime)` to expose the state used during evaluation. The Sow-time fields reflect storage after the times are updated.
* Added `RainStatus(season, raining)` when Rain starts or stops.
* Added the `beans` field to `SeasonOfPlentyWell`, recording Pinto minted to the Well separately from the existing number of output tokens received.
