From 523a3a3495d0c907c22e3e3ef5dee5949396312b Mon Sep 17 00:00:00 2001 From: rouzwelt Date: Mon, 20 Jan 2025 15:25:09 +0000 Subject: [PATCH] Revert "update" This reverts commit 833496f58500289c9c903ce241c6d8c20ec94fbe. --- src/cli.ts | 2 +- src/processOrders.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 1e717dca..545fa022 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -614,7 +614,7 @@ export const main = async (argv: any, version?: string) => { }); // periodically fetch and set gas price in state (once every 20 seconds) - // setInterval(() => getGasPrice(config, state), 20_000); + setInterval(() => getGasPrice(config, state), 20_000); const lastReadOrdersMap = options.subgraph.map((v) => ({ sg: v, diff --git a/src/processOrders.ts b/src/processOrders.ts index b954964c..e803eeab 100644 --- a/src/processOrders.ts +++ b/src/processOrders.ts @@ -1,6 +1,6 @@ import { ChainId } from "sushi"; import { findOpp } from "./modes"; -import { getGasPrice, getQuoteGas } from "./gas"; +import { getQuoteGas } from "./gas"; import { PublicClient } from "viem"; import { Token } from "sushi/currency"; import { createViemClient } from "./config"; @@ -450,6 +450,7 @@ export async function processPair(args: { sellToken: orderPairObject.sellToken, }, }; + const gasPrice = ethers.BigNumber.from(state.gasPrice); spanAttributes["details.orders"] = orderPairObject.takeOrders.map((v) => v.id); spanAttributes["details.pair"] = pair; @@ -498,9 +499,6 @@ export async function processPair(args: { ratio: ethers.utils.formatUnits(orderPairObject.takeOrders[0].quote!.ratio), }); - await getGasPrice(config, state); - const gasPrice = ethers.BigNumber.from(state.gasPrice); - // get pool details if ( !dataFetcher.fetchedPairPools.includes(pair) ||