forked from DistributedCollective/sovryn-dapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Saf 20/pool details integration graphs stats (#42)
* cleanup * fixes * fixes. Connect provider. Fix repay adding proper allowance. Fix switch collateral token.address instead of token * refetch user data based on blocknumber * fix modal closing on lending positions change plus style adjustments * fix withdraw modals * modal fixes * fix calculation add balances and filter zero balances * use memo items * fix dependencies * data normalizers * Apply suggestions from code review Co-authored-by: Juan <[email protected]> * Update apps/frontend/src/app/5_pages/AavePage/components/LendAssetsList/components/LendAssetAction/LendAssetAction.tsx Co-authored-by: Juan <[email protected]> * Update apps/frontend/src/app/5_pages/AavePage/components/LendPositionsList/LendPositionsList.constants.tsx Co-authored-by: Juan <[email protected]> * wip refactor done. Missing hooks merge * implementations and cleanup * cleanup * cleanup * math safety * more math safety * cleanup * clenaup * emode mocks * enable emode working * emode working * fixes and cleanup * remove whitelist * toggle lend mode working * fixes and cleanup * add collateral check * fix collateral * fixes * Fix. Missing fix on borrow. * fix borrow power to match desired collateral ratio * rollback to working contracts for borrow eth * fixes * fixes and max amount * loading when account changes * close emode on complete * disable emode if just one category * error handling * fixes. Connect provider. Fix repay adding proper allowance. Fix switch collateral token.address instead of token * refetch user data based on blocknumber * fix calculation add balances and filter zero balances * [SAF-20] wip testing rates data from contract Reserve Rate Strategy * [SAF-20] wip integrating useAaveRates hook * [SAF-20] fix hook useAaveRates * [SAF_20] fix: parse totalDebt using decimals * Connect topbar, add token links and add to wallet (#37) * connect topbar * tokens links * add link to oracle * Money Market Mockups (DistributedCollective#990) * aave page static components, mobile first * responsive panels * functional static borrow asset list * cleanup * renaming * lend assets list * Lend positions list * fixes and cleanup * cleanup * cleanup * cleanup * static ui done. missing validations * add validations * add validations * move errors down * borrow form modal * pr comments * pr comments * fix typo * Update apps/frontend/src/app/5_pages/AavePage/components/LendPositionsList/components/LendPositionAction/LendPositionAction.tsx Co-authored-by: Juan Dahl <[email protected]> * repay modals * lend modal * use simple table row * asset amount input * add missing translations * fix translation * units and prices mock * setup layout for pool details screen * wallet overview panel * emode card mock * max with for emode category * top bar mock * network switch * cleanup * ui fixes * ui fixes, usd prices * Efficiency card * ordering * fix filter 0 balances checkbox * pr comment * token * Mocked table cards plus refactor of statistics card (#14) * mocked table cards plus refactor of statistics card * ui fixes * Saf 41 charts (#16) * mocked table cards plus refactor of statistics card * ui fixes * [SAF-41] give each graph it's own chart component * [SAF-41] add htmlLegend plugin in charts; remove comments and refactor some colors moving them to constants --------- Co-authored-by: matzapata <[email protected]> * removed view transactions button (out of scope) * fix breakpoints * [SAF-41] fix color constant and background for mobile vs desktop views (#20) * [SAF-41] fix color constant and background for mobile vs desktop views * [SAF-41] use theme variables for colors and breakpoint usage for better consistency * Apply suggestions from code review Co-authored-by: Juan Dahl <[email protected]> --------- Co-authored-by: Juan Dahl <[email protected]> * Update apps/frontend/package.json Co-authored-by: Pietro <[email protected]> * Update apps/frontend/src/app/2_molecules/AmountTransition/AmountTransition.tsx Co-authored-by: Pietro <[email protected]> * Update apps/frontend/src/app/2_molecules/AssetAmountPriceRenderer/AssetAmountPriceRenderer.tsx Co-authored-by: Pietro <[email protected]> * Update apps/frontend/src/app/2_molecules/NetworkSwitch/NetworkSwitch.tsx Co-authored-by: Pietro <[email protected]> * Update apps/frontend/src/app/5_pages/AaveReserveOverviewPage/components/EModeDetails/EModeDetails.tsx Co-authored-by: Pietro <[email protected]> * Update apps/frontend/src/app/5_pages/AaveReserveOverviewPage/components/SupplyDetailsGraph/SupplyDetailsGraph.tsx Co-authored-by: Pietro <[email protected]> * Update apps/frontend/src/app/5_pages/AaveReserveOverviewPage/components/SupplyDetailsGraph/SupplyDetailsGraph.tsx Co-authored-by: Pietro <[email protected]> * Apply suggestions from code review Co-authored-by: Pietro <[email protected]> * remove LinkIcon * Apply suggestions from code review Co-authored-by: Pietro <[email protected]> * Apply suggestions from code review Co-authored-by: Pietro <[email protected]> * Apply suggestions from code review Co-authored-by: Pietro <[email protected]> * pr comments * fixes --------- Co-authored-by: matzapata <[email protected]> Co-authored-by: Matias Zapata <[email protected]> Co-authored-by: Juan Dahl <[email protected]> Co-authored-by: Luciano Perez Cerra <[email protected]> Co-authored-by: Pietro <[email protected]> * chore: cleanup * connected graphs * cleanup * cleanup * cleanup --------- Co-authored-by: Juan <[email protected]> Co-authored-by: Luciano Perez Cerra <[email protected]> Co-authored-by: Christian Escalante <[email protected]> Co-authored-by: Luciano Perez Cerra <[email protected]> Co-authored-by: Pietro <[email protected]> Co-authored-by: Pietro <[email protected]>
- Loading branch information
1 parent
d884245
commit 7b72932
Showing
61 changed files
with
1,436 additions
and
451 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...p/5_pages/AavePage/components/BorrowAssetsList/components/BorrowModal/BorrowForm.utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { MINIMUM_COLLATERAL_RATIO_LENDING_POOLS } from '../../../../../../../constants/lending'; | ||
|
||
export const getCollateralRatioThresholds = () => { | ||
// TODO: recheck this and adjust based on aave | ||
const minimumCollateralRatio = | ||
MINIMUM_COLLATERAL_RATIO_LENDING_POOLS.mul(100); | ||
|
||
return { | ||
START: minimumCollateralRatio.mul(0.9).toNumber(), | ||
MIDDLE_START: minimumCollateralRatio.toNumber() - 0.1, | ||
MIDDLE_END: minimumCollateralRatio.mul(1.2).toNumber(), | ||
END: minimumCollateralRatio.mul(1.6).toNumber(), | ||
}; | ||
}; |
28 changes: 28 additions & 0 deletions
28
...ages/AavePage/components/BorrowAssetsList/components/BorrowModal/BorrowModalContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React, { FC } from 'react'; | ||
|
||
import { t } from 'i18next'; | ||
|
||
import { Dialog, DialogBody, DialogHeader } from '@sovryn/ui'; | ||
|
||
import { translations } from '../../../../../../../locales/i18n'; | ||
import { BorrowForm } from './BorrowForm'; | ||
|
||
type BorrowModalContainerProps = { | ||
isOpen: boolean; | ||
handleCloseModal: () => void; | ||
}; | ||
|
||
export const BorrowModalContainer: FC<BorrowModalContainerProps> = ({ | ||
isOpen, | ||
handleCloseModal, | ||
}) => ( | ||
<Dialog disableFocusTrap isOpen={isOpen}> | ||
<DialogHeader | ||
title={t(translations.aavePage.common.borrow)} | ||
onClose={handleCloseModal} | ||
/> | ||
<DialogBody className="flex flex-col gap-6"> | ||
<BorrowForm onSuccess={handleCloseModal} /> | ||
</DialogBody> | ||
</Dialog> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.