Skip to content

Commit 8b69899

Browse files
committed
feat: Modify the way in which the 'profitabilityFactor' is applied
1 parent 587d234 commit 8b69899

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/submitter/queues/eval-queue.ts

+10-6
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,11 @@ export class EvalQueue extends ProcessingQueue<EvalOrder, SubmitOrder> {
289289
this.chainId
290290
);
291291

292-
const securedDeliveryReward = deliveryReward
293-
+ (maxAckLoss * this.profitabilityFactorBigInt) / DECIMAL_BASE_BIG_INT;
292+
const adjustedDevlieryReward = deliveryReward * DECIMAL_BASE_BIG_INT
293+
/ this.profitabilityFactorBigInt;
294+
295+
const securedDeliveryReward = adjustedDevlieryReward + maxAckLoss;
296+
294297
const securedDeliveryFiatReward = await this.getGasCostFiatPrice(
295298
securedDeliveryReward,
296299
bounty.fromChainId
@@ -302,8 +305,7 @@ export class EvalQueue extends ProcessingQueue<EvalOrder, SubmitOrder> {
302305
) / DECIMAL_BASE;
303306
const deliveryFiatReward = securedDeliveryFiatReward / securedRewardFactor;
304307

305-
const securedDeliveryFiatProfit = securedDeliveryFiatReward
306-
- deliveryFiatCost * this.evaluationConfig.profitabilityFactor;
308+
const securedDeliveryFiatProfit = securedDeliveryFiatReward - deliveryFiatCost;
307309
const securedDeliveryRelativeProfit = securedDeliveryFiatProfit / deliveryFiatCost;
308310

309311
const relayDelivery = (
@@ -368,8 +370,10 @@ export class EvalQueue extends ProcessingQueue<EvalOrder, SubmitOrder> {
368370
bounty.priceOfAckGas
369371
);
370372

371-
const ackProfit = ackReward
372-
- (ackCost * this.profitabilityFactorBigInt) / DECIMAL_BASE_BIG_INT; // ! In source chain gas value
373+
const adjustedAckReward = ackReward * DECIMAL_BASE_BIG_INT
374+
/ this.profitabilityFactorBigInt;
375+
376+
const ackProfit = adjustedAckReward - ackCost; // ! In source chain gas value
373377
const ackFiatProfit = await this.getGasCostFiatPrice(ackProfit, this.chainId);
374378
const ackRelativeProfit = Number(ackProfit) / Number(ackCost);
375379

0 commit comments

Comments
 (0)