Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
rouzwelt committed Jan 18, 2025
1 parent 26260b4 commit 833496f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 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 { createViemClient } from "./config";
Expand Down Expand Up @@ -450,7 +450,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 @@ -499,6 +498,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 833496f

Please sign in to comment.