From 7cd7a373a9acf8a03ff1bac29b22680c3f808e3b Mon Sep 17 00:00:00 2001 From: amateima <89395931+amateima@users.noreply.github.com> Date: Tue, 29 Nov 2022 14:47:05 +0200 Subject: [PATCH] feat: filter out latest unprofitable pending deposits (#163) --- src/modules/deposit/service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/deposit/service.ts b/src/modules/deposit/service.ts index 85205fab..28124e7b 100644 --- a/src/modules/deposit/service.ts +++ b/src/modules/deposit/service.ts @@ -53,6 +53,7 @@ export class DepositService { .createQueryBuilder("d") .where("d.status = :status", { status }) .andWhere("d.depositDate > NOW() - INTERVAL '1 days'") + .andWhere("d.depositRelayerFeePct / power(10, 18) >= 0.0001") .orderBy("d.depositDate", "DESC") .take(limit) .skip(offset) @@ -95,5 +96,6 @@ export function formatDeposit(deposit: Deposit) { amount: deposit.amount, depositTxHash: deposit.depositTxHash, fillTxs: deposit.fillTxs.map(({ hash }) => hash), + depositRelayerFeePct: deposit.depositRelayerFeePct, }; }