Skip to content

Commit

Permalink
fix: indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
royvardhan committed May 15, 2024
1 parent 4fecab8 commit 8b2fd23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const handleChainFirstWallet = async (
},
});

return await UserHistory.update({
userData = await UserHistory.update({
id: `${userAddressLowerCase}-${chainId}`,
data: { chainFirstWallet: true },
});
Expand Down
9 changes: 3 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,7 @@ ponder.on("DexAggregator:RouterSwap", async ({ event, context }) => {

// Check for first $1k, $10k, $100k swaps and assign points accordingly
if (
userData.usdValueOfSwaps + usdValueOfTrade >=
BIGINT_THOUSAND * MINIMUM_POINTS &&
userData.usdValueOfSwaps >= BIGINT_THOUSAND * MINIMUM_POINTS &&
!userData.first1kSwaps
) {
await Points.create({
Expand Down Expand Up @@ -432,8 +431,7 @@ ponder.on("DexAggregator:RouterSwap", async ({ event, context }) => {
}

if (
userData.usdValueOfSwaps + usdValueOfTrade >=
BIGINT_TEN_THOUSAND * MINIMUM_POINTS &&
userData.usdValueOfSwaps >= BIGINT_TEN_THOUSAND * MINIMUM_POINTS &&
!userData.first10kSwaps
) {
await Points.create({
Expand Down Expand Up @@ -461,8 +459,7 @@ ponder.on("DexAggregator:RouterSwap", async ({ event, context }) => {
}

if (
userData.usdValueOfSwaps + usdValueOfTrade >=
BIGINT_HUNDRED_THOUSAND * MINIMUM_POINTS &&
userData.usdValueOfSwaps >= BIGINT_HUNDRED_THOUSAND * MINIMUM_POINTS &&
!userData.first100kSwaps
) {
await Points.create({
Expand Down

0 comments on commit 8b2fd23

Please sign in to comment.