Skip to content

Commit

Permalink
Merge branch 'task/DEV-723' of https://github.com/VaporFi/stratospher…
Browse files Browse the repository at this point in the history
…e-points-indexer into task/DEV-723
  • Loading branch information
iHiteshAgrawal committed May 14, 2024
2 parents 296b064 + 2948b26 commit 4fecab8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ export async function getOrCreateUserData(
export async function queryQuote(
quoteParams: QueryWithAmountIn,
context: Context,
blockNumber: bigint
blockNumber: bigint,
aggregatorAddress: `0x${string}`
): Promise<bigint> {
const { client, network, contracts } = context;

Expand All @@ -171,7 +172,7 @@ export async function queryQuote(
try {
quote = await client.readContract({
abi: contracts.DexAggregator.abi,
address: addresses.DexAggregator![network.name] as `0x${string}`,
address: aggregatorAddress,
functionName: "findBestPath",
args: [
quoteParams.amountIn,
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ ponder.on("DexAggregator:RouterSwap", async ({ event, context }) => {
const usdValueOfTrade = await queryQuote(
{ amountIn, tokenIn, tokenOut, maxSteps: BIGINT_THREE },
context,
blockNumber
blockNumber,
event.log.address
);

let userData = await getOrCreateUserData(
Expand Down

0 comments on commit 4fecab8

Please sign in to comment.