# Proposal: Change vault harvest() function to reward function caller

**URL:** <https://gov.yearn.fi/t/proposal-change-vault-harvest-function-to-reward-function-caller/4726>\
**Category:** Vaults\
**Created:** [4 September 2020 11:22 UTC](https://gov.yearn.fi/t/proposal-change-vault-harvest-function-to-reward-function-caller/4726 "2020-09-04T11:22:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beepidibop](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Beepidibop](https://gov.yearn.fi/u/Beepidibop)\
**Post date:** [4 September 2020 11:22 UTC](https://gov.yearn.fi/t/proposal-change-vault-harvest-function-to-reward-function-caller/4726/1 "2020-09-04T11:22:27Z")

</div>

**Summary** :

This proposal aims to include a dynamic gas reward for harvest() callers to align the interests of the Function Callers, vault LP, and the YFI Governance.

There is also a [competing proposal](http://gov.yearn.fi/t/yip-upgrade-treasury-vault-to-solve-gas-subsidy-gitcoin-and-more/4732) that implements changes to the TreasuryVault contract to subsidize gas faster. Though the harvest() proposal might help in the future, we do need gas now.

**Abstract** :

Implement a dynamic gas reward pot as part of the harvest() function to incentivize Callers. This ensures vault LP never pay above fair market value for gas and resolves the conflict of interest between LP and Governance while determining gas budgets.

**Motivation** :

With gas prices constantly changing, it is hard to allocate a fixed monthly/daily gas fee budget to call functions. It is also hard to figure out the optimal frequency to call the harvest function.

A dynamic gas reward will align the interests of the Function Callers, vault LP, and the YFI Governance. Since:

- The Function Callers can determine when to call functions based on the reward.
  - Since anyone can call harvest(), Function Callers will need to compete with each other for the reward, resulting in a fair market price. This will optimize the frequency of harvest() calls at the same time.

- The vault LP will always be paying market rate for harvest() to be called. While still retaining the advantage of gas savings as a pool.
- The Governance will never over or under-allocate budget needed for gas. And can still claim the 5% fee on gas saved for the LP. Resolving the conflict of interest when determining gas fees.

**Specification** :

Change the harvest function by:

- Implementing a dynamic pot for gas reward that grows over time, proportional to the profit of the pool. Claimable when other current conditions for harvest() are met.
- Retain the 5% fee on gas saved to be reserved for YFI Governance and development.

**Further Considerations**

Since this proposal assumes the pool doesn’t incur losses before harvest is called (part of the condition for harvest() to be called), a different strategy might be needed if that is no longer the case.

Implementing a variable for how fast the gas reward grows (most likely as a percentage of profit) for Governance to experiment or control in case things go wrong might be a good idea. But the method of funding the pot should be up for discussion in this thread.

It might also be a good idea for other functions (draw, deposit, pay, etc.) to also have their own separate gas pots that are funded when harvest() is called. This ensures only profit will ever be spent on gas fees, protecting the principal. However, this should be submitted as a separate proposal and is not part of this proposal.

**For** :  
Include a dynamic gas reward pot for the havest() function of vaults.

**Against** :  
No change.

**Poll** :

_Poll ([view on site](https://gov.yearn.fi/t/proposal-change-vault-harvest-function-to-reward-function-caller/4726/1))_

---

<div class="post-metadata">

**Author:** ![TheSouthSeaCompany](https://dub1.discourse-cdn.com/flex013/user_avatar/gov.yearn.fi/thesouthseacompany/32/203_2.png) [@TheSouthSeaCompany](https://gov.yearn.fi/u/TheSouthSeaCompany)\
**Post date:** [4 September 2020 11:52 UTC](https://gov.yearn.fi/t/proposal-change-vault-harvest-function-to-reward-function-caller/4726/2 "2020-09-04T11:52:04Z")

</div>

The reward pot seems entirely redundant, especially since it is proportional to vault profit anyway. Simply giving the caller a percentage of the harvested profit achieves the goal. This is the approach taken by DFI (YFII) where the reward is 1% of the harvest. Additionally, this simple, market-driven rule frees governance and the core team from having to determine conditions where harvest is allowed.

---

<div class="post-metadata">

**Author:** ![Beepidibop](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Beepidibop](https://gov.yearn.fi/u/Beepidibop)\
**Post date:** [4 September 2020 11:57 UTC](https://gov.yearn.fi/t/proposal-change-vault-harvest-function-to-reward-function-caller/4726/3 "2020-09-04T11:57:43Z")

</div>

Yeah, I’d agree that a separate contract will be redundant. I was thinking maybe just a readable variable for the amount to be rewarded in the existing strategy. Or maybe that’s still redundant and the Callers should try to calculate the rewards they’ll get themselves.

---

<div class="post-metadata">

**Author:** ![banteg](https://dub1.discourse-cdn.com/flex013/user_avatar/gov.yearn.fi/banteg/32/3608_2.png) [@banteg](https://gov.yearn.fi/u/banteg)\
**Post date:** [4 September 2020 12:00 UTC](https://gov.yearn.fi/t/proposal-change-vault-harvest-function-to-reward-function-caller/4726/4 "2020-09-04T12:00:37Z")

</div>

Overall I’m for, but I have a counter-proposal which can be implemented faster. Will post the spec shortly.

The difference:

- It solves for gas spent on failed transactions
- It also solves the gitcoin distribution
- It only requires redeploying TreasuryVault contract instead of redeploying/migrating all strategies

---

<div class="post-metadata">

**Author:** ![banteg](https://dub1.discourse-cdn.com/flex013/user_avatar/gov.yearn.fi/banteg/32/3608_2.png) [@banteg](https://gov.yearn.fi/u/banteg)\
**Post date:** [4 September 2020 12:57 UTC](https://gov.yearn.fi/t/proposal-change-vault-harvest-function-to-reward-function-caller/4726/5 "2020-09-04T12:57:06Z")

</div>

Please take a look

> [@YIP 46: Upgrade Treasury Vault to solve gas subsidy, gitcoin and more](http://gov.yearn.fi/t/yip-upgrade-treasury-vault-to-solve-gas-subsidy-gitcoin-and-more/4732):
>
> Authors@banteg Implementers@andre.cronje Summary This proposal bundles a few improvements together which have compounding effects. It will solve for [gas subsidy](http://gov.yearn.fi/t/gas-costs-are-too-damn-high/4655), [gitcoin grants](http://gov.yearn.fi/t/direct-of-rewards-towards-ethereum-public-goods-funding/3699), inability to convert other Curve tokens into rewards for governance stakers. Abstract Add split functionality to TreasuryVault which can send the rewards to multiple destinations before sending them to governance staking contract. Add ability to withdraw from Curve pools. Add ability to trade using Uniswap. Motivat…

---

<div class="post-metadata">

**Author:** ![0xmt](https://dub1.discourse-cdn.com/flex013/user_avatar/gov.yearn.fi/0xmt/32/839_2.png) [@0xmt](https://gov.yearn.fi/u/0xmt)\
**Post date:** [4 September 2020 13:10 UTC](https://gov.yearn.fi/t/proposal-change-vault-harvest-function-to-reward-function-caller/4726/6 "2020-09-04T13:10:08Z")

</div>

I agree that a percentage of the harvest() call is the way to go. It may be beneficial to make it a fuction of time since last call, just so the less profitable strategies won’t stay unharvested for too long, in periods with high gas fees.
