diff --git a/package.json b/package.json index 69924ee1..9731ddba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mars-v2-frontend", - "version": "2.2.0", + "version": "2.2.1", "private": true, "scripts": { "build": "yarn validate-env && next build", diff --git a/public/images/tokens/akt.svg b/public/images/tokens/akt.svg index 0d58ae4d..5c507d30 100644 --- a/public/images/tokens/akt.svg +++ b/public/images/tokens/akt.svg @@ -1,4 +1,4 @@ - + diff --git a/public/images/tokens/axl.svg b/public/images/tokens/axl.svg index 4a79129b..1186b02c 100644 --- a/public/images/tokens/axl.svg +++ b/public/images/tokens/axl.svg @@ -1,4 +1,4 @@ - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/tokens/milktia.svg b/public/images/tokens/milktia.svg new file mode 100644 index 00000000..ab5c2575 --- /dev/null +++ b/public/images/tokens/milktia.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + diff --git a/public/images/tokens/osmo.svg b/public/images/tokens/osmo.svg index a1935c96..ecafd4a0 100644 --- a/public/images/tokens/osmo.svg +++ b/public/images/tokens/osmo.svg @@ -1,340 +1,340 @@ - + - - - + + + - - - + + + - - - + + + - - - - + + + + - - + + - - - - + + + + - - + + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff --git a/public/images/tokens/stosmo.svg b/public/images/tokens/stosmo.svg index cd1ed2d0..29ea4225 100644 --- a/public/images/tokens/stosmo.svg +++ b/public/images/tokens/stosmo.svg @@ -1,9 +1,25 @@ - - - - - - - - + + + + + + + + diff --git a/public/images/tokens/usdc.svg b/public/images/tokens/usdc.svg index 60234a85..d45fc551 100644 --- a/public/images/tokens/usdc.svg +++ b/public/images/tokens/usdc.svg @@ -1,13 +1,4 @@ - + + - {accountLendValue && ( + {accountLendValue && accountLendValue.isGreaterThan(0) && ( } iconClassName={iconClassnames} diff --git a/src/components/earn/lend/Lends.tsx b/src/components/earn/lend/Lends.tsx index f3873d50..19846a46 100644 --- a/src/components/earn/lend/Lends.tsx +++ b/src/components/earn/lend/Lends.tsx @@ -2,7 +2,7 @@ import AvailableLendsTable from 'components/earn/lend/Table/AvailableLendsTable' import DepositedLendsTable from 'components/earn/lend/Table/DepositedLendsTable' import useLendingMarketAssetsTableData from 'components/earn/lend/Table/useLendingMarketAssetsTableData' import { BN_ZERO } from 'constants/math' -import useLendEnabledAssets from 'hooks/assets/useLendEnabledAssets' +import useMarketEnabledAssets from 'hooks/assets/useMarketEnabledAssets' export default function Lends() { const { accountLentAssets, availableAssets, allAssets } = useLendingMarketAssetsTableData() @@ -19,7 +19,7 @@ export default function Lends() { } function Fallback() { - const assets = useLendEnabledAssets() + const assets = useMarketEnabledAssets() const data: LendingMarketTableData[] = assets.map((asset) => ({ asset, diff --git a/src/configs/assets/milkTIA.ts b/src/configs/assets/milkTIA.ts new file mode 100644 index 00000000..a70d51f3 --- /dev/null +++ b/src/configs/assets/milkTIA.ts @@ -0,0 +1,15 @@ +const milkTIA: AssetMetaData = { + symbol: 'milkTIA', + id: 'milkTIA', + name: 'MilkyWay liquid staked TIA', + color: '#E69EFE', + logo: '/images/tokens/milktia.svg', + decimals: 6, + hasOraclePrice: true, + isEnabled: true, + isMarket: true, + isDisplayCurrency: true, + isAutoLendEnabled: false, +} + +export default milkTIA diff --git a/src/configs/chains/osmosis/osmosis-1.ts b/src/configs/chains/osmosis/osmosis-1.ts index ff6600f0..deab52b8 100644 --- a/src/configs/chains/osmosis/osmosis-1.ts +++ b/src/configs/chains/osmosis/osmosis-1.ts @@ -11,6 +11,7 @@ import OSMO_WBTC from 'configs/assets/lp/OSMO_WBTC' import OSMO_WETH from 'configs/assets/lp/OSMO_WETH' import stATOM_ATOM from 'configs/assets/lp/stATOM_ATOM' import MARS from 'configs/assets/MARS' +import milkTIA from 'configs/assets/milkTIA' import OSMO from 'configs/assets/OSMO' import stATOM from 'configs/assets/stATOM' import stOSMO from 'configs/assets/stOSMO' @@ -98,6 +99,11 @@ const ASSETS = [ poolId: 1245, denom: 'ibc/831F0B1BBB1D08A2B75311892876D71565478C532967545476DF4C2D7492E48C', }, + { + ...milkTIA, + poolId: 1335, + denom: 'factory/osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0/umilkTIA', + }, OSMO_ATOM, OSMO_USDC, OSMO_WETH, diff --git a/src/hooks/markets/useMarkets.ts b/src/hooks/markets/useMarkets.ts index 6ed74525..3e9dd0fc 100644 --- a/src/hooks/markets/useMarkets.ts +++ b/src/hooks/markets/useMarkets.ts @@ -20,7 +20,7 @@ export default function useMarkets() { const { data: assetParams } = useAssetParams() const assets = useAssets() - return useSWR( + const result = useSWR( !!marketInfos?.length && !!marketDepositCaps?.length && !!assetParams.length && @@ -38,5 +38,7 @@ export default function useMarkets() { { fallbackData: [], }, - ).data + ) + + return result.data } diff --git a/src/utils/resolvers.ts b/src/utils/resolvers.ts index 64e06ac7..e24b032b 100644 --- a/src/utils/resolvers.ts +++ b/src/utils/resolvers.ts @@ -16,26 +16,51 @@ export function resolveMarketResponse( assetParamsResponse: AssetParams, assetCapResponse: TotalDepositResponse, ): Market { - return { - asset, - apy: { - borrow: convertAprToApy(Number(marketResponse.borrow_rate), 365) * 100, - deposit: convertAprToApy(Number(marketResponse.liquidity_rate), 365) * 100, - }, - debt: marketResponse.debt ?? BN_ZERO, - deposits: marketResponse.deposits ?? BN_ZERO, - liquidity: marketResponse.liquidity ?? BN_ZERO, - depositEnabled: assetParamsResponse.red_bank.deposit_enabled, - borrowEnabled: assetParamsResponse.red_bank.borrow_enabled, - cap: { - denom: assetCapResponse.denom, - used: BN(assetCapResponse.amount), - max: BN(assetParamsResponse.deposit_cap), - }, - ltv: { - max: Number(assetParamsResponse.max_loan_to_value), - liq: Number(assetParamsResponse.liquidation_threshold), - }, + try { + return { + asset, + apy: { + borrow: convertAprToApy(Number(marketResponse.borrow_rate), 365) * 100, + deposit: convertAprToApy(Number(marketResponse.liquidity_rate), 365) * 100, + }, + debt: marketResponse.debt ?? BN_ZERO, + deposits: marketResponse.deposits ?? BN_ZERO, + liquidity: marketResponse.liquidity ?? BN_ZERO, + depositEnabled: assetParamsResponse.red_bank.deposit_enabled, + borrowEnabled: assetParamsResponse.red_bank.borrow_enabled, + cap: { + denom: assetCapResponse.denom, + used: BN(assetCapResponse.amount), + max: BN(assetParamsResponse.deposit_cap), + }, + ltv: { + max: Number(assetParamsResponse.max_loan_to_value), + liq: Number(assetParamsResponse.liquidation_threshold), + }, + } + } catch (e) { + console.log(e) + return { + asset, + apy: { + borrow: 0, + deposit: 0, + }, + debt: BN_ZERO, + deposits: BN_ZERO, + liquidity: BN_ZERO, + depositEnabled: false, + borrowEnabled: false, + cap: { + denom: '', + used: BN_ZERO, + max: BN_ZERO, + }, + ltv: { + max: 0, + liq: 0, + }, + } } }