Skip to content

Commit

Permalink
Merge pull request #1169 from yieldprotocol/bugfix/RepayEulerPoolsDef…
Browse files Browse the repository at this point in the history
…aultsToClose

Bugfix/repay euler pools defaults to close
  • Loading branch information
brucedonovan authored Mar 28, 2023
2 parents b987766 + 3106ef3 commit f10a1d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app-v2",
"version": "2.5.14",
"version": "2.5.15",
"private": true,
"dependencies": {
"@ethersproject/providers": "^5.6.8",
Expand Down
15 changes: 8 additions & 7 deletions src/hooks/actionHooks/useRepayDebt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import useAllowAction from '../useAllowAction';

export const useRepayDebt = () => {
const {
settingsState: { slippageTolerance },
settingsState: { slippageTolerance, diagnostics },
} = useContext(SettingsContext);

const { userState, userActions } = useContext(UserContext);
Expand Down Expand Up @@ -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),
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/themes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ export const yieldTheme = {
placeholder: 'text-xweak',

lightBackground: {
dark: '#151515',
dark: '#202020',
light: '#FFFFFF',
},
background: {
dark: '#222222',
light: '#FFFFFF',
},
hoverBackground: {
dark: '#181818',
dark: '#282828',
light: '#FFFFFF',
},
selected: {
Expand Down

0 comments on commit f10a1d5

Please sign in to comment.