@defisaver/positions-sdk 1.0.11-fluid-dev8 → 1.0.11-fluid-dev10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1148,8 +1148,8 @@ module.exports = {
1148
1148
  "abi": [{ "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }, { "internalType": "uint256", "name": "_token0Amount", "type": "uint256" }, { "internalType": "uint256", "name": "_token1Amount", "type": "uint256" }, { "internalType": "uint256", "name": "_maxSharesAmount", "type": "uint256" }], "name": "estimateBorrow", "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }, { "internalType": "uint256", "name": "_token0Amount", "type": "uint256" }, { "internalType": "uint256", "name": "_token1Amount", "type": "uint256" }, { "internalType": "uint256", "name": "_minSharesAmount", "type": "uint256" }], "name": "estimateDeposit", "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_nftId", "type": "uint256" }, { "internalType": "uint256", "name": "_minToken0AmountToAccept", "type": "uint256" }, { "internalType": "uint256", "name": "_minToken1AmountToAccept", "type": "uint256" }], "name": "estimateDexPositionCollateralInOneToken", "outputs": [{ "internalType": "uint256", "name": "collateral", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_nftId", "type": "uint256" }, { "internalType": "uint256", "name": "_maxToken0AmountToPayback", "type": "uint256" }, { "internalType": "uint256", "name": "_maxToken1AmountToPayback", "type": "uint256" }], "name": "estimateDexPositionDebtInOneToken", "outputs": [{ "internalType": "uint256", "name": "debt", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }, { "internalType": "uint256", "name": "_token0Amount", "type": "uint256" }, { "internalType": "uint256", "name": "_token1Amount", "type": "uint256" }, { "internalType": "uint256", "name": "_minSharesAmount", "type": "uint256" }], "name": "estimatePayback", "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }, { "internalType": "uint256", "name": "_token0Amount", "type": "uint256" }, { "internalType": "uint256", "name": "_token1Amount", "type": "uint256" }, { "internalType": "uint256", "name": "_maxSharesAmount", "type": "uint256" }], "name": "estimateWithdraw", "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "getAllFTokens", "outputs": [{ "internalType": "address[]", "name": "", "type": "address[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getAllFTokensData", "outputs": [{ "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "bool", "name": "isNativeUnderlying", "type": "bool" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "convertToShares", "type": "uint256" }, { "internalType": "uint256", "name": "convertToAssets", "type": "uint256" }, { "internalType": "uint256", "name": "rewardsRate", "type": "uint256" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "bool", "name": "modeWithInterest", "type": "bool" }, { "internalType": "uint256", "name": "expandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "expandDuration", "type": "uint256" }], "internalType": "struct FluidView.FTokenData[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getAllUserEarnPositionsWithFTokens", "outputs": [{ "components": [{ "internalType": "uint256", "name": "fTokenShares", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingAssets", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingBalance", "type": "uint256" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" }], "internalType": "struct FluidView.UserEarnPosition[]", "name": "userPositions", "type": "tuple[]" }, { "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "bool", "name": "isNativeUnderlying", "type": "bool" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "convertToShares", "type": "uint256" }, { "internalType": "uint256", "name": "convertToAssets", "type": "uint256" }, { "internalType": "uint256", "name": "rewardsRate", "type": "uint256" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "bool", "name": "modeWithInterest", "type": "bool" }, { "internalType": "uint256", "name": "expandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "expandDuration", "type": "uint256" }], "internalType": "struct FluidView.FTokenData[]", "name": "fTokensData", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }], "name": "getDexShareRates", "outputs": [{ "internalType": "uint256", "name": "token0PerSupplyShare", "type": "uint256" }, { "internalType": "uint256", "name": "token1PerSupplyShare", "type": "uint256" }, { "internalType": "uint256", "name": "token0PerBorrowShare", "type": "uint256" }, { "internalType": "uint256", "name": "token1PerBorrowShare", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_fToken", "type": "address" }], "name": "getFTokenData", "outputs": [{ "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "bool", "name": "isNativeUnderlying", "type": "bool" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "convertToShares", "type": "uint256" }, { "internalType": "uint256", "name": "convertToAssets", "type": "uint256" }, { "internalType": "uint256", "name": "rewardsRate", "type": "uint256" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "bool", "name": "modeWithInterest", "type": "bool" }, { "internalType": "uint256", "name": "expandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "expandDuration", "type": "uint256" }], "internalType": "struct FluidView.FTokenData", "name": "fTokenData", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_nftId", "type": "uint256" }], "name": "getPositionByNftId", "outputs": [{ "components": [{ "internalType": "uint256", "name": "nftId", "type": "uint256" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "bool", "name": "isLiquidated", "type": "bool" }, { "internalType": "bool", "name": "isSupplyPosition", "type": "bool" }, { "internalType": "uint256", "name": "supply", "type": "uint256" }, { "internalType": "uint256", "name": "borrow", "type": "uint256" }, { "internalType": "uint256", "name": "ratio", "type": "uint256" }, { "internalType": "int256", "name": "tick", "type": "int256" }, { "internalType": "uint256", "name": "tickId", "type": "uint256" }], "internalType": "struct FluidView.UserPosition", "name": "position", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "vault", "type": "address" }, { "internalType": "uint256", "name": "vaultId", "type": "uint256" }, { "internalType": "uint256", "name": "vaultType", "type": "uint256" }, { "internalType": "bool", "name": "isSmartColl", "type": "bool" }, { "internalType": "bool", "name": "isSmartDebt", "type": "bool" }, { "internalType": "address", "name": "supplyToken0", "type": "address" }, { "internalType": "address", "name": "supplyToken1", "type": "address" }, { "internalType": "address", "name": "borrowToken0", "type": "address" }, { "internalType": "address", "name": "borrowToken1", "type": "address" }, { "internalType": "uint256", "name": "supplyToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken1Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken1Decimals", "type": "uint256" }, { "internalType": "uint16", "name": "collateralFactor", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationMaxLimit", "type": "uint16" }, { "internalType": "uint16", "name": "withdrawalGap", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationPenalty", "type": "uint16" }, { "internalType": "uint16", "name": "borrowFee", "type": "uint16" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "oraclePriceOperate", "type": "uint256" }, { "internalType": "uint256", "name": "oraclePriceLiquidate", "type": "uint256" }, { "internalType": "uint256", "name": "vaultSupplyExchangePrice", "type": "uint256" }, { "internalType": "uint256", "name": "vaultBorrowExchangePrice", "type": "uint256" }, { "internalType": "int256", "name": "supplyRateVault", "type": "int256" }, { "internalType": "int256", "name": "borrowRateVault", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateSupply", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateBorrow", "type": "int256" }, { "internalType": "uint256", "name": "totalPositions", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyVault", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowVault", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "baseWithdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimitUtilization", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "baseBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "minimumBorrowing", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "dexPool", "type": "address" }, { "internalType": "uint256", "name": "dexId", "type": "uint256" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }, { "internalType": "uint256", "name": "lastStoredPrice", "type": "uint256" }, { "internalType": "uint256", "name": "centerPrice", "type": "uint256" }, { "internalType": "uint256", "name": "token0Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "token1Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "maxSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "token0Supplied", "type": "uint256" }, { "internalType": "uint256", "name": "token1Supplied", "type": "uint256" }, { "internalType": "uint256", "name": "sharesWithdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token0Withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token1Withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token0PerSupplyShare", "type": "uint256" }, { "internalType": "uint256", "name": "token1PerSupplyShare", "type": "uint256" }, { "internalType": "uint256", "name": "token0SupplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "token1SupplyRate", "type": "uint256" }, { "internalType": "address", "name": "quoteToken", "type": "address" }, { "internalType": "uint256", "name": "quoteTokensPerShare", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken0Reserves", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken1Reserves", "type": "uint256" }], "internalType": "struct FluidView.DexSupplyData", "name": "dexSupplyData", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "dexPool", "type": "address" }, { "internalType": "uint256", "name": "dexId", "type": "uint256" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }, { "internalType": "uint256", "name": "lastStoredPrice", "type": "uint256" }, { "internalType": "uint256", "name": "centerPrice", "type": "uint256" }, { "internalType": "uint256", "name": "token0Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "token1Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowShares", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrowShares", "type": "uint256" }, { "internalType": "uint256", "name": "token0Borrowed", "type": "uint256" }, { "internalType": "uint256", "name": "token1Borrowed", "type": "uint256" }, { "internalType": "uint256", "name": "sharesBorrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token0Borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token1Borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token0PerBorrowShare", "type": "uint256" }, { "internalType": "uint256", "name": "token1PerBorrowShare", "type": "uint256" }, { "internalType": "uint256", "name": "token0BorrowRate", "type": "uint256" }, { "internalType": "uint256", "name": "token1BorrowRate", "type": "uint256" }, { "internalType": "address", "name": "quoteToken", "type": "address" }, { "internalType": "uint256", "name": "quoteTokensPerShare", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken0Reserves", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken1Reserves", "type": "uint256" }], "internalType": "struct FluidView.DexBorrowData", "name": "dexBorrowData", "type": "tuple" }], "internalType": "struct FluidView.VaultData", "name": "vault", "type": "tuple" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_nftId", "type": "uint256" }], "name": "getRatio", "outputs": [{ "internalType": "uint256", "name": "ratio", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_fToken", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserEarnPosition", "outputs": [{ "components": [{ "internalType": "uint256", "name": "fTokenShares", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingAssets", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingBalance", "type": "uint256" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" }], "internalType": "struct FluidView.UserEarnPosition", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_fToken", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserEarnPositionWithFToken", "outputs": [{ "components": [{ "internalType": "uint256", "name": "fTokenShares", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingAssets", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingBalance", "type": "uint256" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" }], "internalType": "struct FluidView.UserEarnPosition", "name": "userPosition", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "bool", "name": "isNativeUnderlying", "type": "bool" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "convertToShares", "type": "uint256" }, { "internalType": "uint256", "name": "convertToAssets", "type": "uint256" }, { "internalType": "uint256", "name": "rewardsRate", "type": "uint256" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "bool", "name": "modeWithInterest", "type": "bool" }, { "internalType": "uint256", "name": "expandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "expandDuration", "type": "uint256" }], "internalType": "struct FluidView.FTokenData", "name": "fTokenData", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserNftIds", "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserNftIdsWithVaultIds", "outputs": [{ "components": [{ "internalType": "uint256", "name": "nftId", "type": "uint256" }, { "internalType": "uint256", "name": "vaultId", "type": "uint256" }, { "internalType": "address", "name": "vaultAddr", "type": "address" }], "internalType": "struct FluidView.NftWithVault[]", "name": "retVal", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserPositions", "outputs": [{ "components": [{ "internalType": "uint256", "name": "nftId", "type": "uint256" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "bool", "name": "isLiquidated", "type": "bool" }, { "internalType": "bool", "name": "isSupplyPosition", "type": "bool" }, { "internalType": "uint256", "name": "supply", "type": "uint256" }, { "internalType": "uint256", "name": "borrow", "type": "uint256" }, { "internalType": "uint256", "name": "ratio", "type": "uint256" }, { "internalType": "int256", "name": "tick", "type": "int256" }, { "internalType": "uint256", "name": "tickId", "type": "uint256" }], "internalType": "struct FluidView.UserPosition[]", "name": "positions", "type": "tuple[]" }, { "components": [{ "internalType": "address", "name": "vault", "type": "address" }, { "internalType": "uint256", "name": "vaultId", "type": "uint256" }, { "internalType": "uint256", "name": "vaultType", "type": "uint256" }, { "internalType": "bool", "name": "isSmartColl", "type": "bool" }, { "internalType": "bool", "name": "isSmartDebt", "type": "bool" }, { "internalType": "address", "name": "supplyToken0", "type": "address" }, { "internalType": "address", "name": "supplyToken1", "type": "address" }, { "internalType": "address", "name": "borrowToken0", "type": "address" }, { "internalType": "address", "name": "borrowToken1", "type": "address" }, { "internalType": "uint256", "name": "supplyToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken1Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken1Decimals", "type": "uint256" }, { "internalType": "uint16", "name": "collateralFactor", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationMaxLimit", "type": "uint16" }, { "internalType": "uint16", "name": "withdrawalGap", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationPenalty", "type": "uint16" }, { "internalType": "uint16", "name": "borrowFee", "type": "uint16" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "oraclePriceOperate", "type": "uint256" }, { "internalType": "uint256", "name": "oraclePriceLiquidate", "type": "uint256" }, { "internalType": "uint256", "name": "vaultSupplyExchangePrice", "type": "uint256" }, { "internalType": "uint256", "name": "vaultBorrowExchangePrice", "type": "uint256" }, { "internalType": "int256", "name": "supplyRateVault", "type": "int256" }, { "internalType": "int256", "name": "borrowRateVault", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateSupply", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateBorrow", "type": "int256" }, { "internalType": "uint256", "name": "totalPositions", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyVault", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowVault", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "baseWithdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimitUtilization", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "baseBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "minimumBorrowing", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "dexPool", "type": "address" }, { "internalType": "uint256", "name": "dexId", "type": "uint256" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }, { "internalType": "uint256", "name": "lastStoredPrice", "type": "uint256" }, { "internalType": "uint256", "name": "centerPrice", "type": "uint256" }, { "internalType": "uint256", "name": "token0Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "token1Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "maxSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "token0Supplied", "type": "uint256" }, { "internalType": "uint256", "name": "token1Supplied", "type": "uint256" }, { "internalType": "uint256", "name": "sharesWithdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token0Withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token1Withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token0PerSupplyShare", "type": "uint256" }, { "internalType": "uint256", "name": "token1PerSupplyShare", "type": "uint256" }, { "internalType": "uint256", "name": "token0SupplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "token1SupplyRate", "type": "uint256" }, { "internalType": "address", "name": "quoteToken", "type": "address" }, { "internalType": "uint256", "name": "quoteTokensPerShare", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken0Reserves", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken1Reserves", "type": "uint256" }], "internalType": "struct FluidView.DexSupplyData", "name": "dexSupplyData", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "dexPool", "type": "address" }, { "internalType": "uint256", "name": "dexId", "type": "uint256" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }, { "internalType": "uint256", "name": "lastStoredPrice", "type": "uint256" }, { "internalType": "uint256", "name": "centerPrice", "type": "uint256" }, { "internalType": "uint256", "name": "token0Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "token1Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowShares", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrowShares", "type": "uint256" }, { "internalType": "uint256", "name": "token0Borrowed", "type": "uint256" }, { "internalType": "uint256", "name": "token1Borrowed", "type": "uint256" }, { "internalType": "uint256", "name": "sharesBorrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token0Borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token1Borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token0PerBorrowShare", "type": "uint256" }, { "internalType": "uint256", "name": "token1PerBorrowShare", "type": "uint256" }, { "internalType": "uint256", "name": "token0BorrowRate", "type": "uint256" }, { "internalType": "uint256", "name": "token1BorrowRate", "type": "uint256" }, { "internalType": "address", "name": "quoteToken", "type": "address" }, { "internalType": "uint256", "name": "quoteTokensPerShare", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken0Reserves", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken1Reserves", "type": "uint256" }], "internalType": "struct FluidView.DexBorrowData", "name": "dexBorrowData", "type": "tuple" }], "internalType": "struct FluidView.VaultData[]", "name": "vaults", "type": "tuple[]" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }], "name": "getVaultData", "outputs": [{ "components": [{ "internalType": "address", "name": "vault", "type": "address" }, { "internalType": "uint256", "name": "vaultId", "type": "uint256" }, { "internalType": "uint256", "name": "vaultType", "type": "uint256" }, { "internalType": "bool", "name": "isSmartColl", "type": "bool" }, { "internalType": "bool", "name": "isSmartDebt", "type": "bool" }, { "internalType": "address", "name": "supplyToken0", "type": "address" }, { "internalType": "address", "name": "supplyToken1", "type": "address" }, { "internalType": "address", "name": "borrowToken0", "type": "address" }, { "internalType": "address", "name": "borrowToken1", "type": "address" }, { "internalType": "uint256", "name": "supplyToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken1Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken1Decimals", "type": "uint256" }, { "internalType": "uint16", "name": "collateralFactor", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationMaxLimit", "type": "uint16" }, { "internalType": "uint16", "name": "withdrawalGap", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationPenalty", "type": "uint16" }, { "internalType": "uint16", "name": "borrowFee", "type": "uint16" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "oraclePriceOperate", "type": "uint256" }, { "internalType": "uint256", "name": "oraclePriceLiquidate", "type": "uint256" }, { "internalType": "uint256", "name": "vaultSupplyExchangePrice", "type": "uint256" }, { "internalType": "uint256", "name": "vaultBorrowExchangePrice", "type": "uint256" }, { "internalType": "int256", "name": "supplyRateVault", "type": "int256" }, { "internalType": "int256", "name": "borrowRateVault", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateSupply", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateBorrow", "type": "int256" }, { "internalType": "uint256", "name": "totalPositions", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyVault", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowVault", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "baseWithdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimitUtilization", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "baseBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "minimumBorrowing", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "dexPool", "type": "address" }, { "internalType": "uint256", "name": "dexId", "type": "uint256" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }, { "internalType": "uint256", "name": "lastStoredPrice", "type": "uint256" }, { "internalType": "uint256", "name": "centerPrice", "type": "uint256" }, { "internalType": "uint256", "name": "token0Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "token1Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "maxSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "token0Supplied", "type": "uint256" }, { "internalType": "uint256", "name": "token1Supplied", "type": "uint256" }, { "internalType": "uint256", "name": "sharesWithdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token0Withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token1Withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token0PerSupplyShare", "type": "uint256" }, { "internalType": "uint256", "name": "token1PerSupplyShare", "type": "uint256" }, { "internalType": "uint256", "name": "token0SupplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "token1SupplyRate", "type": "uint256" }, { "internalType": "address", "name": "quoteToken", "type": "address" }, { "internalType": "uint256", "name": "quoteTokensPerShare", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken0Reserves", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken1Reserves", "type": "uint256" }], "internalType": "struct FluidView.DexSupplyData", "name": "dexSupplyData", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "dexPool", "type": "address" }, { "internalType": "uint256", "name": "dexId", "type": "uint256" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }, { "internalType": "uint256", "name": "lastStoredPrice", "type": "uint256" }, { "internalType": "uint256", "name": "centerPrice", "type": "uint256" }, { "internalType": "uint256", "name": "token0Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "token1Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowShares", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrowShares", "type": "uint256" }, { "internalType": "uint256", "name": "token0Borrowed", "type": "uint256" }, { "internalType": "uint256", "name": "token1Borrowed", "type": "uint256" }, { "internalType": "uint256", "name": "sharesBorrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token0Borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token1Borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token0PerBorrowShare", "type": "uint256" }, { "internalType": "uint256", "name": "token1PerBorrowShare", "type": "uint256" }, { "internalType": "uint256", "name": "token0BorrowRate", "type": "uint256" }, { "internalType": "uint256", "name": "token1BorrowRate", "type": "uint256" }, { "internalType": "address", "name": "quoteToken", "type": "address" }, { "internalType": "uint256", "name": "quoteTokensPerShare", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken0Reserves", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken1Reserves", "type": "uint256" }], "internalType": "struct FluidView.DexBorrowData", "name": "dexBorrowData", "type": "tuple" }], "internalType": "struct FluidView.VaultData", "name": "vaultData", "type": "tuple" }], "stateMutability": "nonpayable", "type": "function" }],
1149
1149
  "networks": {
1150
1150
  "1": { "address": "0xc8df052bD7A8d76a34c09e758Dff3c6298C0115c" },
1151
- "8453": { "address": "0x5835CaDbA8843CD6d6d55782908351E9c74221aD" },
1152
- "42161": { "address": "0x2d51BB6Ac5c1eC8DD6432e1FF980fC864B626e01" }
1151
+ "8453": { "address": "0x6cd4D6af4F292817eA2A2311F099dF26cd015028" },
1152
+ "42161": { "address": "0xf9e6d5568887ac8eC6fA33B7eefD2A176A958e71" }
1153
1153
  }
1154
1154
  }
1155
1155
  };
@@ -213,6 +213,12 @@ const parseT1MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
213
213
  marketData,
214
214
  };
215
215
  });
216
+ const getMarketRateForDex = (token1PerShare, token0PerShare, rate0, rate1) => {
217
+ const sharesCombined = new decimal_js_1.default(token1PerShare).plus(token0PerShare);
218
+ const rate0PerShare = new decimal_js_1.default(rate0).mul(token0PerShare).div(sharesCombined).toString();
219
+ const rate1PerShare = new decimal_js_1.default(rate1).mul(token1PerShare).div(sharesCombined).toString();
220
+ return new decimal_js_1.default(rate0PerShare).plus(rate1PerShare).toString();
221
+ };
216
222
  const parseT2MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0, void 0, void 0, function* () {
217
223
  const collAsset0 = (0, tokens_1.getAssetInfoByAddress)(data.supplyToken0, network);
218
224
  const collAsset1 = (0, tokens_1.getAssetInfoByAddress)(data.supplyToken1, network);
@@ -255,11 +261,12 @@ const parseT2MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
255
261
  collFirstAssetData.incentiveSupplyApy = yield (0, staking_1.getStakingApy)(collAsset1.symbol, mainnetWeb3);
256
262
  collFirstAssetData.incentiveSupplyToken = collAsset1.symbol;
257
263
  }
264
+ const marketSupplyRate = getMarketRateForDex(token1PerSupplyShare, token0PerSupplyShare, supplyRate0, supplyRate1);
258
265
  const borrowRate = new decimal_js_1.default(data.borrowRateVault).div(100).toString();
259
266
  const debtAssetData = {
260
267
  symbol: debtAsset.symbol,
261
- address: debtAsset.address,
262
268
  price: prices[debtAsset.address],
269
+ address: debtAsset.address,
263
270
  totalBorrow: data.totalBorrowVault,
264
271
  canBeBorrowed: true,
265
272
  borrowRate,
@@ -282,6 +289,7 @@ const parseT2MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
282
289
  const totalSupplySharesInVault = (0, tokens_1.assetAmountInEth)(data.totalSupplyVault);
283
290
  const collSharePrice = new decimal_js_1.default(oraclePrice).mul(prices[debtAsset.address]).toString();
284
291
  const totalSupplyVaultUsd = new decimal_js_1.default(totalSupplySharesInVault).mul(collSharePrice).toString();
292
+ const maxSupplySharesUsd = new decimal_js_1.default(maxSupplyShares).mul(collSharePrice).toString();
285
293
  const withdrawableUSD = new decimal_js_1.default(withdrawableShares).mul(collSharePrice).toString();
286
294
  const marketData = {
287
295
  vaultId: +data.vaultId,
@@ -314,7 +322,7 @@ const parseT2MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
314
322
  minimumBorrowing: (0, utils_1.getEthAmountForDecimals)(data.minimumBorrowing, debtAsset.decimals),
315
323
  liquidationMaxLimit,
316
324
  borrowRate,
317
- supplyRate: '0',
325
+ supplyRate: marketSupplyRate,
318
326
  totalSupplyToken0,
319
327
  totalSupplyToken1,
320
328
  withdrawableToken0,
@@ -323,6 +331,7 @@ const parseT2MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
323
331
  withdrawable: withdrawableShares,
324
332
  widthdrawableDex: new decimal_js_1.default(maxSupplyShares).minus(totalSupplyShares).toString(),
325
333
  maxSupplyShares,
334
+ maxSupplySharesUsd,
326
335
  collDexFee: supplyDexFee,
327
336
  oraclePrice,
328
337
  };
@@ -386,6 +395,7 @@ const parseT3MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
386
395
  debtAsset1Data.incentiveSupplyApy = yield (0, staking_1.getStakingApy)(debtAsset1.symbol, mainnetWeb3);
387
396
  debtAsset1Data.incentiveSupplyToken = debtAsset1.symbol;
388
397
  }
398
+ const marketBorrowRate = getMarketRateForDex(token1PerBorrowShare, token0PerBorrowShare, borrowRate0, borrowRate1);
389
399
  const assetsData = [
390
400
  [collAsset.symbol, collAssetData],
391
401
  [debtAsset0.symbol, debtAsset0Data],
@@ -427,7 +437,7 @@ const parseT3MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
427
437
  withdrawableUntilLimit: (0, utils_1.getEthAmountForDecimals)(data.withdrawableUntilLimit, collAsset.decimals),
428
438
  withdrawable: (0, utils_1.getEthAmountForDecimals)(data.withdrawable, collAsset.decimals),
429
439
  liquidationMaxLimit,
430
- borrowRate: '0',
440
+ borrowRate: marketBorrowRate,
431
441
  supplyRate,
432
442
  borrowableToken0,
433
443
  borrowableToken1,
@@ -524,6 +534,8 @@ const parseT4MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
524
534
  debtAsset1Data.incentiveSupplyApy = yield (0, staking_1.getStakingApy)(debtAsset1.symbol, mainnetWeb3);
525
535
  debtAsset1Data.incentiveSupplyToken = debtAsset1.symbol;
526
536
  }
537
+ const marketBorrowRate = getMarketRateForDex(token1PerBorrowShare, token0PerBorrowShare, borrowRate0, borrowRate1);
538
+ const marketSupplyRate = getMarketRateForDex(token1PerSupplyShare, token0PerSupplyShare, supplyRate0, supplyRate1);
527
539
  const assetsData = [
528
540
  [collAsset0.symbol, collAsset0Data],
529
541
  [collAsset1.symbol, collAsset1Data],
@@ -568,8 +580,8 @@ const parseT4MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
568
580
  totalSupplyVaultUsd,
569
581
  totalBorrowVaultUsd,
570
582
  liquidationMaxLimit,
571
- borrowRate: '0',
572
- supplyRate: '0',
583
+ borrowRate: marketBorrowRate,
584
+ supplyRate: marketSupplyRate,
573
585
  borrowableToken0,
574
586
  borrowableToken1,
575
587
  totalBorrowToken0,
@@ -1147,8 +1147,8 @@ module.exports = {
1147
1147
  "abi": [{ "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }, { "internalType": "uint256", "name": "_token0Amount", "type": "uint256" }, { "internalType": "uint256", "name": "_token1Amount", "type": "uint256" }, { "internalType": "uint256", "name": "_maxSharesAmount", "type": "uint256" }], "name": "estimateBorrow", "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }, { "internalType": "uint256", "name": "_token0Amount", "type": "uint256" }, { "internalType": "uint256", "name": "_token1Amount", "type": "uint256" }, { "internalType": "uint256", "name": "_minSharesAmount", "type": "uint256" }], "name": "estimateDeposit", "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_nftId", "type": "uint256" }, { "internalType": "uint256", "name": "_minToken0AmountToAccept", "type": "uint256" }, { "internalType": "uint256", "name": "_minToken1AmountToAccept", "type": "uint256" }], "name": "estimateDexPositionCollateralInOneToken", "outputs": [{ "internalType": "uint256", "name": "collateral", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_nftId", "type": "uint256" }, { "internalType": "uint256", "name": "_maxToken0AmountToPayback", "type": "uint256" }, { "internalType": "uint256", "name": "_maxToken1AmountToPayback", "type": "uint256" }], "name": "estimateDexPositionDebtInOneToken", "outputs": [{ "internalType": "uint256", "name": "debt", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }, { "internalType": "uint256", "name": "_token0Amount", "type": "uint256" }, { "internalType": "uint256", "name": "_token1Amount", "type": "uint256" }, { "internalType": "uint256", "name": "_minSharesAmount", "type": "uint256" }], "name": "estimatePayback", "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }, { "internalType": "uint256", "name": "_token0Amount", "type": "uint256" }, { "internalType": "uint256", "name": "_token1Amount", "type": "uint256" }, { "internalType": "uint256", "name": "_maxSharesAmount", "type": "uint256" }], "name": "estimateWithdraw", "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "getAllFTokens", "outputs": [{ "internalType": "address[]", "name": "", "type": "address[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getAllFTokensData", "outputs": [{ "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "bool", "name": "isNativeUnderlying", "type": "bool" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "convertToShares", "type": "uint256" }, { "internalType": "uint256", "name": "convertToAssets", "type": "uint256" }, { "internalType": "uint256", "name": "rewardsRate", "type": "uint256" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "bool", "name": "modeWithInterest", "type": "bool" }, { "internalType": "uint256", "name": "expandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "expandDuration", "type": "uint256" }], "internalType": "struct FluidView.FTokenData[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getAllUserEarnPositionsWithFTokens", "outputs": [{ "components": [{ "internalType": "uint256", "name": "fTokenShares", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingAssets", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingBalance", "type": "uint256" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" }], "internalType": "struct FluidView.UserEarnPosition[]", "name": "userPositions", "type": "tuple[]" }, { "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "bool", "name": "isNativeUnderlying", "type": "bool" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "convertToShares", "type": "uint256" }, { "internalType": "uint256", "name": "convertToAssets", "type": "uint256" }, { "internalType": "uint256", "name": "rewardsRate", "type": "uint256" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "bool", "name": "modeWithInterest", "type": "bool" }, { "internalType": "uint256", "name": "expandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "expandDuration", "type": "uint256" }], "internalType": "struct FluidView.FTokenData[]", "name": "fTokensData", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }], "name": "getDexShareRates", "outputs": [{ "internalType": "uint256", "name": "token0PerSupplyShare", "type": "uint256" }, { "internalType": "uint256", "name": "token1PerSupplyShare", "type": "uint256" }, { "internalType": "uint256", "name": "token0PerBorrowShare", "type": "uint256" }, { "internalType": "uint256", "name": "token1PerBorrowShare", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_fToken", "type": "address" }], "name": "getFTokenData", "outputs": [{ "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "bool", "name": "isNativeUnderlying", "type": "bool" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "convertToShares", "type": "uint256" }, { "internalType": "uint256", "name": "convertToAssets", "type": "uint256" }, { "internalType": "uint256", "name": "rewardsRate", "type": "uint256" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "bool", "name": "modeWithInterest", "type": "bool" }, { "internalType": "uint256", "name": "expandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "expandDuration", "type": "uint256" }], "internalType": "struct FluidView.FTokenData", "name": "fTokenData", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_nftId", "type": "uint256" }], "name": "getPositionByNftId", "outputs": [{ "components": [{ "internalType": "uint256", "name": "nftId", "type": "uint256" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "bool", "name": "isLiquidated", "type": "bool" }, { "internalType": "bool", "name": "isSupplyPosition", "type": "bool" }, { "internalType": "uint256", "name": "supply", "type": "uint256" }, { "internalType": "uint256", "name": "borrow", "type": "uint256" }, { "internalType": "uint256", "name": "ratio", "type": "uint256" }, { "internalType": "int256", "name": "tick", "type": "int256" }, { "internalType": "uint256", "name": "tickId", "type": "uint256" }], "internalType": "struct FluidView.UserPosition", "name": "position", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "vault", "type": "address" }, { "internalType": "uint256", "name": "vaultId", "type": "uint256" }, { "internalType": "uint256", "name": "vaultType", "type": "uint256" }, { "internalType": "bool", "name": "isSmartColl", "type": "bool" }, { "internalType": "bool", "name": "isSmartDebt", "type": "bool" }, { "internalType": "address", "name": "supplyToken0", "type": "address" }, { "internalType": "address", "name": "supplyToken1", "type": "address" }, { "internalType": "address", "name": "borrowToken0", "type": "address" }, { "internalType": "address", "name": "borrowToken1", "type": "address" }, { "internalType": "uint256", "name": "supplyToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken1Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken1Decimals", "type": "uint256" }, { "internalType": "uint16", "name": "collateralFactor", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationMaxLimit", "type": "uint16" }, { "internalType": "uint16", "name": "withdrawalGap", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationPenalty", "type": "uint16" }, { "internalType": "uint16", "name": "borrowFee", "type": "uint16" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "oraclePriceOperate", "type": "uint256" }, { "internalType": "uint256", "name": "oraclePriceLiquidate", "type": "uint256" }, { "internalType": "uint256", "name": "vaultSupplyExchangePrice", "type": "uint256" }, { "internalType": "uint256", "name": "vaultBorrowExchangePrice", "type": "uint256" }, { "internalType": "int256", "name": "supplyRateVault", "type": "int256" }, { "internalType": "int256", "name": "borrowRateVault", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateSupply", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateBorrow", "type": "int256" }, { "internalType": "uint256", "name": "totalPositions", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyVault", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowVault", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "baseWithdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimitUtilization", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "baseBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "minimumBorrowing", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "dexPool", "type": "address" }, { "internalType": "uint256", "name": "dexId", "type": "uint256" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }, { "internalType": "uint256", "name": "lastStoredPrice", "type": "uint256" }, { "internalType": "uint256", "name": "centerPrice", "type": "uint256" }, { "internalType": "uint256", "name": "token0Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "token1Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "maxSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "token0Supplied", "type": "uint256" }, { "internalType": "uint256", "name": "token1Supplied", "type": "uint256" }, { "internalType": "uint256", "name": "sharesWithdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token0Withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token1Withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token0PerSupplyShare", "type": "uint256" }, { "internalType": "uint256", "name": "token1PerSupplyShare", "type": "uint256" }, { "internalType": "uint256", "name": "token0SupplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "token1SupplyRate", "type": "uint256" }, { "internalType": "address", "name": "quoteToken", "type": "address" }, { "internalType": "uint256", "name": "quoteTokensPerShare", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken0Reserves", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken1Reserves", "type": "uint256" }], "internalType": "struct FluidView.DexSupplyData", "name": "dexSupplyData", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "dexPool", "type": "address" }, { "internalType": "uint256", "name": "dexId", "type": "uint256" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }, { "internalType": "uint256", "name": "lastStoredPrice", "type": "uint256" }, { "internalType": "uint256", "name": "centerPrice", "type": "uint256" }, { "internalType": "uint256", "name": "token0Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "token1Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowShares", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrowShares", "type": "uint256" }, { "internalType": "uint256", "name": "token0Borrowed", "type": "uint256" }, { "internalType": "uint256", "name": "token1Borrowed", "type": "uint256" }, { "internalType": "uint256", "name": "sharesBorrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token0Borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token1Borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token0PerBorrowShare", "type": "uint256" }, { "internalType": "uint256", "name": "token1PerBorrowShare", "type": "uint256" }, { "internalType": "uint256", "name": "token0BorrowRate", "type": "uint256" }, { "internalType": "uint256", "name": "token1BorrowRate", "type": "uint256" }, { "internalType": "address", "name": "quoteToken", "type": "address" }, { "internalType": "uint256", "name": "quoteTokensPerShare", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken0Reserves", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken1Reserves", "type": "uint256" }], "internalType": "struct FluidView.DexBorrowData", "name": "dexBorrowData", "type": "tuple" }], "internalType": "struct FluidView.VaultData", "name": "vault", "type": "tuple" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_nftId", "type": "uint256" }], "name": "getRatio", "outputs": [{ "internalType": "uint256", "name": "ratio", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_fToken", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserEarnPosition", "outputs": [{ "components": [{ "internalType": "uint256", "name": "fTokenShares", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingAssets", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingBalance", "type": "uint256" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" }], "internalType": "struct FluidView.UserEarnPosition", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_fToken", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserEarnPositionWithFToken", "outputs": [{ "components": [{ "internalType": "uint256", "name": "fTokenShares", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingAssets", "type": "uint256" }, { "internalType": "uint256", "name": "underlyingBalance", "type": "uint256" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" }], "internalType": "struct FluidView.UserEarnPosition", "name": "userPosition", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "bool", "name": "isNativeUnderlying", "type": "bool" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "totalAssets", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "convertToShares", "type": "uint256" }, { "internalType": "uint256", "name": "convertToAssets", "type": "uint256" }, { "internalType": "uint256", "name": "rewardsRate", "type": "uint256" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "bool", "name": "modeWithInterest", "type": "bool" }, { "internalType": "uint256", "name": "expandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "expandDuration", "type": "uint256" }], "internalType": "struct FluidView.FTokenData", "name": "fTokenData", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserNftIds", "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserNftIdsWithVaultIds", "outputs": [{ "components": [{ "internalType": "uint256", "name": "nftId", "type": "uint256" }, { "internalType": "uint256", "name": "vaultId", "type": "uint256" }, { "internalType": "address", "name": "vaultAddr", "type": "address" }], "internalType": "struct FluidView.NftWithVault[]", "name": "retVal", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], "name": "getUserPositions", "outputs": [{ "components": [{ "internalType": "uint256", "name": "nftId", "type": "uint256" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "bool", "name": "isLiquidated", "type": "bool" }, { "internalType": "bool", "name": "isSupplyPosition", "type": "bool" }, { "internalType": "uint256", "name": "supply", "type": "uint256" }, { "internalType": "uint256", "name": "borrow", "type": "uint256" }, { "internalType": "uint256", "name": "ratio", "type": "uint256" }, { "internalType": "int256", "name": "tick", "type": "int256" }, { "internalType": "uint256", "name": "tickId", "type": "uint256" }], "internalType": "struct FluidView.UserPosition[]", "name": "positions", "type": "tuple[]" }, { "components": [{ "internalType": "address", "name": "vault", "type": "address" }, { "internalType": "uint256", "name": "vaultId", "type": "uint256" }, { "internalType": "uint256", "name": "vaultType", "type": "uint256" }, { "internalType": "bool", "name": "isSmartColl", "type": "bool" }, { "internalType": "bool", "name": "isSmartDebt", "type": "bool" }, { "internalType": "address", "name": "supplyToken0", "type": "address" }, { "internalType": "address", "name": "supplyToken1", "type": "address" }, { "internalType": "address", "name": "borrowToken0", "type": "address" }, { "internalType": "address", "name": "borrowToken1", "type": "address" }, { "internalType": "uint256", "name": "supplyToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken1Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken1Decimals", "type": "uint256" }, { "internalType": "uint16", "name": "collateralFactor", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationMaxLimit", "type": "uint16" }, { "internalType": "uint16", "name": "withdrawalGap", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationPenalty", "type": "uint16" }, { "internalType": "uint16", "name": "borrowFee", "type": "uint16" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "oraclePriceOperate", "type": "uint256" }, { "internalType": "uint256", "name": "oraclePriceLiquidate", "type": "uint256" }, { "internalType": "uint256", "name": "vaultSupplyExchangePrice", "type": "uint256" }, { "internalType": "uint256", "name": "vaultBorrowExchangePrice", "type": "uint256" }, { "internalType": "int256", "name": "supplyRateVault", "type": "int256" }, { "internalType": "int256", "name": "borrowRateVault", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateSupply", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateBorrow", "type": "int256" }, { "internalType": "uint256", "name": "totalPositions", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyVault", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowVault", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "baseWithdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimitUtilization", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "baseBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "minimumBorrowing", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "dexPool", "type": "address" }, { "internalType": "uint256", "name": "dexId", "type": "uint256" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }, { "internalType": "uint256", "name": "lastStoredPrice", "type": "uint256" }, { "internalType": "uint256", "name": "centerPrice", "type": "uint256" }, { "internalType": "uint256", "name": "token0Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "token1Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "maxSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "token0Supplied", "type": "uint256" }, { "internalType": "uint256", "name": "token1Supplied", "type": "uint256" }, { "internalType": "uint256", "name": "sharesWithdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token0Withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token1Withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token0PerSupplyShare", "type": "uint256" }, { "internalType": "uint256", "name": "token1PerSupplyShare", "type": "uint256" }, { "internalType": "uint256", "name": "token0SupplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "token1SupplyRate", "type": "uint256" }, { "internalType": "address", "name": "quoteToken", "type": "address" }, { "internalType": "uint256", "name": "quoteTokensPerShare", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken0Reserves", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken1Reserves", "type": "uint256" }], "internalType": "struct FluidView.DexSupplyData", "name": "dexSupplyData", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "dexPool", "type": "address" }, { "internalType": "uint256", "name": "dexId", "type": "uint256" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }, { "internalType": "uint256", "name": "lastStoredPrice", "type": "uint256" }, { "internalType": "uint256", "name": "centerPrice", "type": "uint256" }, { "internalType": "uint256", "name": "token0Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "token1Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowShares", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrowShares", "type": "uint256" }, { "internalType": "uint256", "name": "token0Borrowed", "type": "uint256" }, { "internalType": "uint256", "name": "token1Borrowed", "type": "uint256" }, { "internalType": "uint256", "name": "sharesBorrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token0Borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token1Borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token0PerBorrowShare", "type": "uint256" }, { "internalType": "uint256", "name": "token1PerBorrowShare", "type": "uint256" }, { "internalType": "uint256", "name": "token0BorrowRate", "type": "uint256" }, { "internalType": "uint256", "name": "token1BorrowRate", "type": "uint256" }, { "internalType": "address", "name": "quoteToken", "type": "address" }, { "internalType": "uint256", "name": "quoteTokensPerShare", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken0Reserves", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken1Reserves", "type": "uint256" }], "internalType": "struct FluidView.DexBorrowData", "name": "dexBorrowData", "type": "tuple" }], "internalType": "struct FluidView.VaultData[]", "name": "vaults", "type": "tuple[]" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_vault", "type": "address" }], "name": "getVaultData", "outputs": [{ "components": [{ "internalType": "address", "name": "vault", "type": "address" }, { "internalType": "uint256", "name": "vaultId", "type": "uint256" }, { "internalType": "uint256", "name": "vaultType", "type": "uint256" }, { "internalType": "bool", "name": "isSmartColl", "type": "bool" }, { "internalType": "bool", "name": "isSmartDebt", "type": "bool" }, { "internalType": "address", "name": "supplyToken0", "type": "address" }, { "internalType": "address", "name": "supplyToken1", "type": "address" }, { "internalType": "address", "name": "borrowToken0", "type": "address" }, { "internalType": "address", "name": "borrowToken1", "type": "address" }, { "internalType": "uint256", "name": "supplyToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken1Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken0Decimals", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken1Decimals", "type": "uint256" }, { "internalType": "uint16", "name": "collateralFactor", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationMaxLimit", "type": "uint16" }, { "internalType": "uint16", "name": "withdrawalGap", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationPenalty", "type": "uint16" }, { "internalType": "uint16", "name": "borrowFee", "type": "uint16" }, { "internalType": "address", "name": "oracle", "type": "address" }, { "internalType": "uint256", "name": "oraclePriceOperate", "type": "uint256" }, { "internalType": "uint256", "name": "oraclePriceLiquidate", "type": "uint256" }, { "internalType": "uint256", "name": "vaultSupplyExchangePrice", "type": "uint256" }, { "internalType": "uint256", "name": "vaultBorrowExchangePrice", "type": "uint256" }, { "internalType": "int256", "name": "supplyRateVault", "type": "int256" }, { "internalType": "int256", "name": "borrowRateVault", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateSupply", "type": "int256" }, { "internalType": "int256", "name": "rewardsOrFeeRateBorrow", "type": "int256" }, { "internalType": "uint256", "name": "totalPositions", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyVault", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowVault", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "baseWithdrawalLimit", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowableUntilLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "borrowLimitUtilization", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandPercent", "type": "uint256" }, { "internalType": "uint256", "name": "borrowExpandDuration", "type": "uint256" }, { "internalType": "uint256", "name": "baseBorrowLimit", "type": "uint256" }, { "internalType": "uint256", "name": "minimumBorrowing", "type": "uint256" }, { "components": [{ "internalType": "address", "name": "dexPool", "type": "address" }, { "internalType": "uint256", "name": "dexId", "type": "uint256" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }, { "internalType": "uint256", "name": "lastStoredPrice", "type": "uint256" }, { "internalType": "uint256", "name": "centerPrice", "type": "uint256" }, { "internalType": "uint256", "name": "token0Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "token1Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "maxSupplyShares", "type": "uint256" }, { "internalType": "uint256", "name": "token0Supplied", "type": "uint256" }, { "internalType": "uint256", "name": "token1Supplied", "type": "uint256" }, { "internalType": "uint256", "name": "sharesWithdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token0Withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token1Withdrawable", "type": "uint256" }, { "internalType": "uint256", "name": "token0PerSupplyShare", "type": "uint256" }, { "internalType": "uint256", "name": "token1PerSupplyShare", "type": "uint256" }, { "internalType": "uint256", "name": "token0SupplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "token1SupplyRate", "type": "uint256" }, { "internalType": "address", "name": "quoteToken", "type": "address" }, { "internalType": "uint256", "name": "quoteTokensPerShare", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken0Reserves", "type": "uint256" }, { "internalType": "uint256", "name": "supplyToken1Reserves", "type": "uint256" }], "internalType": "struct FluidView.DexSupplyData", "name": "dexSupplyData", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "dexPool", "type": "address" }, { "internalType": "uint256", "name": "dexId", "type": "uint256" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }, { "internalType": "uint256", "name": "lastStoredPrice", "type": "uint256" }, { "internalType": "uint256", "name": "centerPrice", "type": "uint256" }, { "internalType": "uint256", "name": "token0Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "token1Utilization", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowShares", "type": "uint256" }, { "internalType": "uint256", "name": "maxBorrowShares", "type": "uint256" }, { "internalType": "uint256", "name": "token0Borrowed", "type": "uint256" }, { "internalType": "uint256", "name": "token1Borrowed", "type": "uint256" }, { "internalType": "uint256", "name": "sharesBorrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token0Borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token1Borrowable", "type": "uint256" }, { "internalType": "uint256", "name": "token0PerBorrowShare", "type": "uint256" }, { "internalType": "uint256", "name": "token1PerBorrowShare", "type": "uint256" }, { "internalType": "uint256", "name": "token0BorrowRate", "type": "uint256" }, { "internalType": "uint256", "name": "token1BorrowRate", "type": "uint256" }, { "internalType": "address", "name": "quoteToken", "type": "address" }, { "internalType": "uint256", "name": "quoteTokensPerShare", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken0Reserves", "type": "uint256" }, { "internalType": "uint256", "name": "borrowToken1Reserves", "type": "uint256" }], "internalType": "struct FluidView.DexBorrowData", "name": "dexBorrowData", "type": "tuple" }], "internalType": "struct FluidView.VaultData", "name": "vaultData", "type": "tuple" }], "stateMutability": "nonpayable", "type": "function" }],
1148
1148
  "networks": {
1149
1149
  "1": { "address": "0xc8df052bD7A8d76a34c09e758Dff3c6298C0115c" },
1150
- "8453": { "address": "0x5835CaDbA8843CD6d6d55782908351E9c74221aD" },
1151
- "42161": { "address": "0x2d51BB6Ac5c1eC8DD6432e1FF980fC864B626e01" }
1150
+ "8453": { "address": "0x6cd4D6af4F292817eA2A2311F099dF26cd015028" },
1151
+ "42161": { "address": "0xf9e6d5568887ac8eC6fA33B7eefD2A176A958e71" }
1152
1152
  }
1153
1153
  }
1154
1154
  };
@@ -207,6 +207,12 @@ const parseT1MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
207
207
  marketData,
208
208
  };
209
209
  });
210
+ const getMarketRateForDex = (token1PerShare, token0PerShare, rate0, rate1) => {
211
+ const sharesCombined = new Dec(token1PerShare).plus(token0PerShare);
212
+ const rate0PerShare = new Dec(rate0).mul(token0PerShare).div(sharesCombined).toString();
213
+ const rate1PerShare = new Dec(rate1).mul(token1PerShare).div(sharesCombined).toString();
214
+ return new Dec(rate0PerShare).plus(rate1PerShare).toString();
215
+ };
210
216
  const parseT2MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0, void 0, void 0, function* () {
211
217
  const collAsset0 = getAssetInfoByAddress(data.supplyToken0, network);
212
218
  const collAsset1 = getAssetInfoByAddress(data.supplyToken1, network);
@@ -249,11 +255,12 @@ const parseT2MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
249
255
  collFirstAssetData.incentiveSupplyApy = yield getStakingApy(collAsset1.symbol, mainnetWeb3);
250
256
  collFirstAssetData.incentiveSupplyToken = collAsset1.symbol;
251
257
  }
258
+ const marketSupplyRate = getMarketRateForDex(token1PerSupplyShare, token0PerSupplyShare, supplyRate0, supplyRate1);
252
259
  const borrowRate = new Dec(data.borrowRateVault).div(100).toString();
253
260
  const debtAssetData = {
254
261
  symbol: debtAsset.symbol,
255
- address: debtAsset.address,
256
262
  price: prices[debtAsset.address],
263
+ address: debtAsset.address,
257
264
  totalBorrow: data.totalBorrowVault,
258
265
  canBeBorrowed: true,
259
266
  borrowRate,
@@ -276,6 +283,7 @@ const parseT2MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
276
283
  const totalSupplySharesInVault = assetAmountInEth(data.totalSupplyVault);
277
284
  const collSharePrice = new Dec(oraclePrice).mul(prices[debtAsset.address]).toString();
278
285
  const totalSupplyVaultUsd = new Dec(totalSupplySharesInVault).mul(collSharePrice).toString();
286
+ const maxSupplySharesUsd = new Dec(maxSupplyShares).mul(collSharePrice).toString();
279
287
  const withdrawableUSD = new Dec(withdrawableShares).mul(collSharePrice).toString();
280
288
  const marketData = {
281
289
  vaultId: +data.vaultId,
@@ -308,7 +316,7 @@ const parseT2MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
308
316
  minimumBorrowing: getEthAmountForDecimals(data.minimumBorrowing, debtAsset.decimals),
309
317
  liquidationMaxLimit,
310
318
  borrowRate,
311
- supplyRate: '0',
319
+ supplyRate: marketSupplyRate,
312
320
  totalSupplyToken0,
313
321
  totalSupplyToken1,
314
322
  withdrawableToken0,
@@ -317,6 +325,7 @@ const parseT2MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
317
325
  withdrawable: withdrawableShares,
318
326
  widthdrawableDex: new Dec(maxSupplyShares).minus(totalSupplyShares).toString(),
319
327
  maxSupplyShares,
328
+ maxSupplySharesUsd,
320
329
  collDexFee: supplyDexFee,
321
330
  oraclePrice,
322
331
  };
@@ -380,6 +389,7 @@ const parseT3MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
380
389
  debtAsset1Data.incentiveSupplyApy = yield getStakingApy(debtAsset1.symbol, mainnetWeb3);
381
390
  debtAsset1Data.incentiveSupplyToken = debtAsset1.symbol;
382
391
  }
392
+ const marketBorrowRate = getMarketRateForDex(token1PerBorrowShare, token0PerBorrowShare, borrowRate0, borrowRate1);
383
393
  const assetsData = [
384
394
  [collAsset.symbol, collAssetData],
385
395
  [debtAsset0.symbol, debtAsset0Data],
@@ -421,7 +431,7 @@ const parseT3MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
421
431
  withdrawableUntilLimit: getEthAmountForDecimals(data.withdrawableUntilLimit, collAsset.decimals),
422
432
  withdrawable: getEthAmountForDecimals(data.withdrawable, collAsset.decimals),
423
433
  liquidationMaxLimit,
424
- borrowRate: '0',
434
+ borrowRate: marketBorrowRate,
425
435
  supplyRate,
426
436
  borrowableToken0,
427
437
  borrowableToken1,
@@ -518,6 +528,8 @@ const parseT4MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
518
528
  debtAsset1Data.incentiveSupplyApy = yield getStakingApy(debtAsset1.symbol, mainnetWeb3);
519
529
  debtAsset1Data.incentiveSupplyToken = debtAsset1.symbol;
520
530
  }
531
+ const marketBorrowRate = getMarketRateForDex(token1PerBorrowShare, token0PerBorrowShare, borrowRate0, borrowRate1);
532
+ const marketSupplyRate = getMarketRateForDex(token1PerSupplyShare, token0PerSupplyShare, supplyRate0, supplyRate1);
521
533
  const assetsData = [
522
534
  [collAsset0.symbol, collAsset0Data],
523
535
  [collAsset1.symbol, collAsset1Data],
@@ -562,8 +574,8 @@ const parseT4MarketData = (web3, data, network, mainnetWeb3) => __awaiter(void 0
562
574
  totalSupplyVaultUsd,
563
575
  totalBorrowVaultUsd,
564
576
  liquidationMaxLimit,
565
- borrowRate: '0',
566
- supplyRate: '0',
577
+ borrowRate: marketBorrowRate,
578
+ supplyRate: marketSupplyRate,
567
579
  borrowableToken0,
568
580
  borrowableToken1,
569
581
  totalBorrowToken0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/positions-sdk",
3
- "version": "1.0.11-fluid-dev8",
3
+ "version": "1.0.11-fluid-dev10",
4
4
  "description": "",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -1148,8 +1148,8 @@ module.exports = {
1148
1148
  "abi": [{"inputs":[{"internalType":"address","name":"_vault","type":"address"},{"internalType":"uint256","name":"_token0Amount","type":"uint256"},{"internalType":"uint256","name":"_token1Amount","type":"uint256"},{"internalType":"uint256","name":"_maxSharesAmount","type":"uint256"}],"name":"estimateBorrow","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"},{"internalType":"uint256","name":"_token0Amount","type":"uint256"},{"internalType":"uint256","name":"_token1Amount","type":"uint256"},{"internalType":"uint256","name":"_minSharesAmount","type":"uint256"}],"name":"estimateDeposit","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nftId","type":"uint256"},{"internalType":"uint256","name":"_minToken0AmountToAccept","type":"uint256"},{"internalType":"uint256","name":"_minToken1AmountToAccept","type":"uint256"}],"name":"estimateDexPositionCollateralInOneToken","outputs":[{"internalType":"uint256","name":"collateral","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nftId","type":"uint256"},{"internalType":"uint256","name":"_maxToken0AmountToPayback","type":"uint256"},{"internalType":"uint256","name":"_maxToken1AmountToPayback","type":"uint256"}],"name":"estimateDexPositionDebtInOneToken","outputs":[{"internalType":"uint256","name":"debt","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"},{"internalType":"uint256","name":"_token0Amount","type":"uint256"},{"internalType":"uint256","name":"_token1Amount","type":"uint256"},{"internalType":"uint256","name":"_minSharesAmount","type":"uint256"}],"name":"estimatePayback","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"},{"internalType":"uint256","name":"_token0Amount","type":"uint256"},{"internalType":"uint256","name":"_token1Amount","type":"uint256"},{"internalType":"uint256","name":"_maxSharesAmount","type":"uint256"}],"name":"estimateWithdraw","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAllFTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllFTokensData","outputs":[{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"bool","name":"isNativeUnderlying","type":"bool"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"decimals","type":"uint256"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"totalAssets","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"convertToShares","type":"uint256"},{"internalType":"uint256","name":"convertToAssets","type":"uint256"},{"internalType":"uint256","name":"rewardsRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"},{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"}],"internalType":"struct FluidView.FTokenData[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getAllUserEarnPositionsWithFTokens","outputs":[{"components":[{"internalType":"uint256","name":"fTokenShares","type":"uint256"},{"internalType":"uint256","name":"underlyingAssets","type":"uint256"},{"internalType":"uint256","name":"underlyingBalance","type":"uint256"},{"internalType":"uint256","name":"allowance","type":"uint256"}],"internalType":"struct FluidView.UserEarnPosition[]","name":"userPositions","type":"tuple[]"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"bool","name":"isNativeUnderlying","type":"bool"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"decimals","type":"uint256"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"totalAssets","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"convertToShares","type":"uint256"},{"internalType":"uint256","name":"convertToAssets","type":"uint256"},{"internalType":"uint256","name":"rewardsRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"},{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"}],"internalType":"struct FluidView.FTokenData[]","name":"fTokensData","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"name":"getDexShareRates","outputs":[{"internalType":"uint256","name":"token0PerSupplyShare","type":"uint256"},{"internalType":"uint256","name":"token1PerSupplyShare","type":"uint256"},{"internalType":"uint256","name":"token0PerBorrowShare","type":"uint256"},{"internalType":"uint256","name":"token1PerBorrowShare","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_fToken","type":"address"}],"name":"getFTokenData","outputs":[{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"bool","name":"isNativeUnderlying","type":"bool"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"decimals","type":"uint256"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"totalAssets","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"convertToShares","type":"uint256"},{"internalType":"uint256","name":"convertToAssets","type":"uint256"},{"internalType":"uint256","name":"rewardsRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"},{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"}],"internalType":"struct FluidView.FTokenData","name":"fTokenData","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nftId","type":"uint256"}],"name":"getPositionByNftId","outputs":[{"components":[{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bool","name":"isLiquidated","type":"bool"},{"internalType":"bool","name":"isSupplyPosition","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"ratio","type":"uint256"},{"internalType":"int256","name":"tick","type":"int256"},{"internalType":"uint256","name":"tickId","type":"uint256"}],"internalType":"struct FluidView.UserPosition","name":"position","type":"tuple"},{"components":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"vaultType","type":"uint256"},{"internalType":"bool","name":"isSmartColl","type":"bool"},{"internalType":"bool","name":"isSmartDebt","type":"bool"},{"internalType":"address","name":"supplyToken0","type":"address"},{"internalType":"address","name":"supplyToken1","type":"address"},{"internalType":"address","name":"borrowToken0","type":"address"},{"internalType":"address","name":"borrowToken1","type":"address"},{"internalType":"uint256","name":"supplyToken0Decimals","type":"uint256"},{"internalType":"uint256","name":"supplyToken1Decimals","type":"uint256"},{"internalType":"uint256","name":"borrowToken0Decimals","type":"uint256"},{"internalType":"uint256","name":"borrowToken1Decimals","type":"uint256"},{"internalType":"uint16","name":"collateralFactor","type":"uint16"},{"internalType":"uint16","name":"liquidationThreshold","type":"uint16"},{"internalType":"uint16","name":"liquidationMaxLimit","type":"uint16"},{"internalType":"uint16","name":"withdrawalGap","type":"uint16"},{"internalType":"uint16","name":"liquidationPenalty","type":"uint16"},{"internalType":"uint16","name":"borrowFee","type":"uint16"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"uint256","name":"oraclePriceOperate","type":"uint256"},{"internalType":"uint256","name":"oraclePriceLiquidate","type":"uint256"},{"internalType":"uint256","name":"vaultSupplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"vaultBorrowExchangePrice","type":"uint256"},{"internalType":"int256","name":"supplyRateVault","type":"int256"},{"internalType":"int256","name":"borrowRateVault","type":"int256"},{"internalType":"int256","name":"rewardsOrFeeRateSupply","type":"int256"},{"internalType":"int256","name":"rewardsOrFeeRateBorrow","type":"int256"},{"internalType":"uint256","name":"totalPositions","type":"uint256"},{"internalType":"uint256","name":"totalSupplyVault","type":"uint256"},{"internalType":"uint256","name":"totalBorrowVault","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawExpandPercent","type":"uint256"},{"internalType":"uint256","name":"withdrawExpandDuration","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowExpandPercent","type":"uint256"},{"internalType":"uint256","name":"borrowExpandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"minimumBorrowing","type":"uint256"},{"components":[{"internalType":"address","name":"dexPool","type":"address"},{"internalType":"uint256","name":"dexId","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"centerPrice","type":"uint256"},{"internalType":"uint256","name":"token0Utilization","type":"uint256"},{"internalType":"uint256","name":"token1Utilization","type":"uint256"},{"internalType":"uint256","name":"totalSupplyShares","type":"uint256"},{"internalType":"uint256","name":"maxSupplyShares","type":"uint256"},{"internalType":"uint256","name":"token0Supplied","type":"uint256"},{"internalType":"uint256","name":"token1Supplied","type":"uint256"},{"internalType":"uint256","name":"sharesWithdrawable","type":"uint256"},{"internalType":"uint256","name":"token0Withdrawable","type":"uint256"},{"internalType":"uint256","name":"token1Withdrawable","type":"uint256"},{"internalType":"uint256","name":"token0PerSupplyShare","type":"uint256"},{"internalType":"uint256","name":"token1PerSupplyShare","type":"uint256"},{"internalType":"uint256","name":"token0SupplyRate","type":"uint256"},{"internalType":"uint256","name":"token1SupplyRate","type":"uint256"},{"internalType":"address","name":"quoteToken","type":"address"},{"internalType":"uint256","name":"quoteTokensPerShare","type":"uint256"},{"internalType":"uint256","name":"supplyToken0Reserves","type":"uint256"},{"internalType":"uint256","name":"supplyToken1Reserves","type":"uint256"}],"internalType":"struct FluidView.DexSupplyData","name":"dexSupplyData","type":"tuple"},{"components":[{"internalType":"address","name":"dexPool","type":"address"},{"internalType":"uint256","name":"dexId","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"centerPrice","type":"uint256"},{"internalType":"uint256","name":"token0Utilization","type":"uint256"},{"internalType":"uint256","name":"token1Utilization","type":"uint256"},{"internalType":"uint256","name":"totalBorrowShares","type":"uint256"},{"internalType":"uint256","name":"maxBorrowShares","type":"uint256"},{"internalType":"uint256","name":"token0Borrowed","type":"uint256"},{"internalType":"uint256","name":"token1Borrowed","type":"uint256"},{"internalType":"uint256","name":"sharesBorrowable","type":"uint256"},{"internalType":"uint256","name":"token0Borrowable","type":"uint256"},{"internalType":"uint256","name":"token1Borrowable","type":"uint256"},{"internalType":"uint256","name":"token0PerBorrowShare","type":"uint256"},{"internalType":"uint256","name":"token1PerBorrowShare","type":"uint256"},{"internalType":"uint256","name":"token0BorrowRate","type":"uint256"},{"internalType":"uint256","name":"token1BorrowRate","type":"uint256"},{"internalType":"address","name":"quoteToken","type":"address"},{"internalType":"uint256","name":"quoteTokensPerShare","type":"uint256"},{"internalType":"uint256","name":"borrowToken0Reserves","type":"uint256"},{"internalType":"uint256","name":"borrowToken1Reserves","type":"uint256"}],"internalType":"struct FluidView.DexBorrowData","name":"dexBorrowData","type":"tuple"}],"internalType":"struct FluidView.VaultData","name":"vault","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nftId","type":"uint256"}],"name":"getRatio","outputs":[{"internalType":"uint256","name":"ratio","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_fToken","type":"address"},{"internalType":"address","name":"_user","type":"address"}],"name":"getUserEarnPosition","outputs":[{"components":[{"internalType":"uint256","name":"fTokenShares","type":"uint256"},{"internalType":"uint256","name":"underlyingAssets","type":"uint256"},{"internalType":"uint256","name":"underlyingBalance","type":"uint256"},{"internalType":"uint256","name":"allowance","type":"uint256"}],"internalType":"struct FluidView.UserEarnPosition","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_fToken","type":"address"},{"internalType":"address","name":"_user","type":"address"}],"name":"getUserEarnPositionWithFToken","outputs":[{"components":[{"internalType":"uint256","name":"fTokenShares","type":"uint256"},{"internalType":"uint256","name":"underlyingAssets","type":"uint256"},{"internalType":"uint256","name":"underlyingBalance","type":"uint256"},{"internalType":"uint256","name":"allowance","type":"uint256"}],"internalType":"struct FluidView.UserEarnPosition","name":"userPosition","type":"tuple"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"bool","name":"isNativeUnderlying","type":"bool"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"decimals","type":"uint256"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"totalAssets","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"convertToShares","type":"uint256"},{"internalType":"uint256","name":"convertToAssets","type":"uint256"},{"internalType":"uint256","name":"rewardsRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"},{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"}],"internalType":"struct FluidView.FTokenData","name":"fTokenData","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserNftIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserNftIdsWithVaultIds","outputs":[{"components":[{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"address","name":"vaultAddr","type":"address"}],"internalType":"struct FluidView.NftWithVault[]","name":"retVal","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserPositions","outputs":[{"components":[{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bool","name":"isLiquidated","type":"bool"},{"internalType":"bool","name":"isSupplyPosition","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"ratio","type":"uint256"},{"internalType":"int256","name":"tick","type":"int256"},{"internalType":"uint256","name":"tickId","type":"uint256"}],"internalType":"struct FluidView.UserPosition[]","name":"positions","type":"tuple[]"},{"components":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"vaultType","type":"uint256"},{"internalType":"bool","name":"isSmartColl","type":"bool"},{"internalType":"bool","name":"isSmartDebt","type":"bool"},{"internalType":"address","name":"supplyToken0","type":"address"},{"internalType":"address","name":"supplyToken1","type":"address"},{"internalType":"address","name":"borrowToken0","type":"address"},{"internalType":"address","name":"borrowToken1","type":"address"},{"internalType":"uint256","name":"supplyToken0Decimals","type":"uint256"},{"internalType":"uint256","name":"supplyToken1Decimals","type":"uint256"},{"internalType":"uint256","name":"borrowToken0Decimals","type":"uint256"},{"internalType":"uint256","name":"borrowToken1Decimals","type":"uint256"},{"internalType":"uint16","name":"collateralFactor","type":"uint16"},{"internalType":"uint16","name":"liquidationThreshold","type":"uint16"},{"internalType":"uint16","name":"liquidationMaxLimit","type":"uint16"},{"internalType":"uint16","name":"withdrawalGap","type":"uint16"},{"internalType":"uint16","name":"liquidationPenalty","type":"uint16"},{"internalType":"uint16","name":"borrowFee","type":"uint16"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"uint256","name":"oraclePriceOperate","type":"uint256"},{"internalType":"uint256","name":"oraclePriceLiquidate","type":"uint256"},{"internalType":"uint256","name":"vaultSupplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"vaultBorrowExchangePrice","type":"uint256"},{"internalType":"int256","name":"supplyRateVault","type":"int256"},{"internalType":"int256","name":"borrowRateVault","type":"int256"},{"internalType":"int256","name":"rewardsOrFeeRateSupply","type":"int256"},{"internalType":"int256","name":"rewardsOrFeeRateBorrow","type":"int256"},{"internalType":"uint256","name":"totalPositions","type":"uint256"},{"internalType":"uint256","name":"totalSupplyVault","type":"uint256"},{"internalType":"uint256","name":"totalBorrowVault","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawExpandPercent","type":"uint256"},{"internalType":"uint256","name":"withdrawExpandDuration","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowExpandPercent","type":"uint256"},{"internalType":"uint256","name":"borrowExpandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"minimumBorrowing","type":"uint256"},{"components":[{"internalType":"address","name":"dexPool","type":"address"},{"internalType":"uint256","name":"dexId","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"centerPrice","type":"uint256"},{"internalType":"uint256","name":"token0Utilization","type":"uint256"},{"internalType":"uint256","name":"token1Utilization","type":"uint256"},{"internalType":"uint256","name":"totalSupplyShares","type":"uint256"},{"internalType":"uint256","name":"maxSupplyShares","type":"uint256"},{"internalType":"uint256","name":"token0Supplied","type":"uint256"},{"internalType":"uint256","name":"token1Supplied","type":"uint256"},{"internalType":"uint256","name":"sharesWithdrawable","type":"uint256"},{"internalType":"uint256","name":"token0Withdrawable","type":"uint256"},{"internalType":"uint256","name":"token1Withdrawable","type":"uint256"},{"internalType":"uint256","name":"token0PerSupplyShare","type":"uint256"},{"internalType":"uint256","name":"token1PerSupplyShare","type":"uint256"},{"internalType":"uint256","name":"token0SupplyRate","type":"uint256"},{"internalType":"uint256","name":"token1SupplyRate","type":"uint256"},{"internalType":"address","name":"quoteToken","type":"address"},{"internalType":"uint256","name":"quoteTokensPerShare","type":"uint256"},{"internalType":"uint256","name":"supplyToken0Reserves","type":"uint256"},{"internalType":"uint256","name":"supplyToken1Reserves","type":"uint256"}],"internalType":"struct FluidView.DexSupplyData","name":"dexSupplyData","type":"tuple"},{"components":[{"internalType":"address","name":"dexPool","type":"address"},{"internalType":"uint256","name":"dexId","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"centerPrice","type":"uint256"},{"internalType":"uint256","name":"token0Utilization","type":"uint256"},{"internalType":"uint256","name":"token1Utilization","type":"uint256"},{"internalType":"uint256","name":"totalBorrowShares","type":"uint256"},{"internalType":"uint256","name":"maxBorrowShares","type":"uint256"},{"internalType":"uint256","name":"token0Borrowed","type":"uint256"},{"internalType":"uint256","name":"token1Borrowed","type":"uint256"},{"internalType":"uint256","name":"sharesBorrowable","type":"uint256"},{"internalType":"uint256","name":"token0Borrowable","type":"uint256"},{"internalType":"uint256","name":"token1Borrowable","type":"uint256"},{"internalType":"uint256","name":"token0PerBorrowShare","type":"uint256"},{"internalType":"uint256","name":"token1PerBorrowShare","type":"uint256"},{"internalType":"uint256","name":"token0BorrowRate","type":"uint256"},{"internalType":"uint256","name":"token1BorrowRate","type":"uint256"},{"internalType":"address","name":"quoteToken","type":"address"},{"internalType":"uint256","name":"quoteTokensPerShare","type":"uint256"},{"internalType":"uint256","name":"borrowToken0Reserves","type":"uint256"},{"internalType":"uint256","name":"borrowToken1Reserves","type":"uint256"}],"internalType":"struct FluidView.DexBorrowData","name":"dexBorrowData","type":"tuple"}],"internalType":"struct FluidView.VaultData[]","name":"vaults","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"name":"getVaultData","outputs":[{"components":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"vaultType","type":"uint256"},{"internalType":"bool","name":"isSmartColl","type":"bool"},{"internalType":"bool","name":"isSmartDebt","type":"bool"},{"internalType":"address","name":"supplyToken0","type":"address"},{"internalType":"address","name":"supplyToken1","type":"address"},{"internalType":"address","name":"borrowToken0","type":"address"},{"internalType":"address","name":"borrowToken1","type":"address"},{"internalType":"uint256","name":"supplyToken0Decimals","type":"uint256"},{"internalType":"uint256","name":"supplyToken1Decimals","type":"uint256"},{"internalType":"uint256","name":"borrowToken0Decimals","type":"uint256"},{"internalType":"uint256","name":"borrowToken1Decimals","type":"uint256"},{"internalType":"uint16","name":"collateralFactor","type":"uint16"},{"internalType":"uint16","name":"liquidationThreshold","type":"uint16"},{"internalType":"uint16","name":"liquidationMaxLimit","type":"uint16"},{"internalType":"uint16","name":"withdrawalGap","type":"uint16"},{"internalType":"uint16","name":"liquidationPenalty","type":"uint16"},{"internalType":"uint16","name":"borrowFee","type":"uint16"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"uint256","name":"oraclePriceOperate","type":"uint256"},{"internalType":"uint256","name":"oraclePriceLiquidate","type":"uint256"},{"internalType":"uint256","name":"vaultSupplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"vaultBorrowExchangePrice","type":"uint256"},{"internalType":"int256","name":"supplyRateVault","type":"int256"},{"internalType":"int256","name":"borrowRateVault","type":"int256"},{"internalType":"int256","name":"rewardsOrFeeRateSupply","type":"int256"},{"internalType":"int256","name":"rewardsOrFeeRateBorrow","type":"int256"},{"internalType":"uint256","name":"totalPositions","type":"uint256"},{"internalType":"uint256","name":"totalSupplyVault","type":"uint256"},{"internalType":"uint256","name":"totalBorrowVault","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawExpandPercent","type":"uint256"},{"internalType":"uint256","name":"withdrawExpandDuration","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowExpandPercent","type":"uint256"},{"internalType":"uint256","name":"borrowExpandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"minimumBorrowing","type":"uint256"},{"components":[{"internalType":"address","name":"dexPool","type":"address"},{"internalType":"uint256","name":"dexId","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"centerPrice","type":"uint256"},{"internalType":"uint256","name":"token0Utilization","type":"uint256"},{"internalType":"uint256","name":"token1Utilization","type":"uint256"},{"internalType":"uint256","name":"totalSupplyShares","type":"uint256"},{"internalType":"uint256","name":"maxSupplyShares","type":"uint256"},{"internalType":"uint256","name":"token0Supplied","type":"uint256"},{"internalType":"uint256","name":"token1Supplied","type":"uint256"},{"internalType":"uint256","name":"sharesWithdrawable","type":"uint256"},{"internalType":"uint256","name":"token0Withdrawable","type":"uint256"},{"internalType":"uint256","name":"token1Withdrawable","type":"uint256"},{"internalType":"uint256","name":"token0PerSupplyShare","type":"uint256"},{"internalType":"uint256","name":"token1PerSupplyShare","type":"uint256"},{"internalType":"uint256","name":"token0SupplyRate","type":"uint256"},{"internalType":"uint256","name":"token1SupplyRate","type":"uint256"},{"internalType":"address","name":"quoteToken","type":"address"},{"internalType":"uint256","name":"quoteTokensPerShare","type":"uint256"},{"internalType":"uint256","name":"supplyToken0Reserves","type":"uint256"},{"internalType":"uint256","name":"supplyToken1Reserves","type":"uint256"}],"internalType":"struct FluidView.DexSupplyData","name":"dexSupplyData","type":"tuple"},{"components":[{"internalType":"address","name":"dexPool","type":"address"},{"internalType":"uint256","name":"dexId","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"centerPrice","type":"uint256"},{"internalType":"uint256","name":"token0Utilization","type":"uint256"},{"internalType":"uint256","name":"token1Utilization","type":"uint256"},{"internalType":"uint256","name":"totalBorrowShares","type":"uint256"},{"internalType":"uint256","name":"maxBorrowShares","type":"uint256"},{"internalType":"uint256","name":"token0Borrowed","type":"uint256"},{"internalType":"uint256","name":"token1Borrowed","type":"uint256"},{"internalType":"uint256","name":"sharesBorrowable","type":"uint256"},{"internalType":"uint256","name":"token0Borrowable","type":"uint256"},{"internalType":"uint256","name":"token1Borrowable","type":"uint256"},{"internalType":"uint256","name":"token0PerBorrowShare","type":"uint256"},{"internalType":"uint256","name":"token1PerBorrowShare","type":"uint256"},{"internalType":"uint256","name":"token0BorrowRate","type":"uint256"},{"internalType":"uint256","name":"token1BorrowRate","type":"uint256"},{"internalType":"address","name":"quoteToken","type":"address"},{"internalType":"uint256","name":"quoteTokensPerShare","type":"uint256"},{"internalType":"uint256","name":"borrowToken0Reserves","type":"uint256"},{"internalType":"uint256","name":"borrowToken1Reserves","type":"uint256"}],"internalType":"struct FluidView.DexBorrowData","name":"dexBorrowData","type":"tuple"}],"internalType":"struct FluidView.VaultData","name":"vaultData","type":"tuple"}],"stateMutability":"nonpayable","type":"function"}],
1149
1149
  "networks": {
1150
1150
  "1": { "address": "0xc8df052bD7A8d76a34c09e758Dff3c6298C0115c" },
1151
- "8453": { "address": "0x5835CaDbA8843CD6d6d55782908351E9c74221aD" },
1152
- "42161": { "address": "0x2d51BB6Ac5c1eC8DD6432e1FF980fC864B626e01" }
1151
+ "8453": { "address": "0x6cd4D6af4F292817eA2A2311F099dF26cd015028" },
1152
+ "42161": { "address": "0xf9e6d5568887ac8eC6fA33B7eefD2A176A958e71" }
1153
1153
  }
1154
1154
  }
1155
1155
  }
@@ -259,6 +259,16 @@ const parseT1MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutp
259
259
  } as FluidMarketData;
260
260
  };
261
261
 
262
+ const getMarketRateForDex = (token1PerShare: string, token0PerShare: string, rate0: string, rate1: string) => {
263
+ const sharesCombined = new Dec(token1PerShare).plus(token0PerShare);
264
+
265
+ const rate0PerShare = new Dec(rate0).mul(token0PerShare).div(sharesCombined).toString();
266
+
267
+ const rate1PerShare = new Dec(rate1).mul(token1PerShare).div(sharesCombined).toString();
268
+
269
+ return new Dec(rate0PerShare).plus(rate1PerShare).toString();
270
+ };
271
+
262
272
  const parseT2MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutputStruct, network: NetworkNumber, mainnetWeb3: Web3) => {
263
273
  const collAsset0 = getAssetInfoByAddress(data.supplyToken0, network);
264
274
  const collAsset1 = getAssetInfoByAddress(data.supplyToken1, network);
@@ -326,11 +336,13 @@ const parseT2MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutp
326
336
  collFirstAssetData.incentiveSupplyToken = collAsset1.symbol;
327
337
  }
328
338
 
339
+ const marketSupplyRate = getMarketRateForDex(token1PerSupplyShare, token0PerSupplyShare, supplyRate0, supplyRate1);
340
+
329
341
  const borrowRate = new Dec(data.borrowRateVault).div(100).toString();
330
342
  const debtAssetData: Partial<FluidAssetData> = {
331
343
  symbol: debtAsset.symbol,
332
- address: debtAsset.address,
333
344
  price: prices[debtAsset.address],
345
+ address: debtAsset.address,
334
346
  totalBorrow: data.totalBorrowVault,
335
347
  canBeBorrowed: true,
336
348
  borrowRate,
@@ -361,6 +373,8 @@ const parseT2MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutp
361
373
  const totalSupplySharesInVault = assetAmountInEth(data.totalSupplyVault);
362
374
  const collSharePrice = new Dec(oraclePrice).mul(prices[debtAsset.address]).toString();
363
375
  const totalSupplyVaultUsd = new Dec(totalSupplySharesInVault).mul(collSharePrice).toString();
376
+ const maxSupplySharesUsd = new Dec(maxSupplyShares).mul(collSharePrice).toString();
377
+
364
378
  const withdrawableUSD = new Dec(withdrawableShares).mul(collSharePrice).toString();
365
379
 
366
380
  const marketData = {
@@ -394,7 +408,7 @@ const parseT2MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutp
394
408
  minimumBorrowing: getEthAmountForDecimals(data.minimumBorrowing, debtAsset.decimals),
395
409
  liquidationMaxLimit,
396
410
  borrowRate,
397
- supplyRate: '0',
411
+ supplyRate: marketSupplyRate,
398
412
  totalSupplyToken0,
399
413
  totalSupplyToken1,
400
414
  withdrawableToken0,
@@ -403,6 +417,7 @@ const parseT2MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutp
403
417
  withdrawable: withdrawableShares,
404
418
  widthdrawableDex: new Dec(maxSupplyShares).minus(totalSupplyShares).toString(),
405
419
  maxSupplyShares,
420
+ maxSupplySharesUsd,
406
421
  collDexFee: supplyDexFee,
407
422
  oraclePrice,
408
423
  };
@@ -413,6 +428,7 @@ const parseT2MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutp
413
428
  } as FluidMarketData;
414
429
  };
415
430
 
431
+
416
432
  const parseT3MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutputStruct, network: NetworkNumber, mainnetWeb3: Web3) => {
417
433
  const collAsset = getAssetInfoByAddress(data.supplyToken0, network);
418
434
  const debtAsset0 = getAssetInfoByAddress(data.borrowToken0, network);
@@ -493,6 +509,7 @@ const parseT3MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutp
493
509
  debtAsset1Data.incentiveSupplyApy = await getStakingApy(debtAsset1.symbol, mainnetWeb3);
494
510
  debtAsset1Data.incentiveSupplyToken = debtAsset1.symbol;
495
511
  }
512
+ const marketBorrowRate = getMarketRateForDex(token1PerBorrowShare, token0PerBorrowShare, borrowRate0, borrowRate1);
496
513
 
497
514
  const assetsData: FluidAssetsData = ([
498
515
  [collAsset.symbol, collAssetData],
@@ -546,7 +563,7 @@ const parseT3MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutp
546
563
  withdrawableUntilLimit: getEthAmountForDecimals(data.withdrawableUntilLimit, collAsset.decimals),
547
564
  withdrawable: getEthAmountForDecimals(data.withdrawable, collAsset.decimals),
548
565
  liquidationMaxLimit,
549
- borrowRate: '0',
566
+ borrowRate: marketBorrowRate,
550
567
  supplyRate,
551
568
  borrowableToken0,
552
569
  borrowableToken1,
@@ -695,6 +712,9 @@ const parseT4MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutp
695
712
  debtAsset1Data.incentiveSupplyToken = debtAsset1.symbol;
696
713
  }
697
714
 
715
+ const marketBorrowRate = getMarketRateForDex(token1PerBorrowShare, token0PerBorrowShare, borrowRate0, borrowRate1);
716
+ const marketSupplyRate = getMarketRateForDex(token1PerSupplyShare, token0PerSupplyShare, supplyRate0, supplyRate1);
717
+
698
718
  const assetsData: FluidAssetsData = ([
699
719
  [collAsset0.symbol, collAsset0Data],
700
720
  [collAsset1.symbol, collAsset1Data],
@@ -747,8 +767,8 @@ const parseT4MarketData = async (web3: Web3, data: FluidView.VaultDataStructOutp
747
767
  totalSupplyVaultUsd,
748
768
  totalBorrowVaultUsd,
749
769
  liquidationMaxLimit,
750
- borrowRate: '0',
751
- supplyRate: '0',
770
+ borrowRate: marketBorrowRate,
771
+ supplyRate: marketSupplyRate,
752
772
  borrowableToken0,
753
773
  borrowableToken1,
754
774
  totalBorrowToken0,