fix repay + maxaccounts
This commit is contained in:
parent
2993fa69b8
commit
36f10ee8a7
|
@ -133,9 +133,7 @@ export const unstakeAndSwap = async (
|
||||||
(stakeAmountToRepay
|
(stakeAmountToRepay
|
||||||
? toNativeI80F48(stakeAmountToRepay, stakeBank.mintDecimals)
|
? toNativeI80F48(stakeAmountToRepay, stakeBank.mintDecimals)
|
||||||
: borrowed.abs().div(stakeBank.getAssetPrice())
|
: borrowed.abs().div(stakeBank.getAssetPrice())
|
||||||
)
|
).toNumber() * 1.002,
|
||||||
.add(I80F48.fromNumber(100))
|
|
||||||
.toNumber(),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
console.log('borrowedSol amount: ', borrowed.toNumber())
|
console.log('borrowedSol amount: ', borrowed.toNumber())
|
||||||
|
@ -758,6 +756,7 @@ const fetchJupiterRoutes = async (
|
||||||
amount: amount.toString(),
|
amount: amount.toString(),
|
||||||
slippageBps: Math.ceil(slippage * 100).toString(),
|
slippageBps: Math.ceil(slippage * 100).toString(),
|
||||||
feeBps: feeBps.toString(),
|
feeBps: feeBps.toString(),
|
||||||
|
maxAccounts: '50',
|
||||||
swapMode,
|
swapMode,
|
||||||
onlyDirectRoutes: `${onlyDirectRoutes}`,
|
onlyDirectRoutes: `${onlyDirectRoutes}`,
|
||||||
}).toString()
|
}).toString()
|
||||||
|
|
Loading…
Reference in New Issue