# Rewarded force-close mechanism to eliminate stale allocations

**URL:** <https://forum.thegraph.com/t/rewarded-force-close-mechanism-to-eliminate-stale-allocations/2951>\
**Category:** Graph Improvement Proposals (GIP)\
**Created:** [January 28, 2022, 4:34am UTC](https://forum.thegraph.com/t/rewarded-force-close-mechanism-to-eliminate-stale-allocations/2951 "2022-01-28T04:34:21Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Sam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.thegraph.com/sam/32/757_2.png) [@Sam](https://forum.thegraph.com/u/Sam)\
**Post date:** [January 31, 2022, 3:31am UTC](https://forum.thegraph.com/t/rewarded-force-close-mechanism-to-eliminate-stale-allocations/2951/3 "2022-01-31T03:31:04Z")

</div>

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.

---

_[View the full topic](https://forum.thegraph.com/t/rewarded-force-close-mechanism-to-eliminate-stale-allocations/2951)._
