Skip to content

Commit

Permalink
Merge pull request #157 from ionicprotocol/development
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
rhlsthrm authored Feb 1, 2024
2 parents 8e24130 + 585bb5f commit d4922a5
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 57 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/deploy-bots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,17 @@ jobs:
working-directory: ./ops
run: make liquidator-smoke-test

- name: run smoke tests for feed verifier
working-directory: ./ops
run: make feed-verifier-smoke-test
# - name: run smoke tests for feed verifier
# working-directory: ./ops
# run: make feed-verifier-smoke-test

- name: run smoke tests for price verifier
working-directory: ./ops
run: make price-verifier-smoke-test
# - name: run smoke tests for price verifier
# working-directory: ./ops
# run: make price-verifier-smoke-test

- name: run smoke tests for price change verifier
working-directory: ./ops
run: make price-change-verifier-smoke-test
# - name: run smoke tests for price change verifier
# working-directory: ./ops
# run: make price-change-verifier-smoke-test

terraform-deploy-bots:
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/development'
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/tasks/market/risk/supply-caps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default task("market:set-supply-cap", "Pauses borrowing on a market")
await tx.wait();

const newSupplyCapSet = await pool.callStatic.supplyCaps(cToken.address);
console.log(`New supply cap set: ${newSupplyCapSet.toNumber()}`);
console.log(`New supply cap set: ${newSupplyCapSet.toString()}`);
});

task("market:set-supply-cap-whitelist", "Pauses borrowing on a market")
Expand Down
40 changes: 28 additions & 12 deletions packages/ui/app/_components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,28 @@ export default function Navbar() {
: ' hidden md:flex md:items-center md:justify-center my-auto gap-1 text-sm'
}`}
>
{/* <Link href={`/dashboard`}>
<Link
href={'/'}
className="pointer-events-none relative"
>
<span className="absolute px-[5px] top-[90%] right-[50%] translate-x-1/2 bg-lime rounded-lg text-xxs text-darkone whitespace-nowrap ">
Soon!
</span>
<p
className={`${
pathname == '/points' ? 'text-accent' : null
} px-4 text-center transition-all duration-200 ease-linear rounded-md cursor-pointer `}
>
Points
</p>
</Link>
<Link
href={'/'}
className="pointer-events-none relative"
>
<span className="absolute px-[5px] top-[90%] right-[50%] translate-x-1/2 bg-lime rounded-lg text-xxs text-darkone whitespace-nowrap ">
Soon!
</span>
<p
className={`${
pathname == '/dashboard' ? 'text-accent' : null
Expand All @@ -72,7 +93,7 @@ export default function Navbar() {
Dashboard
</p>
</Link>
<Link href={`/lend`}>
{/* <Link href={`/lend`}>
<p
className={` ${
pathname == '/lend' ? 'text-accent' : null
Expand Down Expand Up @@ -100,20 +121,15 @@ export default function Navbar() {
</p>
</Link>
*/}

<Link
href={'/'}
className="pointer-events-none relative"
className="relative"
href="https://app.mode.network/"
target="_blank"
>
<span className="absolute px-[5px] top-[90%] right-[50%] translate-x-1/2 bg-lime rounded-lg text-xxs text-darkone whitespace-nowrap ">
Soon!
</span>
<p
className={`${
pathname == '/points' ? 'text-accent' : null
} px-4 text-center transition-all duration-200 ease-linear rounded-md cursor-pointer `}
className={`hover:text-accent px-4 text-center transition-all duration-200 ease-linear rounded-md cursor-pointer`}
>
Points
Bridge
</p>
</Link>
</div>
Expand Down
68 changes: 37 additions & 31 deletions packages/ui/app/_components/popup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useTotalSupplyAPYs } from '@ui/hooks/useTotalSupplyAPYs';
import { MarketData } from '@ui/types/TokensDataMap';
import { getBlockTimePerMinuteByChainId } from '@ui/utils/networkData';
import { BigNumber, constants, utils } from 'ethers';
import { formatUnits, parseUnits } from 'ethers/lib/utils.js';
import { formatEther, formatUnits, parseUnits } from 'ethers/lib/utils.js';
import { useRouter } from 'next/navigation';
import { useEffect, useMemo, useReducer, useRef, useState } from 'react';
import toast from 'react-hot-toast';
Expand Down Expand Up @@ -219,48 +219,54 @@ const Popup = ({
*/
useEffect(() => {
switch (active) {
case 'COLLATERAL':
setCurrentUtilizationPercentage(
Math.round(
(amountAsBInt.toNumber() /
(maxSupplyAmount?.bigNumber.toNumber() ?? 1)) *
100
)
);
case 'COLLATERAL': {
const div =
Number(formatEther(amountAsBInt)) /
(maxSupplyAmount?.bigNumber
? Number(formatEther(maxSupplyAmount?.bigNumber))
: 1);
setCurrentUtilizationPercentage(Math.round(div * 100));

break;
}

case 'WITHDRAW':
setCurrentUtilizationPercentage(
Math.round(
(amountAsBInt.toNumber() / (maxWithdrawAmount?.toNumber() ?? 1)) *
100
)
);
case 'WITHDRAW': {
const div =
Number(formatEther(amountAsBInt)) /
(maxWithdrawAmount ? Number(formatEther(maxWithdrawAmount)) : 1);
setCurrentUtilizationPercentage(Math.round(div * 100));

break;
}

case 'BORROW':
setCurrentUtilizationPercentage(
Math.round(
(amountAsBInt.toNumber() /
(maxBorrowAmount?.bigNumber.toNumber() ?? 1)) *
100
)
);
case 'BORROW': {
const div =
Number(formatEther(amountAsBInt)) /
(maxBorrowAmount?.bigNumber
? Number(formatEther(maxBorrowAmount?.bigNumber))
: 1);
setCurrentUtilizationPercentage(Math.round(div * 100));

break;
}

case 'REPAY':
setCurrentUtilizationPercentage(
Math.round(
(amountAsBInt.toNumber() / (maxRepayAmount?.toNumber() ?? 1)) * 100
)
);
case 'REPAY': {
const div =
Number(formatEther(amountAsBInt)) /
(maxRepayAmount ? Number(formatEther(maxRepayAmount)) : 1);
setCurrentUtilizationPercentage(Math.round(div * 100));

break;
}
}
}, [amountAsBInt]);
}, [
amountAsBInt,
active,
maxBorrowAmount?.bigNumber,
maxRepayAmount,
maxSupplyAmount?.bigNumber,
maxWithdrawAmount
]);

useEffect(() => {
if (mode === 'DEFAULT' || 'SUPPLY') {
Expand Down
8 changes: 4 additions & 4 deletions packages/ui/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default function Market() {
val.underlyingDecimals
)
).toLocaleString('en-US', {
maximumFractionDigits: 6
maximumFractionDigits: 2
})
: '0'
} ${
Expand All @@ -209,7 +209,7 @@ export default function Market() {
? parseFloat(
formatUnits(val.liquidity, val.underlyingDecimals)
).toLocaleString('en-US', {
maximumFractionDigits: 6
maximumFractionDigits: 2
})
: '0'
} ${
Expand All @@ -225,7 +225,7 @@ export default function Market() {
val.underlyingDecimals
)
).toLocaleString('en-US', {
maximumFractionDigits: 6
maximumFractionDigits: 2
})
: '0'
} ${
Expand All @@ -238,7 +238,7 @@ export default function Market() {
? parseFloat(
formatUnits(val.totalBorrow, val.underlyingDecimals)
).toLocaleString('en-US', {
maximumFractionDigits: 6
maximumFractionDigits: 2
})
: '0'
} ${
Expand Down

0 comments on commit d4922a5

Please sign in to comment.