# HegicPoolKeep3r: pool-keeper:claimRewards::not-enough-profit

**URL:** <https://forum.openzeppelin.com/t/hegicpoolkeep3r-pool-keeper-not-enough-profit/4787>\
**Category:** Defender\
**Tags:** keep3r-network\
**Created:** [November 26, 2020, 7:16am UTC](https://forum.openzeppelin.com/t/hegicpoolkeep3r-pool-keeper-not-enough-profit/4787 "2020-11-26T07:16:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mash](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/mash/32/3364_2.png) [@Mash](https://forum.openzeppelin.com/u/Mash)\
**Post date:** [November 26, 2020, 7:16am UTC](https://forum.openzeppelin.com/t/hegicpoolkeep3r-pool-keeper-not-enough-profit/4787/1 "2020-11-26T07:16:07Z")

</div>

Running Autotasks for some time now (3 weeks) Using the OpenZeppelin script examples to look for some work to be done and earn some KP3R The cronjob every minute on the 3 scripts (UniswapV2SlidingOracle, HegicPoolKeep3r and YearnV1EarnKeep3r) They run without error now since a week, using alchemy API, so used the right examples here on the right contract addresses after some trial and error.

Not a single time work has been done successfully. Only once in a while transactions fail with this message

> Fail with error 'pool-keeper:claimRewards::not-enough-profit'

Just using some transaction fee and no reward. This happens on the Hegic address.

So why is there no work done successfully? And why this error which indicates there is nothing or too small amount to be earned.... Is it even worth trying to run these jobs?

---

<div class="post-metadata">

**Author:** ![Bolo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/bolo/32/3369_2.png) [@Bolo](https://forum.openzeppelin.com/u/Bolo)\
**Post date:** [November 26, 2020, 3:50pm UTC](https://forum.openzeppelin.com/t/hegicpoolkeep3r-pool-keeper-not-enough-profit/4787/3 "2020-11-26T15:50:42Z")

</div>

when I got this error it’s bc someone claimed the rewards just before me

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [November 26, 2020, 11:18pm UTC](https://forum.openzeppelin.com/t/hegicpoolkeep3r-pool-keeper-not-enough-profit/4787/4 "2020-11-26T23:18:47Z")

</div>

Hi @Mash,

Your Autotask code checks if there is work to be done, and if there is work available, submit a transaction. Though other Keepers transactions could be mined before yours and win the work.

If you have a look at some of your transactions you should be able to see a successful transaction from a Keeper who won the work, either in the same block or in a block before.

See some examples from transactions calling this contract:

> **[Contract Address 0x5DDe926b0A31346f2485900C5e64c2577F43F774 | Etherscan](https://etherscan.io/address/0x5DDe926b0A31346f2485900C5e64c2577F43F774)**
>
> The Contract Address 0x5DDe926b0A31346f2485900C5e64c2577F43F774 page allows users to view the source code, transactions, balances, and analytics for the contract address. Users can also interact and make transactions to the contract directly on...

Looking at the verified code ([https://etherscan.io/address/0x5DDe926b0A31346f2485900C5e64c2577F43F774#code](https://etherscan.io/address/0x5DDe926b0A31346f2485900C5e64c2577F43F774#code)) we can see that calling workable to check could be true, and then when we submit a transaction another keeper could have won the work so it is no longer workable and our transaction will revert with `pool-keeper:claimRewards::not-enough-profit`:

```auto
  // Keep3r actions
  function claimRewards() external override paysKeeper {
    require(workable(), 'pool-keeper:claimRewards::not-enough-profit');
    uint256 _rewards = HegicPool.claimRewards();
    emit RewardsClaimedByKeeper(_rewards);
  }

  // Governor keeper bypass
  function workable() public view override returns (bool) {
    ILotManager LotManager = ILotManager(HegicPool.getLotManager());
    IHegicStaking HegicStakingETH = LotManager.hegicStakingETH();
    IHegicStaking HegicStakingWBTC = LotManager.hegicStakingWBTC();

    return (
      HegicStakingETH.profitOf(address(LotManager)) >= minETHRewards ||
      HegicStakingWBTC.profitOf(address(LotManager)) >= minWBTCRewards
    );
  }

```

You may want to try adding other jobs and removing any jobs that are not successful.  
See the documentation for some information on adding new jobs:

> **[Running a Keep3r Network keeper - OpenZeppelin Docs](https://docs.openzeppelin.com/defender/guide-keep3r#create_an_autotask)**

You may also want to check out the Keep3r network category in yearn.finance forum for discussions on profitability:

> **[Keep3r](https://gov.yearn.finance/c/projects/keep3r/20)**
>
> Use this category to participate in any technical or project related queries or discussions related Keep3r Network.

---

<div class="post-metadata">

**Author:** ![Mash](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/mash/32/3364_2.png) [@Mash](https://forum.openzeppelin.com/u/Mash)\
**Post date:** [December 1, 2020, 8:49am UTC](https://forum.openzeppelin.com/t/hegicpoolkeep3r-pool-keeper-not-enough-profit/4787/5 "2020-12-01T08:49:31Z")

</div>

Yeah I understand a lot of fishermen are trying to catch the same fish. Guess I have to construct a locally defined script and interaction which will run more often than openzeppelin cronjob which is bounded by running max every minute, it’s (almost) always a losing game in that way.

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [December 1, 2020, 11:20pm UTC](https://forum.openzeppelin.com/t/hegicpoolkeep3r-pool-keeper-not-enough-profit/4787/6 "2020-12-01T23:20:26Z")

</div>

Hi @Mash,

This is something that the development team are looking at for how to address the frequency for Keepers.

You could look at the available Jobs to see which ones have less people competing.

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [December 3, 2020, 12:41am UTC](https://forum.openzeppelin.com/t/hegicpoolkeep3r-pool-keeper-not-enough-profit/4787/7 "2020-12-03T00:41:42Z")

</div>

Hi @Mash,

New in Defender is an example script for **running a Keep3r at a faster rate**.

Please see [Defender Release 2020W49: Sokol testnet, Autotask examples repository, and faster Keep3rs](https://forum.openzeppelin.com/t/defender-release-2020w49-sokol-testnet-autotask-examples-repository-and-faster-keep3rs/4885).

---

<div class="post-metadata">

**Author:** ![Mash](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/mash/32/3364_2.png) [@Mash](https://forum.openzeppelin.com/u/Mash)\
**Post date:** [December 3, 2020, 9:29am UTC](https://forum.openzeppelin.com/t/hegicpoolkeep3r-pool-keeper-not-enough-profit/4787/8 "2020-12-03T09:29:24Z")

</div>

Thanks Question If you run this script as an autotask in OpenDefender cronjob you have to set an interval to run it? Let’s say every minute. The script stops just before that. Sleep is 55000/11 milliseconds After that minute it starts again as of the interval set. So every 5 seconds workable will be checked? Am I correct?

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [December 3, 2020, 8:20pm UTC](https://forum.openzeppelin.com/t/hegicpoolkeep3r-pool-keeper-not-enough-profit/4787/9 "2020-12-03T20:20:19Z")

</div>

Hi @Mash,

That is correct, you can set the Autotask frequency to every minute and the script will check for work every 5 seconds.

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [December 4, 2020, 3:03am UTC](https://forum.openzeppelin.com/t/hegicpoolkeep3r-pool-keeper-not-enough-profit/4787/10 "2020-12-04T03:03:00Z")

</div>

A post was split to a new topic: [Running frequent keeper every minute appears to have two autotasks running at the same time](https://forum.openzeppelin.com/t/running-frequent-keeper-every-minute-appears-to-have-two-autotasks-running-at-the-same-time/4899)
