> 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-8.md).

# PI-8: Misc. Efficiency Improvements

Executed on April 17, 2025 at 19:23 UTC.

## Summary <a href="#id-937e4019-aad5-83d6-9942-01bbf7d7750c" id="id-937e4019-aad5-83d6-9942-01bbf7d7750c"></a>

1. **Maximum** [**Crop Ratio**](https://docs.pinto.money/resources/glossary#crop-ratio) **Increase:** Increase the Maximum Crop Ratio from 150% to 200%.
2. **Extremely High** [**Pod Rate**](https://docs.pinto.money/resources/glossary#pod-rate) **Level:** Introduce a new Extremely High Pod Rate level, set the threshold above which the Pod Rate is considered Extremely High to 100%, and set the [Maximum Temperature](https://docs.pinto.money/resources/glossary#maximum-temperature) adjustments for the Extremely High Pod Rate cases.
3. **Demand for** [**Soil**](https://docs.pinto.money/resources/glossary#soil) **Measurement Update:** Update the mechanism for measuring demand for Soil when Soil is sold out over the previous two [Seasons](https://docs.pinto.money/resources/glossary#season).
4. **Demand for Soil Measurement Threshold:** Add a minimum threshold of 25 [Pinto](https://docs.pinto.money/resources/glossary#pinto) for how much Soil must be [Sown](https://docs.pinto.money/resources/glossary#sow) in order to measure demand for Soil.
5. **On-Chain** [**Deposit**](https://docs.pinto.money/resources/glossary#deposit) **Sorting:** Add helper functions for sorting Deposits on-chain.
6. [**Tractor**](https://docs.pinto.money/pinto-mechanics/toolshed/tractor-automating-the-farm) **Helper Functions:** Add Tractor execution helpers, caller-context views and operator controls to support more expressive [Blueprints](https://docs.pinto.money/pinto-mechanics/toolshed/tractor-automating-the-farm#enter-tractor).
7. **Interface and Event Updates:** Update parameter-setting compatibility and conversion-penalty event data for integrations.

## Links <a href="#id-89de4019-aad5-830b-81b9-01c7705704de" id="id-89de4019-aad5-830b-81b9-01c7705704de"></a>

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

## Problems <a href="#bd9e4019-aad5-8330-92e3-01b1bdeb10ab" id="bd9e4019-aad5-8330-92e3-01b1bdeb10ab"></a>

### 1. Maximum Crop Ratio Increase <a href="#ef2e4019-aad5-82ad-86cd-0175906f3d9e" id="ef2e4019-aad5-82ad-86cd-0175906f3d9e"></a>

The recent increase of the Maximum Crop Ratio from 100% to 150% did not sufficiently change the ability for the protocol to incentivize Depositors to [Convert](https://docs.pinto.money/resources/glossary#convert) LP to Pinto.

### 2. Extremely High Pod Rate Level <a href="#id-9f2e4019-aad5-8383-ba42-81bda0402f00" id="id-9f2e4019-aad5-8383-ba42-81bda0402f00"></a>

The protocol did not have a way to distinguish how it changes the Maximum Temperature when the protocol has a Pod Rate that is high but not so high that it is a potential threat to the long term health of the protocol, and when it is.

### 3. Demand for Soil Measurement Update <a href="#id-71ce4019-aad5-8290-a61a-81b26653efd4" id="id-71ce4019-aad5-8290-a61a-81b26653efd4"></a>

With the introduction of the [Cultivation System](https://docs.pinto.money/pinto-mechanics/field-the-most-innovative-lending-facility-in-crypto/the-cultivation-system-optimal-soil-issuance), the protocol regularly was in the circumstance where the number of Soil issued from Season to Season was very different, such that the existing method to measure changes in demand for Soil in instances where the Soil sold out last Season no longer worked.

### 4. Demand for Soil Measurement Threshold <a href="#id-74be4019-aad5-83a8-bddf-819c2fd9fcf2" id="id-74be4019-aad5-83a8-bddf-819c2fd9fcf2"></a>

Demand for Soil was highly manipulable with very little capital due to the lack of a minimum number of Pinto that must be Sown in order to measure demand.

### 5. On-Chain Deposit Sorting <a href="#id-125e4019-aad5-82b3-8f5e-812d812898c6" id="id-125e4019-aad5-82b3-8f5e-812d812898c6"></a>

The inability to sort a user's Deposits on-chain led to inefficient execution when [Withdrawing](https://docs.pinto.money/resources/glossary#withdraw) a user's Deposits with the lowest [Mown](https://docs.pinto.money/resources/glossary#mow) [Stalk](https://docs.pinto.money/resources/glossary#stalk) per [PDV](https://docs.pinto.money/resources/glossary#pinto-denominated-value-pdv) for Tractor operations.

### 6. Tractor Helper Functions <a href="#id-1bee4019-aad5-835d-8a34-0134f8386eed" id="id-1bee4019-aad5-835d-8a34-0134f8386eed"></a>

Expressive Blueprints were difficult to implement given the existing set of view functions and events for Tractor metadata.

### 7. Interface and Event Updates <a href="#id-3dfe4019-aad5-82ae-9457-81ebc52d6ffe" id="id-3dfe4019-aad5-82ae-9457-81ebc52d6ffe"></a>

The parameter-setting interface used an older tuple signature that omitted the existing rain-related [Crop Scalar](https://docs.pinto.money/responding-to-state/crop-ratio-changes) setting. Conversion-penalty events reported only the Stalk lost, without identifying the account or the [Grown Stalk](https://docs.pinto.money/resources/glossary#grown-stalk) retained.

## Solutions <a href="#id-2f8e4019-aad5-82fb-8767-01c8ce75c7f8" id="id-2f8e4019-aad5-82fb-8767-01c8ce75c7f8"></a>

### 1. Maximum Crop Ratio Increase <a href="#dc8e4019-aad5-826c-89e8-81009e2eca9f" id="dc8e4019-aad5-826c-89e8-81009e2eca9f"></a>

Update `s.sys.evaluationParameters.maxBeanMaxLpGpPerBdvRatio` from `150e18` to `200e18`.

### 2. Extremely High Pod Rate Level <a href="#id-970e4019-aad5-831a-9db2-818b8bf699b9" id="id-970e4019-aad5-831a-9db2-818b8bf699b9"></a>

Create a new Extremely High Pod Rate threshold and set it to 100%. Apply the new Extremely High Pod Rate Maximum Temperature adjustments only when the Pod Rate exceeds 100% and [TWAΔP](https://docs.pinto.money/resources/glossary#deltap) < 0.

![](https://hackmd.io/_uploads/HJThsAy1ee.png)

### 3. Demand for Soil Measurement Update <a href="#d8be4019-aad5-8240-8bc7-015d02afed73" id="d8be4019-aad5-8240-8bc7-015d02afed73"></a>

Update the method to measure changing demand for Soil as follows.

After the 25-Pinto minimum is met, a sellout in less than 20 minutes, more than 5 minutes faster than the prior sellout, or following a Season without a sellout means increasing demand. Otherwise, sellouts within 5 minutes of the prior sellout mean increasing demand if at least 5% more Soil was Sown, and steady demand otherwise. A sellout more than 5 minutes slower uses the change in number of Soil Sown. Seasons without a sellout also use that comparison of the number of Soil Sown.

The diagram below assumes consecutive sellouts, at least 25 Pinto Sown, and a sellout time of at least 20 minutes. Its time boundaries are 5 minutes faster or slower, and its quantity boundaries are 95% and 105% of the prior Season’s Soil Sown.

![](https://pinto.money/pi/8/image.png)

If Soil did not sell out last Season but sold out the Season prior, the protocol compares the number of Soil sold across the two previous Seasons.

### 4. Demand for Soil Measurement Threshold <a href="#id-0b6e4019-aad5-8309-a1b9-01f070dcfc1a" id="id-0b6e4019-aad5-8309-a1b9-01f070dcfc1a"></a>

Set the minimum number of Pinto that must be Sown in a Season in order for demand for Soil to be measured – and thus not considered decreasing – to 25.

### 5. On-Chain Deposit Sorting <a href="#id-0c3e4019-aad5-8233-8a4d-819e6a72ba4c" id="id-0c3e4019-aad5-8233-8a4d-819e6a72ba4c"></a>

Add a function that allows anyone to validate and store a [Farmer](https://docs.pinto.money/resources/glossary#farmers)'s supplied Deposit ordering for one token (`depositIdList`) in ascending Stem order (descending Mown Stalk per PDV) (*i.e.*, the Deposit with the lowest Mown Stalk per PDV is at the last index in the list).

### 6. Tractor Helper Functions <a href="#id-3ace4019-aad5-830e-9531-813cc3eded37" id="id-3ace4019-aad5-830e-9531-813cc3eded37"></a>

Add external contracts to support the Tractor ecosystem. `TractorHelpers` provides `getSortedDeposits` (descending Stem) and `getSortedWhitelistedTokensBySeeds` (descending Seeds). Their deployment addresses are listed under [Other Contract / Parameter Changes](https://pinto.money/pi/8//pi/8/).

Egis reviewed the Sow Blueprint and supporting `SiloHelpers`, `PriceManipulation`, `PerFunctionPausable` and `OperatorWhitelist` contracts (final audit report [here](https://arweave.net/W7cfGzLVsTAEb65AR4wYfFLOl5Nm3EMy0Sg3Dk7C7e0)). The report identifies review commit [c9eb6ff25dd0ae87d454ab4e5b719af3ca402f72](https://github.com/pinto-org/protocol/commit/c9eb6ff25dd0ae87d454ab4e5b719af3ca402f72) and resolution commit [378c67ea1dcfdd184a227c24a42dc81f8ff136cb](https://github.com/pinto-org/protocol/commit/378c67ea1dcfdd184a227c24a42dc81f8ff136cb). It does not include `BeanstalkPrice` or attest to the exact deployed bytecode listed here.

### 7. Interface and Event Updates <a href="#id-7cce4019-aad5-8277-a8e6-81a4d0b2cde0" id="id-7cce4019-aad5-8277-a8e6-81a4d0b2cde0"></a>

Update the parameter-setting interface to include the existing rain-related Crop Scalar setting. Expand conversion-penalty events to identify the account and report both Grown Stalk lost and Grown Stalk retained.

## Rationale <a href="#id-5b6e4019-aad5-8268-a717-0174a8fbc9ac" id="id-5b6e4019-aad5-8268-a717-0174a8fbc9ac"></a>

### 1. Maximum Crop Ratio Increase <a href="#id-86de4019-aad5-82e9-8f1e-81560e596a46" id="id-86de4019-aad5-82e9-8f1e-81560e596a46"></a>

The protocol can incentivize LP -> Pinto Converts by awarding more [Seeds](https://docs.pinto.money/resources/glossary#seeds) to Pinto Deposits. The recent change of the Maximum Crop Ratio from 100% to 150% marked the first time the protocol was willing to offer more Seeds to Pinto Deposits than to any LP Deposit. However, this change was insufficient to incentivize enough LP -> Pinto Converts to consistently return the Pinto price to its value target. Increasing the Maximum Crop Ratio further to 200% may improve the ability of the protocol to return the Pinto price to its value target.

### 2. Extremely High Pod Rate Level <a href="#id-020e4019-aad5-82b4-ac58-812a8a59986e" id="id-020e4019-aad5-82b4-ac58-812a8a59986e"></a>

Before PI-8, the protocol had an Excessively High Pod Rate threshold, above which the protocol treated all Pod Rates the same. However, given the fact that the Excessively High Pod Rate threshold is still generally at a low and healthy Pod Rate, it is suboptimal for the protocol to treat all Pod Rates above that threshold identically. Introducing an Extremely High Pod Rate threshold solves this problem.

Setting the Extremely High Pod Rate threshold at 100% is a sufficiently high Pod Rate such that when the protocol has a higher Pod Rate, it should act more conservatively with respect to changes in the Maximum Temperature.

### 3. Demand for Soil Measurement Update <a href="#id-6d3e4019-aad5-837a-956d-81de306bc37b" id="id-6d3e4019-aad5-837a-956d-81de306bc37b"></a>

The examples below assume at least 25 Pinto were Sown and the sellout took at least 20 minutes. Similar sellout times are within 5 minutes of one another. A similar number of Soil means at least 95% but less than 105% of the prior Season’s number.

If Soil sold out in consecutive Seasons and sold out more than 5 minutes faster the second Season, demand for Soil should be considered increasing.

If Soil sold out in consecutive Seasons and at least 5% more Soil was sold the second Season, demand for Soil should be considered increasing.

If Soil sold out in consecutive Seasons and the time it took to sell out was similar and the number of Soil sold was similar, demand for Soil should be considered steady.

If Soil sold out in consecutive Seasons and the time it took to sell out was similar but the number of Soil sold out was less, demand for Soil should be considered steady because the number of Soil sold being less was a function of the protocol being willing to issue less Soil due to a significant change in TWA∆P, not there necessarily being less demand for Soil. Thus, time is a better proxy for changing demand for Soil than number of Soil sold.

If Soil sold out in consecutive Seasons and it took longer to sell out and there was a similar number of Soil sold, demand for Soil should be considered steady. This is because even though Soil took longer to sell out the second Season, if the same number of Soil was sold but Soil didn't sell out, demand for Soil would be considered steady. It would be incoherent for the protocol to consider demand for Soil to be decreasing if it sold out, but steady if it didn't sell out given the same amount of time and number of Soil sold.

If Soil sold out in consecutive Seasons and it took more than 5 minutes longer to sell out and more than 5% less Soil was sold, demand for Soil should be considered decreasing.

If Soil sold out two Seasons ago but did not sell out last Season, it makes sense for the protocol only to consider the number of Soil sown because it is possible that more Soil was sown but it didn't sell out because the increase in the [Cultivation Factor](https://docs.pinto.money/pinto-mechanics/field-the-most-innovative-lending-facility-in-crypto/the-cultivation-system-optimal-soil-issuance) resulted in a significant increase in the number of Soil available. By checking the number of Soil sown the protocol can accurately measure changing demand over the previous two Seasons.

### 4. Demand for Soil Measurement Threshold <a href="#id-4bee4019-aad5-8397-94dd-819f2934607e" id="id-4bee4019-aad5-8397-94dd-819f2934607e"></a>

The introduction of a minimum threshold below which demand for Soil is always decreasing raises the minimum number of Pinto required to influence the demand for Soil measurement. Previously, the measurement could be influenced essentially for the cost of gas. The new threshold requires at least 25 Pinto to be Sown before demand can be steady or increasing.

### 5. On-Chain Deposit Sorting <a href="#b9ee4019-aad5-83d7-bbc6-810cb24669ba" id="b9ee4019-aad5-83d7-bbc6-810cb24669ba"></a>

Pinto stores a list of Deposits that the farmer owns on chain. An on chain list allows Smart Contracts to access the value a given farmer owns, without using indexing services. The Deposit list does not enforce any sorting rules when adding/removing entries. By having an optional function that allows anyone to validate and store a supplied ordering in descending order in terms of Mown Stalk per PDV in a permissionless fashion (which in PI-8 updated the ordered array but not its index mapping), smart contracts can more easily find the Deposits with the lowest Mown Stalk per PDV in a gas efficient fashion.

`TractorHelpers` traverses the stored Deposit list backward in order to use the Deposits with the lowest Mown Stalk per PDV in the Sow Orderbook. This ordering depends on the stored list being sorted in ascending Stem order.

### 6. Tractor Helper Functions <a href="#id-0b3e4019-aad5-820d-ac15-81d98e2585f5" id="id-0b3e4019-aad5-820d-ac15-81d98e2585f5"></a>

Shared withdrawal-planning and caller-context helpers let Blueprints coordinate Deposits, operators and token transfers without duplicating that logic. Explicit execution metadata also makes Tractor activity easier for integrations to identify.

### 7. Interface and Event Updates <a href="#id-379e4019-aad5-83c9-8714-810ac37dbc88" id="id-379e4019-aad5-83c9-8714-810ac37dbc88"></a>

Including the existing rain-related setting in the parameter tuple keeps the administrative interface aligned with stored configuration. Identifying the account and retained Grown Stalk in conversion-penalty events gives indexers the context needed to interpret each penalty.

## Contract Changes <a href="#a67e4019-aad5-8209-a2bb-81822c0ae180" id="a67e4019-aad5-8209-a2bb-81822c0ae180"></a>

### Initialization <a href="#fbfe4019-aad5-8375-a148-0171aa8027a8" id="fbfe4019-aad5-8375-a148-0171aa8027a8"></a>

`InitPI8.init()` at [`0xeb393ee29335d6f75cbadbddbd115553e275bb3c`](https://basescan.org/address/0xeb393ee29335d6f75cbadbddbd115553e275bb3c#code) set `minSoilSownDemand` from `0` to `25e6` (25 Pinto per Season) and `maxBeanMaxLpGpPerBdvRatio` from `150e18` to `200e18` (150% to 200%). It rescaled the existing Crop Scalar to approximately preserve the Crop Ratio, then rounded the scalar down to whole percentage points.

### Facet Changes <a href="#ca7e4019-aad5-83b4-84a5-818884c5961a" id="ca7e4019-aad5-83b4-84a5-818884c5961a"></a>

The executed diamond cut replaced 17 facets, added eight selectors and removed the prior `updateSeedGaugeSettings` selector. Replacing a facet does not mean every function in that facet changed.

| Facet                  | Action                 | Previous Implementation                                                                                                      | New Implementation                                                                                                           |
| ---------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `SiloFacet`            | Add / Replace          | [`0xd2d3d44edbbc66ef90b29627dfd0a06d3ca0cad4`](https://basescan.org/address/0xd2d3d44edbbc66ef90b29627dfd0a06d3ca0cad4#code) | [`0xd954a3245a868ab3e991786d4e5e71892099a19d`](https://basescan.org/address/0xd954a3245a868ab3e991786d4e5e71892099a19d#code) |
| `SiloGettersFacet`     | Add / Replace          | [`0xa66113be17098b2594aba1614055fcc31b3abd67`](https://basescan.org/address/0xa66113be17098b2594aba1614055fcc31b3abd67#code) | [`0x6f9a49560a1db78cd32f1332e15fcaedc77aa66b`](https://basescan.org/address/0x6f9a49560a1db78cd32f1332e15fcaedc77aa66b#code) |
| `ConvertFacet`         | Replace                | [`0x1f421ec312c60f9f6e9f6f79e0e56f496ae27e4e`](https://basescan.org/address/0x1f421ec312c60f9f6e9f6f79e0e56f496ae27e4e#code) | [`0x1af9097b043e26f41d082c5adb89cd606528e526`](https://basescan.org/address/0x1af9097b043e26f41d082c5adb89cd606528e526#code) |
| `PipelineConvertFacet` | Replace                | [`0x7a28dfd0e5bbf281e0a853bfeb4609ff093d0bd1`](https://basescan.org/address/0x7a28dfd0e5bbf281e0a853bfeb4609ff093d0bd1#code) | [`0xf26ab0c4a354f12c9e8fa86c423f463e2c72ddd8`](https://basescan.org/address/0xf26ab0c4a354f12c9e8fa86c423f463e2c72ddd8#code) |
| `TractorFacet`         | Add / Replace          | [`0xd06128e88b7b84c214c400b86ca17770813567cf`](https://basescan.org/address/0xd06128e88b7b84c214c400b86ca17770813567cf#code) | [`0x007a0b3bf5a9efc922e83bf0ebe7bf27fc2103bf`](https://basescan.org/address/0x007a0b3bf5a9efc922e83bf0ebe7bf27fc2103bf#code) |
| `FieldFacet`           | Add / Replace          | [`0x8906b9131b7c6354f3e14b8656b546cfcfc9edf1`](https://basescan.org/address/0x8906b9131b7c6354f3e14b8656b546cfcfc9edf1#code) | [`0x0b5888a4c6fb90d26fb4d5f782d45c9e86dcc974`](https://basescan.org/address/0x0b5888a4c6fb90d26fb4d5f782d45c9e86dcc974#code) |
| `ApprovalFacet`        | Replace                | [`0x65d67f299a4ad1cff49a6c77a2fb463a86643ab4`](https://basescan.org/address/0x65d67f299a4ad1cff49a6c77a2fb463a86643ab4#code) | [`0x61b9a20a5fc4a9965c2309c2feff56b5ebe855cd`](https://basescan.org/address/0x61b9a20a5fc4a9965c2309c2feff56b5ebe855cd#code) |
| `ConvertGettersFacet`  | Replace                | [`0xfbad01d4c722b0850444dd63dc273ad2c1c0d321`](https://basescan.org/address/0xfbad01d4c722b0850444dd63dc273ad2c1c0d321#code) | [`0xe0b8fca80b1a7060fea44c6f823b221ec9d7217c`](https://basescan.org/address/0xe0b8fca80b1a7060fea44c6f823b221ec9d7217c#code) |
| `GaugeFacet`           | Replace                | [`0x55c0e1643e70f9fb7eeb8c640a303ad9de263302`](https://basescan.org/address/0x55c0e1643e70f9fb7eeb8c640a303ad9de263302#code) | [`0x42575b2f01d18cf3ed670c9fe82ee90332739d03`](https://basescan.org/address/0x42575b2f01d18cf3ed670c9fe82ee90332739d03#code) |
| `GaugeGettersFacet`    | Replace                | [`0x07d6edb2e4afad408beadaaf30bc21b8f804d1f7`](https://basescan.org/address/0x07d6edb2e4afad408beadaaf30bc21b8f804d1f7#code) | [`0x0f97cb8bb44d3d7a0afaeac24bbfe152215e3c5a`](https://basescan.org/address/0x0f97cb8bb44d3d7a0afaeac24bbfe152215e3c5a#code) |
| `SeasonFacet`          | Replace                | [`0x5d1f0c38835a0fb55b5df11341ae217f1f8a01da`](https://basescan.org/address/0x5d1f0c38835a0fb55b5df11341ae217f1f8a01da#code) | [`0x5545a4ab5cd3f6e7db0883e73ea4805f6e1270a9`](https://basescan.org/address/0x5545a4ab5cd3f6e7db0883e73ea4805f6e1270a9#code) |
| `SeasonGettersFacet`   | Replace                | [`0xab2a1bc987e64c4be13ffb090b01a5888a345c9e`](https://basescan.org/address/0xab2a1bc987e64c4be13ffb090b01a5888a345c9e#code) | [`0xebaa2c95efc7f1cef1a57dfb5fe05f8935d7390e`](https://basescan.org/address/0xebaa2c95efc7f1cef1a57dfb5fe05f8935d7390e#code) |
| `TokenFacet`           | Replace                | [`0x8ab92619de059d8777822e022baaf546a614753d`](https://basescan.org/address/0x8ab92619de059d8777822e022baaf546a614753d#code) | [`0x7f492edcd56335b2d2aee29dfe39df33bbe43bb8`](https://basescan.org/address/0x7f492edcd56335b2d2aee29dfe39df33bbe43bb8#code) |
| `TokenSupportFacet`    | Replace                | [`0xd2d6808a2b669723abc669ba5b5d79a871734415`](https://basescan.org/address/0xd2d6808a2b669723abc669ba5b5d79a871734415#code) | [`0x9d214daf535396d515d93831fc7fe5fa137b4f30`](https://basescan.org/address/0x9d214daf535396d515d93831fc7fe5fa137b4f30#code) |
| `MarketplaceFacet`     | Replace                | [`0x1fbdebc461857d5d8306a64b199ff84975dfc6f8`](https://basescan.org/address/0x1fbdebc461857d5d8306a64b199ff84975dfc6f8#code) | [`0x1f4504295c5bd57cdbd8caf4df9ab13381cb0ad4`](https://basescan.org/address/0x1f4504295c5bd57cdbd8caf4df9ab13381cb0ad4#code) |
| `ClaimFacet`           | Replace                | [`0x8738f66d4a0431b084b7ff8f59097312a5b5531f`](https://basescan.org/address/0x8738f66d4a0431b084b7ff8f59097312a5b5531f#code) | [`0x44df048857445cd8cba3b8cc26132816d827ff14`](https://basescan.org/address/0x44df048857445cd8cba3b8cc26132816d827ff14#code) |
| `WhitelistFacet`       | Add / Replace / Remove | [`0x45ee6286468f2b1406915446913b744db5a4c5d2`](https://basescan.org/address/0x45ee6286468f2b1406915446913b744db5a4c5d2#code) | [`0xaaca4a18ddad39fb3a2441ff279afde06bd61b62`](https://basescan.org/address/0xaaca4a18ddad39fb3a2441ff279afde06bd61b62#code) |

### Other Contract / Parameter Changes <a href="#id-6f3e4019-aad5-82b2-944d-81eeb82f7d74" id="id-6f3e4019-aad5-82b2-944d-81eeb82f7d74"></a>

| Supporting Contract | New Deployment                                                                                                               |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `BeanstalkPrice`    | [`0x13D25ABCB6a19948d35654715c729c6501230b49`](https://basescan.org/address/0x13D25ABCB6a19948d35654715c729c6501230b49#code) |
| `PriceManipulation` | [`0x774c111F471FBa61B13D63C9B585882e3c6cf7A6`](https://basescan.org/address/0x774c111F471FBa61B13D63C9B585882e3c6cf7A6#code) |
| `OperatorWhitelist` | [`0xF4ee12763976C3025194ef0E272a8390164Cc18f`](https://basescan.org/address/0xF4ee12763976C3025194ef0E272a8390164Cc18f#code) |
| `TractorHelpers`    | [`0x2808b14d287F8CA77eb25B16575aF187d5A05119`](https://basescan.org/address/0x2808b14d287F8CA77eb25B16575aF187d5A05119#code) |
| `SowBlueprintv0`    | [`0xbb0a41927895F8ca2b4ECCc659ba158735fCF28B`](https://basescan.org/address/0xbb0a41927895F8ca2b4ECCc659ba158735fCF28B#code) |

The table below lists the externally linked libraries recorded in the previous and new deployed facet metadata. Shared dependencies are deduplicated. `LibSilo` and `LibTokenSilo` each had two previous deployments, identified by their consuming facets. The other replaced facets had no externally linked library dependencies. Address changes do not imply that every library function changed. The final row records the additional library linked by the supporting `TractorHelpers` deployment.

| Library              | Previous Implementation                                                                                                                                                                                                                                                                                                                                                                                                          | New Implementation                                                                                                           | Used By                                                           |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| `LibSilo`            | <p><a href="https://basescan.org/address/0x5a686e6024d1d40994ae99979ceb63bf67724b04#code"><code>0x5a686e6024d1d40994ae99979ceb63bf67724b04</code></a> (<code>SiloFacet</code>)<br><a href="https://basescan.org/address/0xf5daf4e2ca77cf48f4ec17d10f0b48a8c2ca9e5c#code"><code>0xf5daf4e2ca77cf48f4ec17d10f0b48a8c2ca9e5c</code></a> (<code>ConvertFacet</code>, <code>PipelineConvertFacet</code>, <code>ClaimFacet</code>)</p> | [`0x49bfc93e96d467d79fc809c8f6da466f8ebb8975`](https://basescan.org/address/0x49bfc93e96d467d79fc809c8f6da466f8ebb8975#code) | `SiloFacet`, `ConvertFacet`, `PipelineConvertFacet`, `ClaimFacet` |
| `LibTokenSilo`       | <p><a href="https://basescan.org/address/0x0da233676f46427c31928f5f85678d6737f4ec7e#code"><code>0x0da233676f46427c31928f5f85678d6737f4ec7e</code></a> (<code>SiloFacet</code>)<br><a href="https://basescan.org/address/0xecc6509f71b74c9b14f035d35fb9113519f88bb5#code"><code>0xecc6509f71b74c9b14f035d35fb9113519f88bb5</code></a> (<code>ConvertFacet</code>, <code>PipelineConvertFacet</code>, <code>ClaimFacet</code>)</p> | [`0xe47c1d275ceb1554ce802a0755cc679294f1ae81`](https://basescan.org/address/0xe47c1d275ceb1554ce802a0755cc679294f1ae81#code) | `SiloFacet`, `ConvertFacet`, `PipelineConvertFacet`, `ClaimFacet` |
| `LibConvert`         | [`0x812d9a79aea7db58bc3b0a149ba2694ef37fd1dd`](https://basescan.org/address/0x812d9a79aea7db58bc3b0a149ba2694ef37fd1dd#code)                                                                                                                                                                                                                                                                                                     | [`0xd10b907e2f8f452c4d43848a4f632a00eff9530b`](https://basescan.org/address/0xd10b907e2f8f452c4d43848a4f632a00eff9530b#code) | `ConvertFacet`                                                    |
| `LibPipelineConvert` | [`0xad2f28b08ff993ee8faaeb20235234ade0773022`](https://basescan.org/address/0xad2f28b08ff993ee8faaeb20235234ade0773022#code)                                                                                                                                                                                                                                                                                                     | [`0x9b42c78bd19fdf3cf3b3c16c9184e1169bf2c7aa`](https://basescan.org/address/0x9b42c78bd19fdf3cf3b3c16c9184e1169bf2c7aa#code) | `ConvertFacet`, `PipelineConvertFacet`                            |
| `LibEvaluate`        | [`0x9a2848cbde1d2fcaeebb712fd8f1eb65a4bda874`](https://basescan.org/address/0x9a2848cbde1d2fcaeebb712fd8f1eb65a4bda874#code)                                                                                                                                                                                                                                                                                                     | [`0x311877f9ffbaf12b905df3e1f8c3b5f3c5527bd4`](https://basescan.org/address/0x311877f9ffbaf12b905df3e1f8c3b5f3c5527bd4#code) | `SeasonFacet`                                                     |
| `LibGauge`           | [`0xd749370071c7fe42bbe7b81dfa85ba8ec24864b0`](https://basescan.org/address/0xd749370071c7fe42bbe7b81dfa85ba8ec24864b0#code)                                                                                                                                                                                                                                                                                                     | [`0x28d436b9bbbe755dea4db747483f693d71847984`](https://basescan.org/address/0x28d436b9bbbe755dea4db747483f693d71847984#code) | `SeasonFacet`                                                     |
| `LibIncentive`       | [`0x5630463e432cbd8ddb870d646213011da9166889`](https://basescan.org/address/0x5630463e432cbd8ddb870d646213011da9166889#code)                                                                                                                                                                                                                                                                                                     | [`0x09240a6c83350caaf110d9de6e23a659625d5476`](https://basescan.org/address/0x09240a6c83350caaf110d9de6e23a659625d5476#code) | `SeasonFacet`                                                     |
| `LibShipping`        | [`0xd8a274fcabe2a5cfc1c18b1f844f7fb2941d38f5`](https://basescan.org/address/0xd8a274fcabe2a5cfc1c18b1f844f7fb2941d38f5#code)                                                                                                                                                                                                                                                                                                     | [`0x3e3442a75ed4dd47e64e4522da625701049d6477`](https://basescan.org/address/0x3e3442a75ed4dd47e64e4522da625701049d6477#code) | `SeasonFacet`                                                     |
| `LibWellMinting`     | [`0x9500f6e8742ecb924af9c97922851d648b613d07`](https://basescan.org/address/0x9500f6e8742ecb924af9c97922851d648b613d07#code)                                                                                                                                                                                                                                                                                                     | [`0x6dd836e7fe603bd73532bf6b5cbb188b7fcc7fa9`](https://basescan.org/address/0x6dd836e7fe603bd73532bf6b5cbb188b7fcc7fa9#code) | `SeasonFacet`, `SeasonGettersFacet`                               |
| `LibFlood`           | [`0xc4667d3a3c7c0c42a5bf351f98861963b2597f51`](https://basescan.org/address/0xc4667d3a3c7c0c42a5bf351f98861963b2597f51#code)                                                                                                                                                                                                                                                                                                     | [`0xff823fbb0ae114b8e41c0529c7d87702cc5d06a8`](https://basescan.org/address/0xff823fbb0ae114b8e41c0529c7d87702cc5d06a8#code) | `SeasonFacet`                                                     |
| `LibGerminate`       | [`0xc6f5423a60acd02f0c8d8d6d5281caa00899b0f9`](https://basescan.org/address/0xc6f5423a60acd02f0c8d8d6d5281caa00899b0f9#code)                                                                                                                                                                                                                                                                                                     | [`0x74f0910564523a9a9a0b4db23505f653af20548c`](https://basescan.org/address/0x74f0910564523a9a9a0b4db23505f653af20548c#code) | `SeasonFacet`                                                     |
| `LibTractorHelpers`  | Not applicable — new supporting dependency                                                                                                                                                                                                                                                                                                                                                                                       | [`0xcc035410d5570f2c5e841091c87d5d051761e569`](https://basescan.org/address/0xcc035410d5570f2c5e841091c87d5d051761e569#code) | `TractorHelpers`                                                  |

### Function Changes <a href="#id-756e4019-aad5-8371-a17e-014f917e8e7f" id="id-756e4019-aad5-8371-a17e-014f917e8e7f"></a>

* Updated `Weather.updateTemperatureAndBeanToMaxLpGpPerBdvRatio()` to apply Maximum Temperature changes of +0.5, 0 and −1 percentage points for decreasing, steady and increasing demand, respectively, only when the Pod Rate is strictly above 100% and TWA delta is negative. The existing rule resets Temperature to 1% if a decrease meets or exceeds the current Temperature.
* Updated `LibEvaluate.calcDeltaPodDemand()` and added internal `getDemand()`. After the minimum is met, fast sellouts indicate increasing demand. Similar-time sellouts retain a steady-demand floor. Slower sellouts and Seasons without a sellout use the ratio of Pinto Sown to the previous Season: below 95% is decreasing, from 95% to below 105% is steady, and at least 105% is increasing. A zero prior number with a positive current number indicates increasing demand.
* Added the `minSoilSownDemand` check before the other demand rules. Fewer than 25 Pinto Sown returns zero demand. The calculation carries the current sellout time into the previous-Season field and resets the current sellout time to `type(uint32).max`. Updated `SeasonGettersFacet.getExtEvaluationParameters()` to return the new `minSoilSownDemand` field. The tuple now contains seven `uint256` fields and `bytes32[60]`, replacing six `uint256` fields and `bytes32[61]`. Its selector is unchanged.
* Added `updateSortedDepositIds(address,address,uint256[])` to validate a nonempty, complete ordering of the account’s existing Deposit IDs for one token, requiring strictly ascending Stems, then store that ordering through `LibSilo._setSortedDepositIds()`. PI-8 updates the array but does not update the separate `idIndex` mapping. PI-9 subsequently corrects that omission.
* Added `TractorHelpers.getSortedDeposits()` (descending Stem order) and `getSortedWhitelistedTokensBySeeds()` (descending Seeds). Withdrawal-planning helpers select Deposits and token quantities for Pinto withdrawals, including plans that exclude quantities already allocated to another plan. These view helpers are distinct from the ascending-Stem storage validator. Added `getTokensAscendingSeeds()` and `getTokensAscendingPrice()` for source-token strategies, plus highest/lowest-Seed and Deposit-availability views. `getDepositStemsAndAmountsToWithdraw()` walks the stored Deposit IDs backward and filters by minimum Stem. It does not sort that list, so lowest-Mown-Stalk-first selection relies on an ascending-Stem stored ordering. `combineWithdrawalPlans()` aggregates overlapping allocations through the externally linked `LibTractorHelpers`.
* Updated `tractor()` and `LibTractor` to store the executing Blueprint hash and operator during execution and reset them afterward to `bytes32(uint256(1))` and `address(1)`. Added `getCurrentBlueprintHash()`, `operator()` and `tractorUser()`. The latter returns the active publisher during Tractor execution or the caller otherwise. `publishRequisition()` now rejects a Blueprint whose nonce has reached `maxNonce`.
* Added `sendTokenToInternalBalance()` to transfer ERC-20 tokens from the actual caller’s external balance to a recipient’s internal balance. It uses `msg.sender`, not the substituted Blueprint publisher.
* Added `TractorHelpers.withdrawBeansFromSources()` to execute a withdrawal plan. Pinto Deposits are withdrawn directly. LP Deposits are checked against current-versus-instantaneous pricing, withdrawn and removed for Pinto before crediting the requested balance.
* Added `TractorHelpers.tip()` for signed operator rewards. A positive tip pays the selected tip address. A negative tip transfers from that address to the publisher.
* Updated `harvest()` to return the number of Pinto harvested.
* Added `totalUnharvestableForActive`[`Field`](https://docs.pinto.money/resources/glossary#field)`()` for outstanding [Pods](https://docs.pinto.money/resources/glossary#pods) in the active Field and `getBeanToken()` for the Pinto token address.
* Added the supporting `SowBlueprintv0` execution and validation helpers. `sowBlueprintv0()` coordinates withdrawals, tips and Sowing within the publisher’s configured per-Season limits, Temperature, [Pod Line](https://docs.pinto.money/resources/glossary#pod-line), delay, slippage and Grown Stalk constraints. It tracks each Blueprint’s remaining order and last executed Season. The validation views return execution quantities and a withdrawal plan.
* Added owner-restricted `OperatorWhitelist.addOperator()` and `removeOperator()`, with membership and enumeration views. `TractorHelpers.isOperatorWhitelisted()` checks the current operator against the Blueprint’s configured allowlist. An empty list permits any operator. Entries can name operators directly or allowlist contracts. Failed contract checks are skipped.
* Added owner-restricted `pauseFunction()` and `unpauseFunction()`, plus a public `functionPaused()` view, through `PerFunctionPausable`. The pause check guards `TractorHelpers.withdrawBeansFromSources()` and `SowBlueprintv0.sowBlueprintv0()`. It does not pause every helper automatically.
* Added `PriceManipulation.isValidSlippage()` to sync a [Well](https://docs.basin.exchange/components/well) and compare its current Pinto-per-token rate with the [Pump](https://docs.basin.exchange/components/pump)’s instantaneous rate using the supplied tolerance. Zero rates return `false`. The Sow Blueprint defaults an unspecified tolerance to 1%.
* Added `PriceManipulation.aggregatePintoPerUsdc()` to aggregate instantaneous-reserve pricing across whitelisted Wells and `price()` to combine that result with the [sPinto](https://docs.pinto.money/pinto-mechanics/toolshed/spinto-composing-pinto-with-defi) redemption rate for a 24-decimal sPinto/USDC oracle output.
* Updated `BeanstalkPrice` with reserve-type overloads for `price()`, `priceForWells()` and `poolPrice()`. The original overloads remain available. The inherited `getWell()` also gained a reserve-type overload. The selected current, instantaneous or capped reserves feed balances and reserve-dependent calculations, but the Pinto price quote still calls the Well’s current `getSwapOut()`. USD conversion now uses `getMillionUsdPrice()`, and non-Pinto liquidity multiplies before division to reduce truncation.
* Replaced the `updateSeedGaugeSettings` selector `0x2444561c` with `0x79325704`. Its `EvaluationParameters` tuple now includes `rainingMinBeanMaxLpGpPerBdvRatio`. The function remains owner-restricted.

### Event Changes <a href="#id-3ece4019-aad5-83bf-9213-0155444746be" id="id-3ece4019-aad5-83bf-9213-0155444746be"></a>

* The initializer emitted `UpdatedEvaluationParameters` for the Maximum Crop Ratio update and `BeanToMaxLpGpPerBdvRatioChange` for the Crop Scalar adjustment, using `type(uint256).max` as the initializer’s case ID. This initializer’s `UpdatedEvaluationParameters` event includes an indexed Season followed by the parameter tuple.
* Updated weather processing to add `1000` to the case ID when the Pod Rate is strictly above 100%, including when TWA delta is nonnegative. This identifies the extreme Pod Rate in Temperature and Crop Scalar change events independently of whether the negative-TWA-delta Temperature override applies.
* The initializer emitted `UpdatedExtEvaluationParameters` for the new minimum demand threshold.
* Added `TractorExecutionBegan` before nonce increment and execution. Expanded `Tractor` and moved its emission after publisher reset. Both include indexed operator, publisher and Blueprint hash, the pre-increment nonce and remaining gas. `CancelBlueprint` now indexes its Blueprint hash. The new `sendTokenToInternalBalance()` path also emits the existing `InternalBalanceChanged` and `TokenTransferred` events.
* Added `SowOrderComplete` in `SowBlueprintv0` when an order finishes or its remaining Pinto is below the permitted minimum. Its indexed fields are `blueprintHash` and `publisher`. The other fields are `totalAmountSown` and `amountUnfulfilled`. On full completion, `totalAmountSown` reports the final execution’s quantity. On the below-minimum remainder branch, it reports the cumulative filled quantity.
* Added `OperatorReward` in `TractorHelpers.tip()`, carrying reward type, indexed publisher and recipient, token and signed tip.
* `OperatorWhitelist` emits `OperatorAdded` and `OperatorRemoved` with the operator indexed.
* Added `FunctionPaused(bytes4 indexed functionSelector, bool isPaused)` to the pausable helpers. Their owner controls emit it for pause and unpause actions. The owner-controlled supporting contracts also inherit `OwnershipTransferred`.
* Updated the `WhitelistFacet` owner-update event `UpdatedEvaluationParameters` to include `rainingMinBeanMaxLpGpPerBdvRatio` in its tuple, changing the event signature. Unlike the initializer event of the same name, this event has only the parameter tuple and no Season argument.
* Expanded `ConvertDownPenalty` from one value to `(address account, uint256 grownStalkLost, uint256 grownStalkKept)` in both conversion paths. The final value is the Grown Stalk retained after applying the penalty.
