diff --git a/packages/bot/src/p2p/compound.ts b/packages/bot/src/p2p/compound.ts index f9d6e35..dc8878b 100644 --- a/packages/bot/src/p2p/compound.ts +++ b/packages/bot/src/p2p/compound.ts @@ -7,6 +7,10 @@ import { GLOBAL_OVERRIDES, StakingType } from "../constant" export const splitOrders = (orders: SimpleMatchOrder[], limit: number): SimpleMatchOrder[][] => { let orderAmount = orders.length + if (orderAmount < 3) { + logger.info(`valid p2p order count: ${orderAmount}, less than 3`) + return [] + } let batchOrders: SimpleMatchOrder[][] = [] while (orderAmount > 0) { batchOrders.push(orders.slice(0, limit)) diff --git a/packages/bot/src/runtime.ts b/packages/bot/src/runtime.ts index f716e85..f950e62 100644 --- a/packages/bot/src/runtime.ts +++ b/packages/bot/src/runtime.ts @@ -80,8 +80,8 @@ export namespace Runtime { try { let hasStarted = false const curHour = new Date().getUTCHours() + 8 - // only run at UTC+8 8:00 - if (curHour === 8) { + // only run at UTC+8 14:00 + if (curHour === 14) { if (!hasStarted) { logger.info("start to run...") await checkBalanceSufficient( diff --git a/packages/bot/src/supplyAndStake/compound.ts b/packages/bot/src/supplyAndStake/compound.ts index 1680ea7..c41d18b 100644 --- a/packages/bot/src/supplyAndStake/compound.ts +++ b/packages/bot/src/supplyAndStake/compound.ts @@ -110,6 +110,8 @@ const claimApeAndCompoundWithSimulation = async ( await provider.getProvider().getGasPrice(), runtime.isMainnet ) + // maxPriorityFeePerGas: ethers.utils.parseUnits("2", "gwei"), + // nonce: } const tx = info.isBakc ? await pool.claimPairedApeAndCompound(nftAsset, users, nftPairs, options) @@ -186,6 +188,20 @@ export function splitCompoundInfos(compoundInfo: ValidCompoundInfo, limit: numbe logger.info(`No ${collection} to claim and compound`) continue } + if ( + collectionInfo.isBakc + ? collectionInfo.nftPairs.flat().length < 3 + : collectionInfo.tokenIds.flat().length < 3 + ) { + logger.info( + `No ${collection} to claim and compound, token count: ${ + collectionInfo.isBakc + ? collectionInfo.nftPairs.flat().length + : collectionInfo.tokenIds.flat().length + } less than 3` + ) + continue + } let users = cloneDeep(collectionInfo.users) let batches = [] diff --git a/packages/utils/src/tx/tx.ts b/packages/utils/src/tx/tx.ts index 663c253..81f4f21 100644 --- a/packages/utils/src/tx/tx.ts +++ b/packages/utils/src/tx/tx.ts @@ -6,7 +6,7 @@ export const getOptMaxFeePerGas = async ( ): Promise => { curGasPrice if (!isMainnet) return ethers.utils.parseUnits("1000", "gwei") - const maxGasPrice = ethers.utils.parseUnits("20", "gwei") + const maxGasPrice = ethers.utils.parseUnits("24", "gwei") return maxGasPrice // const midGasPrice = ethers.utils.parseUnits("25", "gwei") // if (curGasPrice.gte(maxGasPrice)) return maxGasPrice