diff --git a/package.json b/package.json index 3eae3268d..6bbd19a6f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app-v2", - "version": "2.5.14", + "version": "2.5.15", "private": true, "dependencies": { "@ethersproject/providers": "^5.6.8", diff --git a/src/hooks/actionHooks/useRepayDebt.ts b/src/hooks/actionHooks/useRepayDebt.ts index 892c07f7d..eaca59a12 100644 --- a/src/hooks/actionHooks/useRepayDebt.ts +++ b/src/hooks/actionHooks/useRepayDebt.ts @@ -22,7 +22,7 @@ import useAllowAction from '../useAllowAction'; export const useRepayDebt = () => { const { - settingsState: { slippageTolerance }, + settingsState: { slippageTolerance, diagnostics }, } = useContext(SettingsContext); const { userState, userActions } = useContext(UserContext); @@ -79,7 +79,8 @@ export const useRepayDebt = () => { const cleanInput = cleanValue(input, base.decimals); const _input = input ? ethers.utils.parseUnits(cleanInput, base.decimals) : ethers.constants.Zero; - const _maxSharesIn = maxBaseIn( + const _maxSharesIn = series.sharesReserves.eq(ZERO_BN) ? ZERO_BN + : maxBaseIn( series.sharesReserves, series.fyTokenReserves, getTimeTillMaturity(series.maturity), @@ -90,12 +91,12 @@ export const useRepayDebt = () => { series.mu ); - /* Check the max amount of the trade that the pool can handle */ - const tradeIsNotPossible = series.getShares(_input).gt(_maxSharesIn); + /* Check if the trade of that size is possible */ + const tradeIsNotPossible = series.getShares(_input).gt(_maxSharesIn); - tradeIsNotPossible && console.log('trade is not possible:'); - tradeIsNotPossible && console.log('input', _input.toString()); - tradeIsNotPossible && console.log('Max base in:', _maxSharesIn.toString()); + diagnostics && tradeIsNotPossible ? console.log('Trade is not possible:'): console.log('Trade is possible:') + diagnostics && tradeIsNotPossible && console.log('Trade input', _input.toString()); + diagnostics && tradeIsNotPossible && console.log('TradeMax base in:', _maxSharesIn.toString()); const _inputAsFyToken = isMature(series.maturity) ? _input diff --git a/src/themes/index.ts b/src/themes/index.ts index ced63fde5..a75fad9c0 100644 --- a/src/themes/index.ts +++ b/src/themes/index.ts @@ -67,7 +67,7 @@ export const yieldTheme = { placeholder: 'text-xweak', lightBackground: { - dark: '#151515', + dark: '#202020', light: '#FFFFFF', }, background: { @@ -75,7 +75,7 @@ export const yieldTheme = { light: '#FFFFFF', }, hoverBackground: { - dark: '#181818', + dark: '#282828', light: '#FFFFFF', }, selected: {