File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
packages/frontend/src/state/lp Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -94,10 +94,11 @@ export const useClosePosition = () => {
94
94
)
95
95
return
96
96
97
- const shortAmount = fromTokenAmount ( vaultBefore . shortAmount , OSQUEETH_DECIMALS )
98
- const debtInEth = await getDebtAmount ( shortAmount )
99
- const collateralToFlashloan = debtInEth . multipliedBy ( COLLAT_RATIO )
100
- const limitEth = await getQuote ( shortAmount , true )
97
+ const shortAmount = fromTokenAmount ( vaultBefore . shortAmount , OSQUEETH_DECIMALS )
98
+ const debtInEthPromise = getDebtAmount ( shortAmount )
99
+ const limitEthPromise = getQuote ( shortAmount , true )
100
+ const [ debtInEth , limitEth ] = await Promise . all ( [ debtInEthPromise , limitEthPromise ] )
101
+ const collateralToFlashloan = debtInEth . multipliedBy ( COLLAT_RATIO )
101
102
102
103
const flashloanCloseVaultLpNftParam = {
103
104
vaultId : vaultId ,
You can’t perform that action at this time.
0 commit comments