# UniswapV2SlidingOracle Error

**URL:** https://gov.yearn.fi/t/uniswapv2slidingoracle-error/7915
**Category:** Keep3r
**Created:** [11 November 2020 05:48 UTC](https://gov.yearn.fi/t/uniswapv2slidingoracle-error/7915 "2020-11-11T05:48:55Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Sam](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@Sam](https://gov.yearn.fi/u/Sam)
#### Post date: [11 November 2020 05:48 UTC](https://gov.yearn.fi/t/uniswapv2slidingoracle-error/7915/1 "2020-11-11T05:48:55Z")

</div>

Hey Keep3rs!

I’ve been calling UniswapV2SlidingOracle on and off for a while now. I just can’t get the darn thing to work. Is there a bug in this job? Some folks have had success. Not sure what the secret sauce is on this one.

Here’s an example from a recent transaction (not mine).

> **[Ethereum Transaction Hash (Txhash) Details | Etherscan](https://etherscan.io/tx/0x713c9f2ec36e7db2ce095f45dcb77dd2d21eadd4f66044075f05997be352b1cf)**
>
> Ethereum (ETH) detailed transaction info for txhash 0x713c9f2ec36e7db2ce095f45dcb77dd2d21eadd4f66044075f05997be352b1cf. The transaction status, block confirmation, gas fee, Ether (ETH), and token transfer are shown.

Appreciate any help.

---

<div class="post-metadata">

### Author: ![Voorsie](https://avatars.discourse-cdn.com/v4/letter/v/a88e57/32.png) [@Voorsie](https://gov.yearn.fi/u/Voorsie)
#### Post date: [11 November 2020 06:09 UTC](https://gov.yearn.fi/t/uniswapv2slidingoracle-error/7915/2 "2020-11-11T06:09:31Z")

</div>

This job is workable every 30 minutes. The example you send was confirmed 2 blocks after a successful transaction of someone else so in the meantime workable has been set to false again and this is why following transactions are failing.

It’s very difficult to get between, because currently it’s dominated by 2 or 3 bots sending out transactions very quickly when the job is workable.

---

<div class="post-metadata">

### Author: ![Sam](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@Sam](https://gov.yearn.fi/u/Sam)
#### Post date: [11 November 2020 07:05 UTC](https://gov.yearn.fi/t/uniswapv2slidingoracle-error/7915/3 "2020-11-11T07:05:29Z")

</div>

Thanks for the response @Voorsie. That makes sense, and looking at the tx history on the contract I was thinking the same thing.

I don’t suppose there is a way around that in the current design? I ask mainly because I want to avoid tx errors when competing against multiple bots. Even with an off-chain workable() option, how many blocks do you need to wait to confirm the job is done? At least one, but perhaps even more since transactions can be rolled back for finalization.

---

<div class="post-metadata">

### Author: ![marsW](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@marsW](https://gov.yearn.fi/u/marsW)
#### Post date: [11 November 2020 08:16 UTC](https://gov.yearn.fi/t/uniswapv2slidingoracle-error/7915/4 "2020-11-11T08:16:08Z")

</div>

Suggest a 2 minute sleep after sending work

while(true) {  
if (!contract.workable()) {  
sleep(1000)  
continue  
}

```
contract.work()
sleep(120000) //2 minute

```

}

---

<div class="post-metadata">

### Author: ![Voorsie](https://avatars.discourse-cdn.com/v4/letter/v/a88e57/32.png) [@Voorsie](https://gov.yearn.fi/u/Voorsie)
#### Post date: [11 November 2020 10:38 UTC](https://gov.yearn.fi/t/uniswapv2slidingoracle-error/7915/5 "2020-11-11T10:38:36Z")

</div>

The suggestion of @marsW is a good one to prevent your script to send multiple failing transactions.

However, it’s currently a matter who is sending their tx in the first block that is timestamped 1800 seconds after the last successful work, with the highest gas.

I have just described the situation in another topic: [Bot war: Failing txs](http://gov.yearn.fi/t/bot-war-failing-txs/7924)

---

<div class="post-metadata">

### Author: ![bolo](https://dub1.discourse-cdn.com/flex013/user_avatar/gov.yearn.fi/bolo/32/2368_2.png) [@bolo](https://gov.yearn.fi/u/bolo)
#### Post date: [11 November 2020 15:10 UTC](https://gov.yearn.fi/t/uniswapv2slidingoracle-error/7915/6 "2020-11-11T15:10:11Z")

</div>

yesterday non0 and I were able to get some jobs with the code provided form OpenZepplin’s team

> **[UniswapV2SlidingOracle: failed to meet quorum](https://forum.openzeppelin.com/t/uniswapv2slidingoracle-failed-to-meet-quorum/4520/8)**
>
> Hello everybody, Just to say that the code ok @Bolo work well, and I have my first transaction with it. With really high transaction and gas fee, but it work ! Please to find the code here Github :...

> **[Ethereum Transaction Hash (Txhash) Details | Etherscan](https://etherscan.io/tx/0xa7f5c6c68dbc81bd56c3a95901c67179cf0abd13f8f084ba956e39a7ae906d6b)**
>
> Ethereum (ETH) detailed transaction info for txhash 0xa7f5c6c68dbc81bd56c3a95901c67179cf0abd13f8f084ba956e39a7ae906d6b. The transaction status, block confirmation, gas fee, Ether (ETH), and token transfer are shown.
