Skip to content

Commit

Permalink
fix: broken sbtc supply cap check
Browse files Browse the repository at this point in the history
  • Loading branch information
alexp3y committed Dec 21, 2024
1 parent 7660e93 commit 2c772be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/pages/swap/hooks/use-swap-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ export function useSwapForm() {

const remainingSbtcPegCapSupply = useMemo(() => {
const sBtcPegCap = sBtcLimits?.pegCap;
if (!sBtcPegCap) return;
if (!sBtcPegCap || !supply) return;
const currentSupplyValue = supply?.result && cvToValue(hexToCV(supply?.result));
return convertAmountToFractionalUnit(
createMoney(new BigNumber(Number(sBtcPegCap - currentSupplyValue)), 'BTC', BTC_DECIMALS)
createMoney(new BigNumber(Number(sBtcPegCap - currentSupplyValue.value)), 'BTC', BTC_DECIMALS)
);
}, [sBtcLimits?.pegCap, supply?.result]);
}, [sBtcLimits?.pegCap, supply]);

const sBtcDepositCapMin = createMoney(
new BigNumber(sBtcLimits?.perDepositMinimum ?? defaultSbtcLimits.perDepositMinimum),
Expand Down

0 comments on commit 2c772be

Please sign in to comment.