Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
rouzwelt committed Jan 20, 2025
1 parent 1ca78ee commit 434a92a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,6 @@ 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);

const lastReadOrdersMap = options.subgraph.map((v) => ({
sg: v,
skip: 0,
Expand Down
7 changes: 4 additions & 3 deletions src/processOrders.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChainId } from "sushi";
import { findOpp } from "./modes";
import { getQuoteGas } from "./gas";
import { getGasPrice, getQuoteGas } from "./gas";
import { PublicClient } from "viem";
import { Token } from "sushi/currency";
import { quoteSingleOrder } from "./order";
Expand Down Expand Up @@ -422,8 +422,6 @@ 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;

Expand Down Expand Up @@ -471,6 +469,9 @@ 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) ||
Expand Down

0 comments on commit 434a92a

Please sign in to comment.