-
Notifications
You must be signed in to change notification settings - Fork 18
PI-14: Whitelist Pinto-wstETH, Add dynamic LP Distribution, and Pod Referral #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…print verification
…ommissions and blueprint validation
…and SowBlueprintv0Referral integration
…ynamic data injection
…icData with transient storage
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…and SowBlueprintv0Referral integration
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
… eliminate duplicate storage read
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…rod:pinto-org/protocol into frijo/release/PI-wsteth-referral
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
PI-wsteth-referral deployment scripts
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…s from uint128 to uint88
…ot-optimization refactor: pack FieldReferral struct into single slot
…rod:pinto-org/protocol into frijo/release/PI-wsteth-referral
…l improvements task config
…s with modified dependencies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PI-14: Whitelist Pinto-wstETH, Add dynamic LP Distribution, and Pod Referral
Summary
Links
Problem
85% of the value that trades against Pinto is censorable by Coinbase/Circle. A high concentration dependent on one party lowers the censorship resistance of Pinto.
Pinto currently does not have a way to autonomously adjust the optimal distribution of liquidity.
Farmers do not have an direct incentive to encourage users outside of the protocol to participate.
Tractor does not allow for dynamically sized payloads, limiting the expressivity of Blueprint contracts (contracts built on top of Tractor).
Users are only able to Anti-Lambda-Lambda (AL2L) one Deposit per function call, increasing the friction for farmers to efficiently update other farmer's Deposits' PDV.
Users are unable to buy/list multiple Plots in the same function call, increasing the friction to interact with the Pod marketplace..
Solution
Deploy and Whitelist the Pinto-wsETH Well. wstETH is an ETH liquid staking derivative similar in purpose and structure to cbETH, but is non-custodial. It is collateralized by ETH staked via validators coordinated by the Lido protocol. Lido does not custody users’ wstETH or control user keys. nstead, it can influence validator selection and protocol upgrades through its governance processes. Taking over wstETH would require capture of Lido DAO governance and coordinated validator collusion at the Ethereum consensus layer, followed by social acceptance by the Ethereum ecosystem. There is no single custodian, issuer, or legal control point capable of unilaterally seizing or censoring wstETH. Thus, migrating some of the liquidity from cbETH to wstETH will significantly increase the overall censorship resistance of Pinto.
Implement a dynamic optimal LP distribution system that allows the protocol to adjust its optimal distribution over time, rather than incentivizing a static distribution. Every Season, the optimal distribution for each LP token on the Deposit Whitelist changes based its LP Distribution Function The implementation can be seen in the Appendix section.
Set the dynamic optimal LP distribution to decrease the Pinto-cbETH optimal LP distribution from 33.33% to 0% in 360 Seasons, and increase the Pinto-wstETH optimal LP distribution from 0% to 33.33% in 360 Seasons.
Implement the Pod Referral system, enablingFarmers to receive additional Pods (in excess of the Temperature) for Sowing with a referral. Both the referrer and referee receive bonus Pods. The referrer receives 5% bonus Pods and referred Farmer receives 10% bonus Pods. The referrer's Pods are immediately after the referee's Pods in the Pod Line.can refer another Farmer and gain a 5% bonus Pods when lending to the Field. Referred Farmers gain 10% of the Pods minted, up to 2 million Pods.
Upgrade Tractor to handle dynamically sized payloads. Operators can inject dynamic calldata by calling
tractorDynamicData. The implementation can be seen in the Appendix sectionAdd batch functionality to the existing Convert and Marketplace actions.
Economic Rationale
By adjusting the optimal distribution of LP and then allowing the LP Seed Gauge to change the incentives to hold Deposited cbETH and wstETH over time, there should be minimal value lost by Farmers who may require time to migrate.
There is no need at this time to change the overall distribution of liquidity. By changing the optimal distribution of cbETH and wstETH in lockstep, maintaining the same overall optimal exposure to ETH while gradually changing the particular form of ETH exposure is achieved.
The Pod Referral system increases the actual Temperature, and therefore the Pod Rate of the protocol. While at the margin the protocol would prefer to issue less debt, the current state of the protocol is such that it would rather issue more debt to decrease supply. By adding the Referral System, the marginal incentive to attract other Farmers to Sow increases.
Eliminating the friction to using Tractor efficiently allows farmers to better access and use the protocol efficiently. Pod referral Economic rationale
Batching functionality allows for more gas efficient interactions on the Farm. Lowering the cost to interact with the Farm allows farmers to use the protocol more efficiently.
Technical Rationale
Manual liquidity migrations require significant development effort. The implementation of a generalized dynamic optimal liquidity distribution mechanism removes the need to do manual migrations moving forward.
At the time of deployment, Pinto needs to retroactively store the number of Pinto Sown by each farmer. Given that this may update between the multisig proposal and execution, Pinto needs a way to initialize these values. Given the stateless requirement of Initialization functions, and the asynchronous nature of the PCM signing transactions and deployment of the Init contract, a Helper Contract that serves as Init Storage allows for dynamic data in the init function was created to solve this problem.
Allowing Tractor operators with the ability to inject dynamic calldata increases the expressivity of Blueprint smart contracts.
Tractor dynamic data leverages EIP-1153: Transient storage(https://eips.ethereum.org/EIPS/eip-1153) for gas efficient temporary storage.
While interfaces can utilize the
farmandadvancedFarmfunction to call multiple Pinto actions in one transaction, each action performs an gaseous invariant check to verify that the protocol is secure and solvent. Implementing protocol batching for Converts and Marketplace actions (e.g creating, cancelling, and filling Pod Listings and Orders) significantly reduces the cost of said actions.Contract Changes
Appendix
Optimal LP Distribution Gauge
Each LP token on the Deposit Whitelist has 1) a target optimal percent LP distribution ($λ^{{∗}^{T}}$ ), 2) the change in optimal percent LP distribution ($∆λ^{∗}$ ), and optionally, 3) a LP Distribution Function. ($f^{{λ}^d}$ )
the LP Distribution Function is a generic function that takes in 1) the change in optimal percent LP distribution last Season ($∆λ_{t-1}^{∗}$ ), and generic calldata set for the given LP token ($λ_{D}$ ), and returns the change in optimal percent LP distribution this season.
Currently, there are no LP Distribution Functions defined in Pinto.
Each Season, Pinto iterates through each of the whitelisted LP tokens, invokes the LP Distribution function (if applicable), and changes the change in optimal percent LP deposited PDV.
The optimal percent LP deposited PDV for a given Season is calculated as:
Tractor Dynamic Data
Tractor Blueprint Contracts (e.g smart contracts that are intended to be called within a
tractorcall) can use dynamic data by callinggetTractorDatawith a key value.Data can only be set at the key value by calling
tractorDynamicDataand inputting data by a (key, value) pair.Data set via this method will only be active until the end of the tractor call.