The Keep3r Network Experiment

Yearn V2 use case

  • ETH lot buyer
  • WBTC lot buyer
  • Users deposited Hegic in the vault to the point where another Hegic lot could be purchased. (888k Hegic)
  • There was enough profit to warrant a claim from the Hegic protocol

The Hegic protocol use case

The simplest solution

  • Listen to Hegic’s Create event
  • For every option created set up an alarm for the option’s expiration time
  • Call unlock(optionID) when the time comes

Enter Keep3r network

  • Will keepers understand the Hegic code?
  • Will I need to offer some helper methods to guide the correct workflow?
  • Would the default incentives be enough for them to pick up the work?
function ethOptionUnlockable(uint256 _optionId) external override view returns (bool) {
Option memory option = IHegic(ethOptions).options(_optionId);
return option.state == State.Active &&
option.expiration < block.timestamp;
}
function ethUnlock(uint256 _optionId) external override paysKeeper {
IHegic(ethOptions).unlock(_optionId);
}

Conclusions after v1 that inspired V2

Enter version 2

Gas usage of a single unlock is around 175k gas.
Pool usage can be calculated with: 100-(pool.availableBalance() * 100 / pool.totalBalance())
We can ask keep3r a quote for the work to be done.
My idea is to have a % of the locked value we want to pay in fees.
Let’s say it’s 10%. If we can free 1 eth, we would like to pay 0.1 eth in fees+gas.
This will be modifiable in the keep3r contract by the owner.
The process will be the following:Keeper sends a list of options id
We calculate the call totalCost which is keep3r.quote(175k) * len(optionsList)
we calculate totalUnlock by sum all the options locked value + premium
We calculate unlockValue by doing totalUnlock * 10.0 / 100.0
Finally, we get weightedUnlockValue in based on pool usage with poolUsage * unlockValue / 80.0
if totalCost <= weightedUnlockValue => proceed with the unlocks.

Conclusion

Acknowledgments

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store