Skip to content

Commit 3e82a41

Browse files
authored
feat: Improve cap automator execution (#42)
* feat: deploy additional cap automator keeper instance * feat: make gas check less sensitive
1 parent 18d7e39 commit 3e82a41

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"domain": "mainnet",
3+
"args": {
4+
"threshold": 1000,
5+
"performGasCheck": false,
6+
"sendSlackMessages": true
7+
},
8+
"secrets": {
9+
"SLACK_WEBHOOK_URL": "SPARK_INFO_SLACK_WEBHOOK_URL",
10+
"ETHERSCAN_API_KEY": "GELATO_KEEPERS_ETHERSCAN_API_KEY"
11+
},
12+
"trigger": {
13+
"type": "time",
14+
"interval": "3600000"
15+
}
16+
}

test/utils/gasAboveAverage.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ describe('gasAboveAverage', function () {
3232
})
3333

3434
it('gas price is above average', async () => {
35-
const currentGasPrice = BigInt(20) * gwei + BigInt(1)
35+
const currentGasPrice = BigInt(20) * gwei * BigInt(5) + BigInt(1)
3636
const result = await gasAboveAverage(axios, 'fakeApiKey', currentGasPrice)()
3737
expect(result).to.be.true
3838
})
3939

4040
it('gas price is equal to average', async () => {
41-
const currentGasPrice = BigInt(20) * gwei
41+
const currentGasPrice = BigInt(20) * gwei * BigInt(5)
4242
const result = await gasAboveAverage(axios, 'fakeApiKey', currentGasPrice)()
4343
expect(result).to.be.false
4444
})
4545

4646
it('gas price is below average', async () => {
47-
const currentGasPrice = BigInt(20) * gwei - BigInt(1)
47+
const currentGasPrice = BigInt(20) * gwei * BigInt(5) - BigInt(1)
4848
const result = await gasAboveAverage(axios, 'fakeApiKey', currentGasPrice)()
4949
expect(result).to.be.false
5050
})

utils/gasAboveAverage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ export const gasAboveAverage =
2020

2121
const averageGasPrice = BigInt(result[0].avgGasPrice_Wei)
2222

23-
return currentGasPrice > averageGasPrice
23+
return currentGasPrice > averageGasPrice * BigInt(5)
2424
}

0 commit comments

Comments
 (0)