Rewarded force-close mechanism to eliminate stale allocations

Here is a sketch of a Flashbots-oriented contract that we could write, deploy, and make available for any Searcher to call:

  1. Calls The Graph’s closeAllocation() function and aborts if an error is returned.
  2. Optionally swaps some of the GRT reward returned by closeAllocation() into ETH. This could be useful if the GRT reward is high and the Searcher is anticipating that they will need to use a significant amount of ETH (more than they currently have available in their account) to pay for tx priority.
  3. Uses coinbase.transfer() to send ETH to pay for Flashbots tx priority.
  4. Returns the remainder of the GRT to the Searcher as profit.
5 Likes