From 59ad9fc2e7f293b9ba877a078a8ab1b18d2f9269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Brzezin=CC=81ski?= Date: Thu, 21 Mar 2024 11:57:39 +0100 Subject: [PATCH] imit fee --- store/mangoStore.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/store/mangoStore.ts b/store/mangoStore.ts index 1fa40d6..ec8fcc9 100644 --- a/store/mangoStore.ts +++ b/store/mangoStore.ts @@ -7,6 +7,7 @@ import { ConfirmOptions, Connection, Keypair, + LAMPORTS_PER_SOL, PublicKey, RecentPrioritizationFees, } from '@solana/web3.js' @@ -883,7 +884,10 @@ const mangoStore = create()( : (recentFees[mid - 1].prioritizationFee + recentFees[mid].prioritizationFee) / 2 - const feeEstimate = Math.ceil(medianFee * feeMultiplier) + const feeEstimate = Math.min( + Math.ceil(medianFee * feeMultiplier), + LAMPORTS_PER_SOL * 0.01, + ) const provider = client.program.provider as AnchorProvider provider.opts.skipPreflight = true