diff --git a/package-lock.json b/package-lock.json index 4e5412a..c969a81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@debridge-finance/dln-taker", - "version": "3.2.3", + "version": "3.2.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@debridge-finance/dln-taker", - "version": "3.2.3", + "version": "3.2.4", "license": "GPL-3.0-only", "dependencies": { "@debridge-finance/dln-client": "8.3.3", diff --git a/package.json b/package.json index d2b190b..049e3cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@debridge-finance/dln-taker", - "version": "3.2.3", + "version": "3.2.4", "description": "DLN executor is the rule-based daemon service developed to automatically execute orders placed on the deSwap Liquidity Network (DLN) across supported blockchains", "license": "GPL-3.0-only", "author": "deBridge", diff --git a/src/chain-common/order-validator.ts b/src/chain-common/order-validator.ts index f0e63f5..5dee16f 100644 --- a/src/chain-common/order-validator.ts +++ b/src/chain-common/order-validator.ts @@ -52,7 +52,6 @@ export class OrderValidator extends OrderEvaluationContextual { await this.checkPrefulfillSwapAbility(); await this.checkTakeStatus(); - await this.checkGiveStatus(); await this.checkFilters(); await this.checkAccountBalance(); @@ -63,6 +62,12 @@ export class OrderValidator extends OrderEvaluationContextual { await this.checkRoughProfitability(); await this.runChecks(); + // check again in case order has been already fulfilled + await this.checkTakeStatus(); + + // security check: does the order exists? + await this.checkGiveStatus(); + return this.getOrderEstimator(); } @@ -268,7 +273,8 @@ export class OrderValidator extends OrderEvaluationContextual { orderId: this.order.orderId, giveChain: giveChainId, }, - { confirmationsCount: this.order.blockConfirmations }, + // solana-specific: we want to accept orders even in the "processed" commitment level + { confirmationsCount: 0 }, ); if (giveOrderStatus?.status === undefined) {