diff --git a/solend-lite/src/components/TransactionTakeover/TransactionTakeover.tsx b/solend-lite/src/components/TransactionTakeover/TransactionTakeover.tsx index f3c4eba5..eb18bd3f 100644 --- a/solend-lite/src/components/TransactionTakeover/TransactionTakeover.tsx +++ b/solend-lite/src/components/TransactionTakeover/TransactionTakeover.tsx @@ -257,9 +257,9 @@ export default function TransactionTakeover() { setValue={setValue} onSubmit={() => { if (publicKey && selectedReserve && selectedPool) { - const useMax = selectedObligation?.borrows - ?.find((b) => b.reserveAddress === selectedReserve.address) - ?.amount.isGreaterThanOrEqualTo(new BigNumber(value)); + const useMax = new BigNumber(value).isGreaterThanOrEqualTo( + repayMax, + ); return repayConfigs.action( useMax diff --git a/solend-lite/src/stores/config.ts b/solend-lite/src/stores/config.ts index de39f73e..7cd72738 100644 --- a/solend-lite/src/stores/config.ts +++ b/solend-lite/src/stores/config.ts @@ -6,8 +6,5 @@ import { ENVIRONMENT, DEBUG_MODE } from 'common/config'; export const configAtom = atom(async (get) => { const connection = get(connectionAtom); - const a = await fetchPoolMetadata(connection, ENVIRONMENT, true, DEBUG_MODE); - - console.log(a); - return a; + return fetchPoolMetadata(connection, ENVIRONMENT, true, DEBUG_MODE); }); diff --git a/solend-sdk/package.json b/solend-sdk/package.json index 645842cd..9b0aee2c 100644 --- a/solend-sdk/package.json +++ b/solend-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@solendprotocol/solend-sdk", - "version": "0.6.48", + "version": "0.6.50", "private": true, "main": "src/index.ts", "module": "src/index.ts", diff --git a/solend-sdk/src/core/utils/config.ts b/solend-sdk/src/core/utils/config.ts index 000cde41..32463709 100644 --- a/solend-sdk/src/core/utils/config.ts +++ b/solend-sdk/src/core/utils/config.ts @@ -37,22 +37,25 @@ export async function fetchPoolMetadata( address: string; owner: string; authorityAddress: string; - reserves: Array<{liquidityToken: { - name: string, - logo: string, - mint: string, - }, address: string}>; + reserves: Array<{ + liquidityToken: { + name: string; + logo: string; + mint: string; + }; + address: string; + }>; }) => ({ name: titleCase(c.name), owner: c.owner, address: c.address, authorityAddress: c.authorityAddress, - reserves: c.reserves.map(r => ({ + reserves: c.reserves.map((r) => ({ name: r.liquidityToken.name, logo: r.liquidityToken.logo, mintAddress: r.liquidityToken.mint, address: r.address, - })) + })), }) ); } catch (e) { diff --git a/solend-sdk/src/instructions/updateReserveConfig.ts b/solend-sdk/src/instructions/updateReserveConfig.ts index fdd9fca1..6d7ee941 100644 --- a/solend-sdk/src/instructions/updateReserveConfig.ts +++ b/solend-sdk/src/instructions/updateReserveConfig.ts @@ -69,14 +69,14 @@ export const updateReserveConfig = ( minBorrowRate: reserveConfig.minBorrowRate, optimalBorrowRate: reserveConfig.optimalBorrowRate, maxBorrowRate: reserveConfig.maxBorrowRate, + superMaxBorrowRate: reserveConfig.superMaxBorrowRate, borrowFeeWad: reserveConfig.fees.borrowFeeWad, flashLoanFeeWad: reserveConfig.fees.flashLoanFeeWad, hostFeePercentage: reserveConfig.fees.hostFeePercentage, depositLimit: reserveConfig.depositLimit, borrowLimit: reserveConfig.borrowLimit, feeReceiver: reserveConfig.feeReceiver, - superMaxBorrowRate: reserveConfig.superMaxBorrowRate, - protocolLiquidationFee: reserveConfig.protocolLiquidationFee, + protocolLiquidationFee: reserveConfig.protocolLiquidationFee * 10, protocolTakeRate: reserveConfig.protocolTakeRate, addedBorrowWeightBPS: reserveConfig.addedBorrowWeightBPS, reserveType: reserveConfig.reserveType,