mirror of
https://github.com/cerc-io/mars-interface.git
synced 2024-12-22 12:17:45 +00:00
v1.4.9
This commit is contained in:
parent
50a82990e2
commit
8f0bce94a0
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "mars",
|
||||
"homepage": "./",
|
||||
"version": "1.4.8",
|
||||
"version": "1.4.9",
|
||||
"license": "SEE LICENSE IN LICENSE FILE",
|
||||
"private": false,
|
||||
"scripts": {
|
||||
|
@ -220,13 +220,7 @@ export const Action = ({
|
||||
const calculateMaxBorrowableAmount = useMemo((): number => {
|
||||
const assetLiquidity = Number(findByDenom(marketAssetLiquidity, denom)?.amount || 0)
|
||||
|
||||
return maxBorrowableAmount(
|
||||
assetLiquidity,
|
||||
availableBalanceBaseCurrency,
|
||||
new BigNumber(currentAssetPrice)
|
||||
.shiftedBy(baseCurrency.decimals - (currentAsset?.decimals || 0))
|
||||
.toNumber(),
|
||||
)
|
||||
return maxBorrowableAmount(assetLiquidity, availableBalanceBaseCurrency, currentAssetPrice)
|
||||
}, [
|
||||
denom,
|
||||
availableBalanceBaseCurrency,
|
||||
@ -254,10 +248,9 @@ export const Action = ({
|
||||
if (!asset || !asset.depositBalance || !asset.denom) return 0
|
||||
|
||||
// When withdrawing, we have to remove the slippage, otherwise we can't actually hit the borrow limit.
|
||||
const withdrawableAmountOfAsset = new BigNumber(
|
||||
availableBalanceBaseCurrency / (1 - DEFAULT_SLIPPAGE) / (currentAssetPrice * assetLtvRatio),
|
||||
)
|
||||
.shiftedBy(asset.decimals - baseCurrency.decimals)
|
||||
const withdrawableAmountOfAsset = new BigNumber(availableBalanceBaseCurrency)
|
||||
.div(1 - DEFAULT_SLIPPAGE)
|
||||
.div(currentAssetPrice * assetLtvRatio)
|
||||
.toNumber()
|
||||
|
||||
return withdrawableAmountOfAsset < assetBalanceOrAvailableLiquidity
|
||||
|
@ -153,12 +153,11 @@ export const ActiveVaultsTableMobile = () => {
|
||||
return content
|
||||
}
|
||||
|
||||
const route = vault.position.status === 'active' ? 'edit' : 'close'
|
||||
return (
|
||||
<Link
|
||||
key={`${vault.address}-${i}`}
|
||||
href={`/farm/vault/${vault.address}/${
|
||||
vault.position.status === 'active' ? 'edit' : 'close'
|
||||
}`}
|
||||
href={`/farm/vault/${vault.address}/account/${vault.position.accountId}/${route}`}
|
||||
className={styles.link}
|
||||
>
|
||||
<div>{content}</div>
|
||||
|
Loading…
Reference in New Issue
Block a user