Skip to content

Commit

Permalink
local run
Browse files Browse the repository at this point in the history
  • Loading branch information
jfzhou5 committed Dec 20, 2023
1 parent e7b11ee commit 47421e5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
36 changes: 18 additions & 18 deletions packages/bot/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,25 @@ export namespace Runtime {
let hasStarted = false
const curHour = new Date().getUTCHours() + 8

Check failure on line 82 in packages/bot/src/runtime.ts

View workflow job for this annotation

GitHub Actions / Lint Check

'curHour' is assigned a value but never used
// only run at UTC+8 14:00
if (curHour === 15) {
if (!hasStarted) {
logger.info("start to run...")
await checkBalanceSufficient(
runtime.wallet.address,
ethers.utils.parseEther("0.2").toString()
)
await worker()
heartBeat()
logger.info(
`don't worry, still alive... interval ${
runtime.interval.scan / 60 / 1000
} m`
)
hasStarted = true
}
} else {
hasStarted = false
// if (curHour === 15) {
if (!hasStarted) {
logger.info("start to run...")
await checkBalanceSufficient(
runtime.wallet.address,
ethers.utils.parseEther("0.2").toString()
)
// await worker()
heartBeat()
logger.info(
`don't worry, still alive... interval ${
runtime.interval.scan / 60 / 1000
} m`
)
hasStarted = true
}
// } else {
// hasStarted = false
// }
} catch (e) {
if (retryCount-- > 0) {
logger.error(`process error: ${mapErrMsg(e)}`)
Expand Down
3 changes: 3 additions & 0 deletions packages/bot/src/supplyAndStake/compound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ const claimApeAndCompoundWithSimulation = async (
// maxPriorityFeePerGas: ethers.utils.parseUnits("2", "gwei"),
// nonce:
}
console.log(
pool.interface.encodeFunctionData("claimApeAndCompound", [nftAsset, users, tokenIds])
)
const tx = info.isBakc
? await pool.claimPairedApeAndCompound(nftAsset, users, nftPairs, options)
: await pool.claimApeAndCompound(nftAsset, users, tokenIds, options)
Expand Down

0 comments on commit 47421e5

Please sign in to comment.