Skip to content

Commit 2002e8f

Browse files
authored
Merge pull request #53 from lidofinance/fix/avliable-repay
fix: mintable shares
2 parents 6cfc670 + 982be9a commit 2002e8f

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

features/adjustment/mint/mint-form-context/mint-form-provider.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ export const MintFormProvider: FC<{ children: ReactNode }> = ({ children }) => {
6565

6666
const mintData = useMemo(() => {
6767
const mintableStETH = activeVault?.mintableStETH ?? 0n;
68-
const mintableWstETH =
69-
(activeVault?.shareLimit ?? 0n) - (activeVault?.liabilityShares ?? 0n);
68+
const mintableWstETH = activeVault?.mintableShares ?? 0n;
7069

7170
return { mintableStETH, mintableWstETH };
7271
}, [activeVault]);

modules/vaults/hooks/use-vault-data.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ const getVaultData = async ({
6868
dashboardContract.read.getConfirmExpiry(),
6969
]);
7070

71+
const mintableShares = bigIntMax(totalMintingCapacity - liabilityShares, 0n);
72+
7173
const [liabilityStETH, mintableStETH, stETHLimit] = await Promise.all([
7274
shares.convertToSteth(liabilityShares),
73-
shares.convertToSteth(
74-
bigIntMax(totalMintingCapacity - liabilityShares, 0n),
75-
),
75+
shares.convertToSteth(mintableShares),
7676
shares.convertToSteth(shareLimit),
7777
]);
7878

@@ -91,6 +91,7 @@ const getVaultData = async ({
9191
totalValue,
9292
liabilityStETH,
9393
mintableStETH,
94+
mintableShares,
9495
stETHLimit,
9596
apr: null,
9697
healthScore: healthScore.healthRatio,

types/vault.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface VaultInfo extends VaultSocket {
1111
totalValue: bigint;
1212
liabilityStETH: bigint;
1313
mintableStETH: bigint;
14+
mintableShares: bigint;
1415
stETHLimit: bigint;
1516
apr: null;
1617
healthScore: number;

0 commit comments

Comments
 (0)