From 36f10ee8a7ccb9d72d1aff14f55ab2d603b84680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Brzezin=CC=81ski?= Date: Thu, 29 Feb 2024 17:31:00 +0100 Subject: [PATCH] fix repay + maxaccounts --- utils/transactions.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/transactions.ts b/utils/transactions.ts index 13a8bb1..2050703 100644 --- a/utils/transactions.ts +++ b/utils/transactions.ts @@ -133,9 +133,7 @@ export const unstakeAndSwap = async ( (stakeAmountToRepay ? toNativeI80F48(stakeAmountToRepay, stakeBank.mintDecimals) : borrowed.abs().div(stakeBank.getAssetPrice()) - ) - .add(I80F48.fromNumber(100)) - .toNumber(), + ).toNumber() * 1.002, ) console.log('borrowedSol amount: ', borrowed.toNumber()) @@ -758,6 +756,7 @@ const fetchJupiterRoutes = async ( amount: amount.toString(), slippageBps: Math.ceil(slippage * 100).toString(), feeBps: feeBps.toString(), + maxAccounts: '50', swapMode, onlyDirectRoutes: `${onlyDirectRoutes}`, }).toString()