Skip to content

Commit

Permalink
Unrestrict Advanced Page since functionality is same as borrow tab
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenshively committed Apr 15, 2024
1 parent 3a43ed0 commit 658d717
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion earn/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ function AppBodyWrapper() {
<Route path='/boost' element={<BoostPage />} />
<Route path='/boost/import/:tokenId' element={<ImportBoostPage />} />
<Route path='/boost/manage/:nftTokenId' element={<ManageBoostPage />} />
<Route path='/borrow' element={<AdvancedPage />} />
</>
)}
<Route path='/borrow' element={<AdvancedPage />} />
<Route path='/' element={<Navigate replace to='/markets' />} />
<Route path='*' element={<Navigate to='/' />} />
</Routes>
Expand Down
21 changes: 12 additions & 9 deletions earn/src/components/advanced/modal/BorrowModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,18 @@ export default function BorrowModal(props: BorrowModalProps) {
}

// TODO: use GN
const maxBorrowsBasedOnHealth = maxBorrowAndWithdraw(
borrower.assets,
borrower.liabilities,
borrower.sqrtPriceX96,
borrower.iv,
borrower.nSigma,
borrower.token0.decimals,
borrower.token1.decimals
)[isToken0 ? 0 : 1];
const maxBorrowsBasedOnHealth = Math.max(
0,
maxBorrowAndWithdraw(
borrower.assets,
borrower.liabilities,
borrower.sqrtPriceX96,
borrower.iv,
borrower.nSigma,
borrower.token0.decimals,
borrower.token1.decimals
)[isToken0 ? 0 : 1]
);

const max = Math.min(
maxBorrowsBasedOnHealth,
Expand Down
2 changes: 1 addition & 1 deletion earn/src/pages/MarketsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import BorrowingWidget from '../components/markets/borrow/BorrowingWidget';
import InfoTab from '../components/markets/monitor/InfoTab';
import SupplyTable, { SupplyTableRow } from '../components/markets/supply/SupplyTable';
import { BorrowerNftBorrower, fetchListOfFuse2BorrowNfts } from '../data/BorrowerNft';
import { ZERO_ADDRESS } from '../data/constants/Addresses';
import { API_PRICE_RELAY_LATEST_URL } from '../data/constants/Values';
import { useLendingPairs } from '../data/hooks/UseLendingPairs';
import { getLendingPairBalances, LendingPairBalancesMap } from '../data/LendingPair';
import { fetchBorrowerDatas, UniswapPoolInfo } from '../data/MarginAccount';
import { PriceRelayLatestResponse } from '../data/PriceRelayResponse';
import { getProminentColor } from '../util/Colors';
import { ZERO_ADDRESS } from '../data/constants/Addresses';

const SECONDARY_COLOR = 'rgba(130, 160, 182, 1)';
const SELECTED_TAB_KEY = 'selectedTab';
Expand Down
9 changes: 5 additions & 4 deletions shared/src/data/constants/ChainSpecific.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,17 @@ export const ETH_RESERVED_FOR_GAS: { [chainId: number]: GN } = {
[base.id]: GN.fromDecimalString('0.005', 18),
};

// TODO: better way of doing this so we don't forget to update it
export const MANAGER_NAME_MAP: { [manager: Address]: string } = {
'0xBb5A35B80b15A8E5933fDC11646A20f6159Dd061': 'SimpleManager',
'0x2b7E3A41Eac757CC1e8e9E61a4Ad5C9D6421516e': 'BorrowerNFTMultiManager',
'0xA07FD687882FfE7380A044e7542bDAc6F8672Bf7': 'BorrowerNFTSimpleManager',
'0xe1Bf15D99330E684020622856916F854c9322CB6': 'BorrowerNFTWithdrawManager',
'0x3EE236D69F6950525ff317D7a872439F09902C65': 'UniswapNFTManager',
'0x7357E37a60839DE89A52861Cf50851E317FFBE71': 'UniswapNFTManager',
'0xeDE551885bC51C46Bb0da6AD0b6268396EB8aeBf': 'UniswapNFTManager',
'0xe56B8a872bf924Ed06929cEA57EFb1FeA58CbFB7': 'UniswapNFTManager',
'0x3Bb9F64b0e6b15dD5792A008c06E5c4Dc9d23D8f': 'FrontendManager',
'0xB6B7521cd3bd116432FeD94c2262Dd02BA616Db4': 'BoostManager',
'0x8E287b280671700EBE66A908A56C648f930b73b4': 'BoostManager',
'0xB08f5f4b1B9eE99e82353c9B4B499f46d98db1B5': 'BoostManager',
'0xC3ac51872F017cf23a815F6A952e612cB69C5482': 'BoostManager',
'0x6BDa468b1d473028938585a04eC3c62dcFF5309B': 'Permit2Manager',
};

Expand Down

0 comments on commit 658d717

Please sign in to comment.