From 74908c3c6527865c5df5f25ae03ffe320ec1d6d2 Mon Sep 17 00:00:00 2001 From: Chris Heaney Date: Wed, 27 Dec 2023 10:56:45 -0600 Subject: [PATCH] filler: floor priority fee other places --- src/bots/filler.ts | 18 +++++++++++------- src/bots/spotFiller.ts | 8 +++++--- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/bots/filler.ts b/src/bots/filler.ts index 48aade15..2a112c9d 100644 --- a/src/bots/filler.ts +++ b/src/bots/filler.ts @@ -1438,9 +1438,11 @@ export class FillerBot implements Bot { units: 1_400_000, }), ComputeBudgetProgram.setComputeUnitPrice({ - microLamports: Math.min( - this.priorityFeeSubscriber.maxPriorityFee * 1.2, - MAX_COMPUTE_UNIT_PRICE_MICRO_LAMPORTS + microLamports: Number( + Math.min( + Math.floor(this.priorityFeeSubscriber.maxPriorityFee * 1.2), + MAX_COMPUTE_UNIT_PRICE_MICRO_LAMPORTS + ) ), }), ]; @@ -1501,10 +1503,12 @@ export class FillerBot implements Bot { units: 1_400_000, }), ComputeBudgetProgram.setComputeUnitPrice({ - microLamports: Number(Math.min( - Math.floor(this.priorityFeeSubscriber.maxPriorityFee * 1.2), - MAX_COMPUTE_UNIT_PRICE_MICRO_LAMPORTS - )), + microLamports: Number( + Math.min( + Math.floor(this.priorityFeeSubscriber.maxPriorityFee * 1.2), + MAX_COMPUTE_UNIT_PRICE_MICRO_LAMPORTS + ) + ), }), ]; diff --git a/src/bots/spotFiller.ts b/src/bots/spotFiller.ts index 0cdb2a39..c57f8f84 100644 --- a/src/bots/spotFiller.ts +++ b/src/bots/spotFiller.ts @@ -1139,9 +1139,11 @@ export class SpotFillerBot implements Bot { units: 1_400_000, }), ComputeBudgetProgram.setComputeUnitPrice({ - microLamports: Math.min( - this.priorityFeeSubscriber.maxPriorityFee * 1.2, - MAX_COMPUTE_UNIT_PRICE_MICRO_LAMPORTS + microLamports: Number( + Math.min( + Math.floor(this.priorityFeeSubscriber.maxPriorityFee * 1.2), + MAX_COMPUTE_UNIT_PRICE_MICRO_LAMPORTS + ) ), }), ];