Skip to content

Commit

Permalink
Merge branch 'main' into feat/migrateCVXPositions
Browse files Browse the repository at this point in the history
  • Loading branch information
jarbacoa authored Mar 16, 2022
2 parents 5abb55a + 65f3549 commit 70b179c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/pages/Fuse/FusePoolPage/BorrowList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
} from "hooks/rewards/usePoolIncentives";

// Utils
import { convertMantissaToAPY } from "utils/apyUtils";
import { convertMantissaToAPR, convertMantissaToAPY } from "utils/apyUtils";
import { shortUsdFormatter, smallUsdFormatter } from "utils/bigUtils";
import { useCreateComptroller } from "utils/createComptroller";
import { USDPricedFuseAsset } from "utils/fetchFusePoolData";
Expand Down Expand Up @@ -253,7 +253,7 @@ export const BorrowList = ({

const tokenData = useTokenData(asset.underlyingToken);

const borrowAPY = convertMantissaToAPY(asset.borrowRatePerBlock, 365);
const borrowAPR = convertMantissaToAPR(asset.borrowRatePerBlock);

const { t } = useTranslation();

Expand Down Expand Up @@ -335,7 +335,7 @@ export const BorrowList = ({
fontWeight="bold"
fontSize="17px"
>
{borrowAPY.toFixed(2)}%
{borrowAPR.toFixed(2)}%
</Text>

{/* Demo Borrow Incentives */}
Expand Down
12 changes: 10 additions & 2 deletions src/components/pages/Fuse/Modals/CVXMigrateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ import { checkAllowanceAndApprove, collateralize, deposit, unstakeAndWithdrawCVX
import { handleGenericError } from "utils/errorHandling"
import { USDPricedFuseAsset } from "utils/fetchFusePoolData"



export const CVXMigrateModal = ({
isOpen,
onClose,
Expand Down Expand Up @@ -135,6 +133,7 @@ export const CVXMigrateModal = ({
const newTotalSupply = useTotalSupply(updatedUserAssets ?? [])



/* Unstakes and Claims all CVX Staked Positions supported by Fuse */
const handleUnstake = async () => {
const { stakedBalance } = marketBalanceForAsset
Expand All @@ -148,6 +147,7 @@ export const CVXMigrateModal = ({
}
} catch (err) {
setActiveStep(undefined)

handleGenericError(err, toast)
}
}
Expand All @@ -163,6 +163,7 @@ export const CVXMigrateModal = ({
setStep(3)
} catch (err) {
setActiveStep(undefined)

handleGenericError(err, toast)
}
}
Expand All @@ -178,6 +179,7 @@ export const CVXMigrateModal = ({
setStep(4)
} catch (err) {
setActiveStep(undefined)

handleGenericError(err, toast)
}
}
Expand All @@ -192,6 +194,7 @@ export const CVXMigrateModal = ({
setStep(5)
} catch (err) {
setActiveStep(undefined)

handleGenericError(err, toast)
}
}
Expand All @@ -215,6 +218,7 @@ export const CVXMigrateModal = ({
}, [assetIndex])



return (
<>
<Modal isOpen={isOpen} onClose={onClose}>
Expand All @@ -227,6 +231,7 @@ export const CVXMigrateModal = ({
Migrate Staked CVX Positions to Fuse
</Text>
</HStack>

<ModalCloseButton />
</ModalHeader>
<ModalBody>
Expand Down Expand Up @@ -284,6 +289,7 @@ export const CVXMigrateModal = ({
</HStack>
)}


<HStack>
<Text>
3.)
Expand All @@ -308,6 +314,7 @@ export const CVXMigrateModal = ({

{step === 5 && <Text>Done!</Text>}


</VStack>
</Flex>
</ModalBody>
Expand Down Expand Up @@ -365,4 +372,5 @@ const Market = ({




export default CVXMigrateModal

0 comments on commit 70b179c

Please sign in to comment.