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