Skip to content

Commit

Permalink
fix: bypass indexing arb transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
R-K-H committed Oct 22, 2024
1 parent e736c85 commit 1f02a6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/indexer/src/builders/swaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ export class SwapBuilder {
const mintIx = tx.instructions?.find(
(i) => i.name === "mintConditionalTokens"
);
const mergeIx = tx.instructions?.find((i) => i.name === "mergeConditionalTokensForUnderlyingTokens");
if (mergeIx && mintIx) {
console.error("ARB TRANSACTION DETECTED")
return Err({ type: SwapPersistableError.ArbTransactionError });
}
const result = await this.buildOrderFromSwapIx(swapIx, tx, mintIx);
if (!result.success) {
return Err(result.error);
Expand Down
1 change: 1 addition & 0 deletions packages/indexer/src/types/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export enum SwapPersistableError {
AlreadyPersistedSwap = "AlreadyPersistedSwap",
NonSwapTransaction = "NonSwapTransaction",
TransactionParseError = "TransactionParseError",
ArbTransactionError = "ArbTransactionError",
}

0 comments on commit 1f02a6a

Please sign in to comment.