@defisaver/positions-sdk 2.1.147-spark-ltv0-fallback-dev → 2.1.148-comp-dev

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.
@@ -507,6 +507,14 @@ export const cWstETHv3 = {
507
507
  },
508
508
  },
509
509
  };
510
+ export const ciUSDCv3 = {
511
+ "abi": [{ "inputs": [{ "internalType": "address", "name": "manager", "type": "address" }, { "internalType": "bool", "name": "isAllowed_", "type": "bool" }], "name": "allow", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "address", "name": "governor", "type": "address" }, { "internalType": "address", "name": "pauseGuardian", "type": "address" }, { "internalType": "address", "name": "baseToken", "type": "address" }, { "internalType": "address", "name": "baseTokenPriceFeed", "type": "address" }, { "internalType": "address", "name": "extensionDelegate", "type": "address" }, { "internalType": "uint64", "name": "supplyKink", "type": "uint64" }, { "internalType": "uint64", "name": "supplyPerYearInterestRateSlopeLow", "type": "uint64" }, { "internalType": "uint64", "name": "supplyPerYearInterestRateSlopeHigh", "type": "uint64" }, { "internalType": "uint64", "name": "supplyPerYearInterestRateBase", "type": "uint64" }, { "internalType": "uint64", "name": "borrowKink", "type": "uint64" }, { "internalType": "uint64", "name": "borrowPerYearInterestRateSlopeLow", "type": "uint64" }, { "internalType": "uint64", "name": "borrowPerYearInterestRateSlopeHigh", "type": "uint64" }, { "internalType": "uint64", "name": "borrowPerYearInterestRateBase", "type": "uint64" }, { "internalType": "uint64", "name": "storeFrontPriceFactor", "type": "uint64" }, { "internalType": "uint64", "name": "trackingIndexScale", "type": "uint64" }, { "internalType": "uint64", "name": "baseTrackingSupplySpeed", "type": "uint64" }, { "internalType": "uint64", "name": "baseTrackingBorrowSpeed", "type": "uint64" }, { "internalType": "uint104", "name": "baseMinForRewards", "type": "uint104" }, { "internalType": "uint104", "name": "baseBorrowMin", "type": "uint104" }, { "internalType": "uint104", "name": "targetReserves", "type": "uint104" }, { "components": [{ "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "address", "name": "priceFeed", "type": "address" }, { "internalType": "uint8", "name": "decimals", "type": "uint8" }, { "internalType": "uint64", "name": "borrowCollateralFactor", "type": "uint64" }, { "internalType": "uint64", "name": "liquidateCollateralFactor", "type": "uint64" }, { "internalType": "uint64", "name": "liquidationFactor", "type": "uint64" }, { "internalType": "uint128", "name": "supplyCap", "type": "uint128" }], "internalType": "struct CometConfiguration.AssetConfig[]", "name": "assetConfigs", "type": "tuple[]" }], "internalType": "struct CometConfiguration.Configuration", "name": "config", "type": "tuple" }], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "Absurd", "type": "error" }, { "inputs": [], "name": "AlreadyInitialized", "type": "error" }, { "inputs": [], "name": "BadAsset", "type": "error" }, { "inputs": [], "name": "BadDecimals", "type": "error" }, { "inputs": [], "name": "BadDiscount", "type": "error" }, { "inputs": [], "name": "BadMinimum", "type": "error" }, { "inputs": [], "name": "BadPrice", "type": "error" }, { "inputs": [], "name": "BorrowCFTooLarge", "type": "error" }, { "inputs": [], "name": "BorrowTooSmall", "type": "error" }, { "inputs": [], "name": "InsufficientReserves", "type": "error" }, { "inputs": [], "name": "InvalidInt104", "type": "error" }, { "inputs": [], "name": "InvalidInt256", "type": "error" }, { "inputs": [], "name": "InvalidUInt104", "type": "error" }, { "inputs": [], "name": "InvalidUInt128", "type": "error" }, { "inputs": [], "name": "InvalidUInt64", "type": "error" }, { "inputs": [], "name": "LiquidateCFTooLarge", "type": "error" }, { "inputs": [], "name": "NegativeNumber", "type": "error" }, { "inputs": [], "name": "NoSelfTransfer", "type": "error" }, { "inputs": [], "name": "NotCollateralized", "type": "error" }, { "inputs": [], "name": "NotForSale", "type": "error" }, { "inputs": [], "name": "NotLiquidatable", "type": "error" }, { "inputs": [], "name": "Paused", "type": "error" }, { "inputs": [], "name": "SupplyCapExceeded", "type": "error" }, { "inputs": [], "name": "TimestampTooLarge", "type": "error" }, { "inputs": [], "name": "TooManyAssets", "type": "error" }, { "inputs": [], "name": "TooMuchSlippage", "type": "error" }, { "inputs": [], "name": "TransferInFailed", "type": "error" }, { "inputs": [], "name": "TransferOutFailed", "type": "error" }, { "inputs": [], "name": "Unauthorized", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "absorber", "type": "address" }, { "indexed": true, "internalType": "address", "name": "borrower", "type": "address" }, { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "collateralAbsorbed", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "usdValue", "type": "uint256" }], "name": "AbsorbCollateral", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "absorber", "type": "address" }, { "indexed": true, "internalType": "address", "name": "borrower", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "basePaidOut", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "usdValue", "type": "uint256" }], "name": "AbsorbDebt", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "buyer", "type": "address" }, { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "baseAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "collateralAmount", "type": "uint256" }], "name": "BuyCollateral", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "bool", "name": "supplyPaused", "type": "bool" }, { "indexed": false, "internalType": "bool", "name": "transferPaused", "type": "bool" }, { "indexed": false, "internalType": "bool", "name": "withdrawPaused", "type": "bool" }, { "indexed": false, "internalType": "bool", "name": "absorbPaused", "type": "bool" }, { "indexed": false, "internalType": "bool", "name": "buyPaused", "type": "bool" }], "name": "PauseAction", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "dst", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "Supply", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "dst", "type": "address" }, { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "SupplyCollateral", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "Transfer", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "TransferCollateral", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "src", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "Withdraw", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "src", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "WithdrawCollateral", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "WithdrawReserves", "type": "event" }, { "stateMutability": "payable", "type": "fallback" }, { "inputs": [{ "internalType": "address", "name": "absorber", "type": "address" }, { "internalType": "address[]", "name": "accounts", "type": "address[]" }], "name": "absorb", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "accrueAccount", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "manager", "type": "address" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "approveThis", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "balanceOf", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseBorrowMin", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseMinForRewards", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseScale", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseToken", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseTokenPriceFeed", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseTrackingBorrowSpeed", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "baseTrackingSupplySpeed", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "borrowBalanceOf", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "borrowKink", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "borrowPerSecondInterestRateBase", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "borrowPerSecondInterestRateSlopeHigh", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "borrowPerSecondInterestRateSlopeLow", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "minAmount", "type": "uint256" }, { "internalType": "uint256", "name": "baseAmount", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }], "name": "buyCollateral", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "decimals", "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "extensionDelegate", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint8", "name": "i", "type": "uint8" }], "name": "getAssetInfo", "outputs": [{ "components": [{ "internalType": "uint8", "name": "offset", "type": "uint8" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "address", "name": "priceFeed", "type": "address" }, { "internalType": "uint64", "name": "scale", "type": "uint64" }, { "internalType": "uint64", "name": "borrowCollateralFactor", "type": "uint64" }, { "internalType": "uint64", "name": "liquidateCollateralFactor", "type": "uint64" }, { "internalType": "uint64", "name": "liquidationFactor", "type": "uint64" }, { "internalType": "uint128", "name": "supplyCap", "type": "uint128" }], "internalType": "struct CometCore.AssetInfo", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], "name": "getAssetInfoByAddress", "outputs": [{ "components": [{ "internalType": "uint8", "name": "offset", "type": "uint8" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "address", "name": "priceFeed", "type": "address" }, { "internalType": "uint64", "name": "scale", "type": "uint64" }, { "internalType": "uint64", "name": "borrowCollateralFactor", "type": "uint64" }, { "internalType": "uint64", "name": "liquidateCollateralFactor", "type": "uint64" }, { "internalType": "uint64", "name": "liquidationFactor", "type": "uint64" }, { "internalType": "uint128", "name": "supplyCap", "type": "uint128" }], "internalType": "struct CometCore.AssetInfo", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "utilization", "type": "uint256" }], "name": "getBorrowRate", "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "priceFeed", "type": "address" }], "name": "getPrice", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getReserves", "outputs": [{ "internalType": "int256", "name": "", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "utilization", "type": "uint256" }], "name": "getSupplyRate", "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getUtilization", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "governor", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "manager", "type": "address" }], "name": "hasPermission", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "initializeStorage", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "isAbsorbPaused", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" }], "name": "isAllowed", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "isBorrowCollateralized", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "isBuyPaused", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "isLiquidatable", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "isSupplyPaused", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "isTransferPaused", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "isWithdrawPaused", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "liquidatorPoints", "outputs": [{ "internalType": "uint32", "name": "numAbsorbs", "type": "uint32" }, { "internalType": "uint64", "name": "numAbsorbed", "type": "uint64" }, { "internalType": "uint128", "name": "approxSpend", "type": "uint128" }, { "internalType": "uint32", "name": "_reserved", "type": "uint32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "numAssets", "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bool", "name": "supplyPaused", "type": "bool" }, { "internalType": "bool", "name": "transferPaused", "type": "bool" }, { "internalType": "bool", "name": "withdrawPaused", "type": "bool" }, { "internalType": "bool", "name": "absorbPaused", "type": "bool" }, { "internalType": "bool", "name": "buyPaused", "type": "bool" }], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "pauseGuardian", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "baseAmount", "type": "uint256" }], "name": "quoteCollateral", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "storeFrontPriceFactor", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "supply", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "dst", "type": "address" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "supplyFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "supplyKink", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "supplyPerSecondInterestRateBase", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "supplyPerSecondInterestRateSlopeHigh", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "supplyPerSecondInterestRateSlopeLow", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "dst", "type": "address" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "supplyTo", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "targetReserves", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalBorrow", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "totalsCollateral", "outputs": [{ "internalType": "uint128", "name": "totalSupplyAsset", "type": "uint128" }, { "internalType": "uint128", "name": "_reserved", "type": "uint128" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "trackingIndexScale", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "dst", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "transfer", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "dst", "type": "address" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "transferAsset", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "src", "type": "address" }, { "internalType": "address", "name": "dst", "type": "address" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "transferAssetFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "src", "type": "address" }, { "internalType": "address", "name": "dst", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "transferFrom", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "userBasic", "outputs": [{ "internalType": "int104", "name": "principal", "type": "int104" }, { "internalType": "uint64", "name": "baseTrackingIndex", "type": "uint64" }, { "internalType": "uint64", "name": "baseTrackingAccrued", "type": "uint64" }, { "internalType": "uint16", "name": "assetsIn", "type": "uint16" }, { "internalType": "uint8", "name": "_reserved", "type": "uint8" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" }], "name": "userCollateral", "outputs": [{ "internalType": "uint128", "name": "balance", "type": "uint128" }, { "internalType": "uint128", "name": "_reserved", "type": "uint128" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "userNonce", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "withdraw", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "src", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "withdrawFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "withdrawReserves", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "withdrawTo", "outputs": [], "stateMutability": "nonpayable", "type": "function" }],
512
+ "networks": {
513
+ "1": {
514
+ "address": "0x207158a267CBD2598BB3d611D8CBdEE2709F2F8C",
515
+ },
516
+ },
517
+ };
510
518
  export const CompV3View = {
511
519
  "abi": [{ "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "uint256", "name": "_supplyAmount", "type": "uint256" }, { "internalType": "uint256", "name": "_borrowAmount", "type": "uint256" }], "name": "getApyAfterValuesEstimation", "outputs": [{ "internalType": "uint256", "name": "utilization", "type": "uint256" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "borrowRate", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAssetPrice", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }], "name": "getAssets", "outputs": [{ "components": [{ "internalType": "uint8", "name": "offset", "type": "uint8" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "address", "name": "priceFeed", "type": "address" }, { "internalType": "uint64", "name": "scale", "type": "uint64" }, { "internalType": "uint64", "name": "borrowCollateralFactor", "type": "uint64" }, { "internalType": "uint64", "name": "liquidateCollateralFactor", "type": "uint64" }, { "internalType": "uint64", "name": "liquidationFactor", "type": "uint64" }, { "internalType": "uint128", "name": "supplyCap", "type": "uint128" }], "internalType": "struct IComet.AssetInfo[]", "name": "assets", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }], "name": "getFullBaseTokenInfo", "outputs": [{ "components": [{ "internalType": "address", "name": "tokenAddr", "type": "address" }, { "internalType": "uint256", "name": "price", "type": "uint256" }, { "internalType": "uint256", "name": "supplyIndex", "type": "uint256" }, { "internalType": "uint256", "name": "borrowIndex", "type": "uint256" }, { "internalType": "uint256", "name": "trackingSupplyIndex", "type": "uint256" }, { "internalType": "uint256", "name": "trackingBorrowIndex", "type": "uint256" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "borrowRate", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrow", "type": "uint256" }, { "internalType": "uint256", "name": "utilization", "type": "uint256" }, { "internalType": "uint256", "name": "baseBorrowMin", "type": "uint256" }, { "internalType": "uint256", "name": "baseTrackingBorrowRewardsSpeed", "type": "uint256" }, { "internalType": "uint256", "name": "baseTrackingSupplyRewardsSpeed", "type": "uint256" }], "internalType": "struct CompV3View.BaseTokenInfoFull", "name": "baseToken", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getFullCollInfo", "outputs": [{ "components": [{ "internalType": "address", "name": "tokenAddr", "type": "address" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "supplyReserved", "type": "uint256" }, { "internalType": "uint256", "name": "borrowCollateralFactor", "type": "uint256" }, { "internalType": "uint256", "name": "liquidateCollateralFactor", "type": "uint256" }, { "internalType": "uint256", "name": "liquidationFactor", "type": "uint256" }, { "internalType": "uint256", "name": "price", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }], "internalType": "struct CompV3View.CollateralInfoFull", "name": "coll", "type": "tuple" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }], "name": "getFullCollInfos", "outputs": [{ "components": [{ "internalType": "address", "name": "tokenAddr", "type": "address" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "supplyReserved", "type": "uint256" }, { "internalType": "uint256", "name": "borrowCollateralFactor", "type": "uint256" }, { "internalType": "uint256", "name": "liquidateCollateralFactor", "type": "uint256" }, { "internalType": "uint256", "name": "liquidationFactor", "type": "uint256" }, { "internalType": "uint256", "name": "price", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }], "internalType": "struct CompV3View.CollateralInfoFull[]", "name": "colls", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }], "name": "getGovernanceInfoFull", "outputs": [{ "components": [{ "internalType": "bool", "name": "isSupplyPaused", "type": "bool" }, { "internalType": "bool", "name": "isTransferPaused", "type": "bool" }, { "internalType": "bool", "name": "isWithdrawPaused", "type": "bool" }, { "internalType": "bool", "name": "isAbsorbPaused", "type": "bool" }], "internalType": "struct CompV3View.GovernanceInfoFull", "name": "govInfo", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getLoanData", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "address[]", "name": "collAddr", "type": "address[]" }, { "internalType": "uint256[]", "name": "collAmounts", "type": "uint256[]" }, { "internalType": "uint256", "name": "depositAmount", "type": "uint256" }, { "internalType": "uint256", "name": "depositValue", "type": "uint256" }, { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" }, { "internalType": "uint256", "name": "borrowValue", "type": "uint256" }, { "internalType": "uint256", "name": "collValue", "type": "uint256" }], "internalType": "struct CompV3View.LoanData", "name": "data", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address[]", "name": "_users", "type": "address[]" }], "name": "getLoanDataArr", "outputs": [{ "components": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "address[]", "name": "collAddr", "type": "address[]" }, { "internalType": "uint256[]", "name": "collAmounts", "type": "uint256[]" }, { "internalType": "uint256", "name": "depositAmount", "type": "uint256" }, { "internalType": "uint256", "name": "depositValue", "type": "uint256" }, { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" }, { "internalType": "uint256", "name": "borrowValue", "type": "uint256" }, { "internalType": "uint256", "name": "collValue", "type": "uint256" }], "internalType": "struct CompV3View.LoanData[]", "name": "loans", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getRewardsOwed", "outputs": [{ "components": [{ "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "owed", "type": "uint256" }], "internalType": "struct ICometRewards.RewardOwed", "name": "rewardsOwed", "type": "tuple" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "uint64", "name": "baseSupplyIndex", "type": "uint64" }, { "internalType": "uint64", "name": "baseBorrowIndex", "type": "uint64" }, { "internalType": "uint64", "name": "trackingSupplyIndex", "type": "uint64" }, { "internalType": "uint64", "name": "trackingBorrowIndex", "type": "uint64" }, { "internalType": "uint104", "name": "totalSupplyBase", "type": "uint104" }, { "internalType": "uint104", "name": "totalBorrowBase", "type": "uint104" }, { "internalType": "uint40", "name": "lastAccrualTime", "type": "uint40" }, { "internalType": "uint8", "name": "pauseFlags", "type": "uint8" }], "internalType": "struct IComet.TotalsBasic", "name": "totals", "type": "tuple" }], "name": "getUtilization", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_owner", "type": "address" }, { "internalType": "address", "name": "_manager", "type": "address" }], "name": "isAllowed", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getRewardsOwed", "outputs": [{ "components": [{ "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "owed", "type": "uint256" }], "internalType": "struct ICometRewards.RewardOwed", "name": "rewardsOwed", "type": "tuple" }], "stateMutability": "view", "type": "function" }],
512
520
  "networks": {
@@ -19,19 +19,6 @@ export declare const sparkGetEmodeMutableProps: ({ eModeCategory, eModeCategorie
19
19
  liquidationRatio: string;
20
20
  collateralFactor: string;
21
21
  };
22
- /**
23
- * @description Per-asset effective LTV and liquidation threshold (LLTV) for the user, eMode-aware.
24
- * Mirrors SparkRatioHelper._getUserAccountDataWithLtvZeroFallback: unlike Aave v3 (eMode ltv-zero
25
- * bitmap), Spark's LTV-0 state lives on the RESERVE config (asset offboarding zeroes the reserve ltv),
26
- * so a zeroed reserve keeps `ltv` 0 even inside the active eMode category, while its `lltv` stays the
27
- * eMode liquidation threshold there (liquidations only consider LLTV). The returned `ltv` is identical
28
- * to sparkGetEmodeMutableProps().collateralFactor whenever the reserve ltv is non-zero, so a ratio
29
- * built on this matches the regular safety ratio whenever no collateral is LTV-0.
30
- */
31
- export declare const sparkGetUserReserveLtvAndLltv: ({ eModeCategory, eModeCategoriesData, assetsData, }: SparkHelperCommon, _asset: string) => {
32
- ltv: string;
33
- lltv: string;
34
- };
35
22
  export declare const sparkGetAggregatedPositionData: ({ usedAssets, eModeCategory, eModeCategoriesData, assetsData, selectedMarket, network, ...rest }: SparkHelperCommon) => SparkAggregatedPositionData;
36
23
  export declare const getApyAfterValuesEstimation: (selectedMarket: SparkMarketData, actions: [{
37
24
  action: string;
@@ -57,36 +57,6 @@ export const sparkGetEmodeMutableProps = ({ eModeCategory, eModeCategoriesData,
57
57
  const { liquidationRatio, collateralFactor } = eModeCategoryData;
58
58
  return ({ liquidationRatio, collateralFactor });
59
59
  };
60
- /**
61
- * @description Offset subtracted from the liquidation threshold (LLTV) when crediting LTV-0 collateral
62
- * in the safety-ratio fallback. Matches SparkView.getSafetyRatioWithLtvZeroFallback ('LLTV - 5%').
63
- * Values are fractions (e.g. 0.8), so 5% === 0.05.
64
- */
65
- const LTV_ZERO_FALLBACK_LLTV_OFFSET = '0.05';
66
- /**
67
- * @description Per-asset effective LTV and liquidation threshold (LLTV) for the user, eMode-aware.
68
- * Mirrors SparkRatioHelper._getUserAccountDataWithLtvZeroFallback: unlike Aave v3 (eMode ltv-zero
69
- * bitmap), Spark's LTV-0 state lives on the RESERVE config (asset offboarding zeroes the reserve ltv),
70
- * so a zeroed reserve keeps `ltv` 0 even inside the active eMode category, while its `lltv` stays the
71
- * eMode liquidation threshold there (liquidations only consider LLTV). The returned `ltv` is identical
72
- * to sparkGetEmodeMutableProps().collateralFactor whenever the reserve ltv is non-zero, so a ratio
73
- * built on this matches the regular safety ratio whenever no collateral is LTV-0.
74
- */
75
- export const sparkGetUserReserveLtvAndLltv = ({ eModeCategory, eModeCategoriesData, assetsData, }, _asset) => {
76
- const asset = getNativeAssetFromWrapped(_asset);
77
- const assetData = assetsData[asset];
78
- const eModeCategoryData = eModeCategoriesData === null || eModeCategoriesData === void 0 ? void 0 : eModeCategoriesData[eModeCategory];
79
- if (eModeCategory === 0
80
- || !eModeCategoryData
81
- || !eModeCategoryData.collateralAssets.includes(asset)
82
- || new Dec(eModeCategoryData.collateralFactor || 0).eq(0)) {
83
- return { ltv: assetData.collateralFactor, lltv: assetData.liquidationRatio };
84
- }
85
- // In the active eMode category the fallback trigger is still the reserve-level ltv (the contract
86
- // checks the reserve config's ltv), so an offboarded asset must not pick up the category-wide eMode ltv.
87
- const ltv = new Dec(assetData.collateralFactor || 0).eq(0) ? '0' : eModeCategoryData.collateralFactor;
88
- return { ltv, lltv: eModeCategoryData.liquidationRatio };
89
- };
90
60
  export const sparkGetAggregatedPositionData = (_a) => {
91
61
  var { usedAssets, eModeCategory, eModeCategoriesData, assetsData, selectedMarket, network } = _a, rest = __rest(_a, ["usedAssets", "eModeCategory", "eModeCategoriesData", "assetsData", "selectedMarket", "network"]);
92
62
  const data = Object.assign({ usedAssets, eModeCategory, eModeCategoriesData, assetsData, selectedMarket, network }, rest);
@@ -100,17 +70,6 @@ export const sparkGetAggregatedPositionData = (_a) => {
100
70
  payload.leftToBorrowUsd = leftToBorrowUsd.lte('0') ? '0' : leftToBorrowUsd.toString();
101
71
  payload.ratio = +payload.suppliedUsd ? new Dec(payload.borrowLimitUsd).div(payload.borrowedUsd).mul(100).toString() : '0';
102
72
  payload.collRatio = +payload.suppliedUsd ? new Dec(payload.suppliedCollateralUsd).div(payload.borrowedUsd).mul(100).toString() : '0';
103
- // Safety ratio as evaluated by the automation bots: LTV-0 collateral is credited at (LLTV - 5%)
104
- // instead of 0 (SparkView.getSafetyRatioWithLtvZeroFallback). Equals `ratio` when no collateral
105
- // is LTV-0. Computed off-chain here so it is available for after-value simulations too.
106
- payload.borrowLimitWithLtvZeroFallbackUsd = getAssetsTotal(usedAssets, ({ isSupplied, collateral }) => isSupplied && collateral, ({ symbol, suppliedUsd }) => {
107
- const { ltv, lltv } = sparkGetUserReserveLtvAndLltv(data, symbol);
108
- const effectiveLtv = new Dec(ltv).eq(0)
109
- ? Dec.max(0, new Dec(lltv).sub(LTV_ZERO_FALLBACK_LLTV_OFFSET))
110
- : new Dec(ltv);
111
- return new Dec(suppliedUsd).mul(effectiveLtv);
112
- });
113
- payload.safetyRatioWithLtvZeroFallback = +payload.suppliedUsd ? new Dec(payload.borrowLimitWithLtvZeroFallbackUsd).div(payload.borrowedUsd).mul(100).toString() : '0';
114
73
  const { netApy, incentiveUsd, totalInterestUsd } = calculateNetApy({ usedAssets, assetsData });
115
74
  payload.netApy = netApy;
116
75
  payload.incentiveUsd = incentiveUsd;
@@ -10,6 +10,7 @@ export declare const COMPOUND_V3_USDBC: (networkId: NetworkNumber) => CompoundMa
10
10
  export declare const COMPOUND_V3_USDT: (networkId: NetworkNumber) => CompoundMarketData;
11
11
  export declare const COMPOUND_V3_WSTETH: (networkId: NetworkNumber) => CompoundMarketData;
12
12
  export declare const COMPOUND_V3_USDS: (networkId: NetworkNumber) => CompoundMarketData;
13
+ export declare const COMPOUND_V3_INSTITUTIONAL_USDC: (networkId: NetworkNumber) => CompoundMarketData;
13
14
  export declare const CompoundMarkets: (networkId: NetworkNumber) => {
14
15
  readonly v2: CompoundMarketData;
15
16
  readonly "v3-ETH": CompoundMarketData;
@@ -19,4 +20,5 @@ export declare const CompoundMarkets: (networkId: NetworkNumber) => {
19
20
  readonly "v3-USDT": CompoundMarketData;
20
21
  readonly "v3-wstETH": CompoundMarketData;
21
22
  readonly "v3-USDS": CompoundMarketData;
23
+ readonly "v3-institutional-USDC": CompoundMarketData;
22
24
  };
@@ -2,7 +2,7 @@ import { ZERO_ADDRESS } from '../../constants';
2
2
  import { getConfigContractAddress } from '../../contracts';
3
3
  import { CompoundVersions, CompoundVersionType, } from '../../types';
4
4
  import { NetworkNumber } from '../../types/common';
5
- import { compoundV2CollateralAssets, v3ETHCollAssets, v3USDbCCollAssets, v3USDCCollAssets, v3USDCeCollAssets, v3USDSCollAssets, v3USDTCollAssets, v3wstETHCollAssets, } from './marketsAssets';
5
+ import { compoundV2CollateralAssets, v3ETHCollAssets, v3USDbCCollAssets, v3USDCCollAssets, v3USDCeCollAssets, v3USDSCollAssets, v3USDTCollAssets, v3wstETHCollAssets, v3InstitutionalUSDCCollAssets, } from './marketsAssets';
6
6
  export { compoundV2CollateralAssets, v3ETHCollAssets, v3USDbCCollAssets, v3USDCCollAssets, v3USDCeCollAssets, v3USDTCollAssets, };
7
7
  const EMPTY_BULKER_OPTIONS = { supply: '', withdraw: '' };
8
8
  const STANDARD_BULKER_OPTIONS = {
@@ -16,6 +16,7 @@ const BULKER_OPTIONS = {
16
16
  [CompoundVersions.CompoundV3USDT]: STANDARD_BULKER_OPTIONS,
17
17
  [CompoundVersions.CompoundV3wstETH]: STANDARD_BULKER_OPTIONS,
18
18
  [CompoundVersions.CompoundV3USDS]: STANDARD_BULKER_OPTIONS,
19
+ [CompoundVersions.CompoundV3InstitutionalUSDC]: STANDARD_BULKER_OPTIONS,
19
20
  // Non-existing markets, keeping it because of typescript
20
21
  [CompoundVersions.CompoundV2]: EMPTY_BULKER_OPTIONS,
21
22
  [CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
@@ -31,6 +32,7 @@ const BULKER_OPTIONS = {
31
32
  [CompoundVersions.CompoundV3USDbC]: EMPTY_BULKER_OPTIONS,
32
33
  [CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
33
34
  [CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
35
+ [CompoundVersions.CompoundV3InstitutionalUSDC]: EMPTY_BULKER_OPTIONS,
34
36
  },
35
37
  [NetworkNumber.Base]: {
36
38
  [CompoundVersions.CompoundV3ETH]: STANDARD_BULKER_OPTIONS,
@@ -42,6 +44,7 @@ const BULKER_OPTIONS = {
42
44
  [CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
43
45
  [CompoundVersions.CompoundV3USDT]: EMPTY_BULKER_OPTIONS,
44
46
  [CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
47
+ [CompoundVersions.CompoundV3InstitutionalUSDC]: EMPTY_BULKER_OPTIONS,
45
48
  },
46
49
  [NetworkNumber.Opt]: {
47
50
  [CompoundVersions.CompoundV3USDC]: STANDARD_BULKER_OPTIONS,
@@ -53,6 +56,7 @@ const BULKER_OPTIONS = {
53
56
  [CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
54
57
  [CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
55
58
  [CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
59
+ [CompoundVersions.CompoundV3InstitutionalUSDC]: EMPTY_BULKER_OPTIONS,
56
60
  },
57
61
  [NetworkNumber.Linea]: {
58
62
  // Non-existing markets, keeping it because of typescript
@@ -64,6 +68,7 @@ const BULKER_OPTIONS = {
64
68
  [CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
65
69
  [CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
66
70
  [CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
71
+ [CompoundVersions.CompoundV3InstitutionalUSDC]: EMPTY_BULKER_OPTIONS,
67
72
  },
68
73
  [NetworkNumber.Plasma]: {
69
74
  // Non-existing markets, keeping it because of typescript
@@ -75,12 +80,14 @@ const BULKER_OPTIONS = {
75
80
  [CompoundVersions.CompoundV3USDCe]: EMPTY_BULKER_OPTIONS,
76
81
  [CompoundVersions.CompoundV3wstETH]: EMPTY_BULKER_OPTIONS,
77
82
  [CompoundVersions.CompoundV3USDS]: EMPTY_BULKER_OPTIONS,
83
+ [CompoundVersions.CompoundV3InstitutionalUSDC]: EMPTY_BULKER_OPTIONS,
78
84
  },
79
85
  };
80
86
  export const COMPOUND_V2 = {
81
87
  chainIds: [NetworkNumber.Eth],
82
88
  label: 'Compound V2',
83
89
  shortLabel: CompoundVersionType.V2,
90
+ url: '',
84
91
  value: CompoundVersions.CompoundV2,
85
92
  baseAsset: '',
86
93
  collAssets: compoundV2CollateralAssets.map(a => a.underlyingAsset),
@@ -96,6 +103,7 @@ export const COMPOUND_V3_USDC = (networkId) => ({
96
103
  chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Base, NetworkNumber.Opt],
97
104
  label: 'Compound V3 - USDC',
98
105
  shortLabel: CompoundVersionType.V3,
106
+ url: 'cusdcv3',
99
107
  value: CompoundVersions.CompoundV3USDC,
100
108
  baseAsset: 'USDC',
101
109
  collAssets: networkId ? v3USDCCollAssets[networkId] : [],
@@ -111,6 +119,7 @@ export const COMPOUND_V3_USDCe = (networkId) => ({
111
119
  chainIds: [NetworkNumber.Arb],
112
120
  label: 'Compound V3 - USDC.e',
113
121
  shortLabel: CompoundVersionType.V3,
122
+ url: 'cusdcev3',
114
123
  value: CompoundVersions.CompoundV3USDCe,
115
124
  baseAsset: 'USDC.e',
116
125
  collAssets: networkId ? v3USDCeCollAssets[networkId] : [],
@@ -126,6 +135,7 @@ export const COMPOUND_V3_ETH = (networkId) => ({
126
135
  chainIds: [NetworkNumber.Eth, NetworkNumber.Base, NetworkNumber.Arb, NetworkNumber.Opt],
127
136
  label: 'Compound V3 - ETH',
128
137
  shortLabel: CompoundVersionType.V3,
138
+ url: 'cethv3',
129
139
  value: CompoundVersions.CompoundV3ETH,
130
140
  baseAsset: 'ETH',
131
141
  collAssets: networkId ? v3ETHCollAssets[networkId] : [],
@@ -141,6 +151,7 @@ export const COMPOUND_V3_USDBC = (networkId) => ({
141
151
  chainIds: [NetworkNumber.Base],
142
152
  label: 'Compound V3 - USDbC',
143
153
  shortLabel: CompoundVersionType.V3,
154
+ url: 'cusdbcv3',
144
155
  value: CompoundVersions.CompoundV3USDbC,
145
156
  baseAsset: 'USDbC',
146
157
  collAssets: networkId ? v3USDbCCollAssets[networkId] : [],
@@ -156,6 +167,7 @@ export const COMPOUND_V3_USDT = (networkId) => ({
156
167
  chainIds: [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Opt],
157
168
  label: 'Compound V3 - USDT',
158
169
  shortLabel: CompoundVersionType.V3,
170
+ url: 'cusdtv3',
159
171
  value: CompoundVersions.CompoundV3USDT,
160
172
  baseAsset: 'USDT',
161
173
  collAssets: networkId ? v3USDTCollAssets[networkId] : [],
@@ -171,6 +183,7 @@ export const COMPOUND_V3_WSTETH = (networkId) => ({
171
183
  chainIds: [NetworkNumber.Eth],
172
184
  label: 'Compound V3 - wstETH',
173
185
  shortLabel: CompoundVersionType.V3,
186
+ url: 'cwstethv3',
174
187
  value: CompoundVersions.CompoundV3wstETH,
175
188
  baseAsset: 'wstETH',
176
189
  collAssets: networkId ? v3wstETHCollAssets[networkId] : [],
@@ -185,6 +198,7 @@ export const COMPOUND_V3_USDS = (networkId) => ({
185
198
  chainIds: [NetworkNumber.Eth, NetworkNumber.Base],
186
199
  label: 'Compound V3 - USDS',
187
200
  shortLabel: CompoundVersionType.V3,
201
+ url: 'cusdsv3',
188
202
  value: CompoundVersions.CompoundV3USDS,
189
203
  baseAsset: 'USDS',
190
204
  collAssets: networkId ? v3USDSCollAssets[networkId] : [],
@@ -195,6 +209,21 @@ export const COMPOUND_V3_USDS = (networkId) => ({
195
209
  bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
196
210
  bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3USDS],
197
211
  });
212
+ export const COMPOUND_V3_INSTITUTIONAL_USDC = (networkId) => ({
213
+ chainIds: [NetworkNumber.Eth],
214
+ label: 'Compound V3 - Institutional USDC',
215
+ shortLabel: CompoundVersionType.V3,
216
+ url: 'ciusdcv3',
217
+ value: CompoundVersions.CompoundV3InstitutionalUSDC,
218
+ baseAsset: 'USDC',
219
+ collAssets: networkId ? v3InstitutionalUSDCCollAssets[networkId] : [],
220
+ baseMarket: 'ciUSDCv3',
221
+ baseMarketAddress: getConfigContractAddress('ciUSDCv3', networkId),
222
+ secondLabel: 'Market',
223
+ bulkerName: networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2',
224
+ bulkerAddress: getConfigContractAddress(networkId === NetworkNumber.Eth ? 'CompV3BulkerMainnetETH' : 'CompV3BulkerL2', networkId),
225
+ bulkerOptions: BULKER_OPTIONS[networkId][CompoundVersions.CompoundV3InstitutionalUSDC],
226
+ });
198
227
  export const CompoundMarkets = (networkId) => ({
199
228
  [CompoundVersions.CompoundV2]: COMPOUND_V2,
200
229
  [CompoundVersions.CompoundV3ETH]: COMPOUND_V3_ETH(networkId),
@@ -204,4 +233,5 @@ export const CompoundMarkets = (networkId) => ({
204
233
  [CompoundVersions.CompoundV3USDT]: COMPOUND_V3_USDT(networkId),
205
234
  [CompoundVersions.CompoundV3wstETH]: COMPOUND_V3_WSTETH(networkId),
206
235
  [CompoundVersions.CompoundV3USDS]: COMPOUND_V3_USDS(networkId),
236
+ [CompoundVersions.CompoundV3InstitutionalUSDC]: COMPOUND_V3_INSTITUTIONAL_USDC(networkId),
207
237
  });
@@ -72,3 +72,12 @@ export declare const v3wstETHCollAssets: {
72
72
  59144: never[];
73
73
  9745: never[];
74
74
  };
75
+ export declare const v3InstitutionalUSDCCollAssetsEth: string[];
76
+ export declare const v3InstitutionalUSDCCollAssets: {
77
+ 1: string[];
78
+ 10: never[];
79
+ 42161: never[];
80
+ 8453: never[];
81
+ 59144: never[];
82
+ 9745: never[];
83
+ };
@@ -81,3 +81,12 @@ export const v3wstETHCollAssets = {
81
81
  [NetworkNumber.Linea]: [],
82
82
  [NetworkNumber.Plasma]: [],
83
83
  };
84
+ export const v3InstitutionalUSDCCollAssetsEth = ['ETH', 'wstETH', 'cbBTC', 'WBTC'];
85
+ export const v3InstitutionalUSDCCollAssets = {
86
+ [NetworkNumber.Eth]: v3InstitutionalUSDCCollAssetsEth,
87
+ [NetworkNumber.Opt]: [],
88
+ [NetworkNumber.Arb]: [],
89
+ [NetworkNumber.Base]: [],
90
+ [NetworkNumber.Linea]: [],
91
+ [NetworkNumber.Plasma]: [],
92
+ };
@@ -7,7 +7,8 @@ export declare enum CompoundVersions {
7
7
  'CompoundV3USDbC' = "v3-USDbC",
8
8
  'CompoundV3USDT' = "v3-USDT",
9
9
  'CompoundV3USDS' = "v3-USDS",
10
- 'CompoundV3wstETH' = "v3-wstETH"
10
+ 'CompoundV3wstETH' = "v3-wstETH",
11
+ 'CompoundV3InstitutionalUSDC' = "v3-institutional-USDC"
11
12
  }
12
13
  export declare enum CompoundVersionType {
13
14
  V2 = "v2",
@@ -21,6 +22,7 @@ export interface CompoundMarketData {
21
22
  chainIds: NetworkNumber[];
22
23
  label: string;
23
24
  shortLabel: string;
25
+ url: string;
24
26
  value: CompoundVersions;
25
27
  baseAsset: string;
26
28
  collAssets: readonly string[];
@@ -8,6 +8,7 @@ export var CompoundVersions;
8
8
  CompoundVersions["CompoundV3USDT"] = "v3-USDT";
9
9
  CompoundVersions["CompoundV3USDS"] = "v3-USDS";
10
10
  CompoundVersions["CompoundV3wstETH"] = "v3-wstETH";
11
+ CompoundVersions["CompoundV3InstitutionalUSDC"] = "v3-institutional-USDC";
11
12
  })(CompoundVersions || (CompoundVersions = {}));
12
13
  export var CompoundVersionType;
13
14
  (function (CompoundVersionType) {
@@ -85,8 +85,6 @@ export interface SparkAggregatedPositionData {
85
85
  leftToBorrowUsd: string;
86
86
  ratio: string;
87
87
  collRatio: string;
88
- borrowLimitWithLtvZeroFallbackUsd: string;
89
- safetyRatioWithLtvZeroFallback: string;
90
88
  netApy: string;
91
89
  incentiveUsd: string;
92
90
  totalInterestUsd: string;
@@ -106,7 +104,6 @@ export interface SparkPositionData extends MMPositionData {
106
104
  ratio: string;
107
105
  minRatio: string;
108
106
  collRatio: string;
109
- safetyRatioWithLtvZeroFallback?: string;
110
107
  suppliedUsd: string;
111
108
  borrowedUsd: string;
112
109
  borrowLimitUsd: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/positions-sdk",
3
- "version": "2.1.147-spark-ltv0-fallback-dev",
3
+ "version": "2.1.148-comp-dev",
4
4
  "description": "",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -1,12 +1,27 @@
1
- import { Client } from 'viem';
1
+ import { BaseError, Client, ContractFunctionRevertedError } from 'viem';
2
2
  import { assetAmountInEth, getAssetInfoByAddress } from '@defisaver/tokens';
3
3
  import { EthAddress, NetworkNumber } from '../types/common';
4
4
  import { CompV3ViewContractViem } from '../contracts';
5
5
  import { ClaimType } from '../types/claiming';
6
6
 
7
+ // `CometRewards.NotSupported(address)`. CometRewards reverts with it for any Comet that has no
8
+ // `rewardConfig` set - such a market never accrues COMP, so there is nothing to claim.
9
+ // Not decodable by name, since the error lives in CometRewards' ABI and we call through CompV3View.
10
+ const NOT_SUPPORTED_ERROR_SIG = '0x9c58e3b6';
11
+
12
+ // Only an actual on-chain revert counts - viem reports transport failures as ContractFunctionExecutionError too.
13
+ const isMarketWithoutRewardsConfig = (err: unknown) => {
14
+ if (!(err instanceof BaseError)) return false;
15
+ const revert = err.walk((e) => e instanceof ContractFunctionRevertedError);
16
+ return revert instanceof ContractFunctionRevertedError && !!revert.raw?.startsWith(NOT_SUPPORTED_ERROR_SIG);
17
+ };
18
+
7
19
  export const getCompoundV3Rewards = async (provider: Client, network: NetworkNumber, user: EthAddress, market: any) => {
8
20
  const compV3View = CompV3ViewContractViem(provider, network);
9
- const rewards = await compV3View.read.getRewardsOwed([market, user]);
21
+ const rewards = await compV3View.read.getRewardsOwed([market, user]).catch((err) => {
22
+ if (isMarketWithoutRewardsConfig(err)) return null;
23
+ throw err;
24
+ });
10
25
  if (!rewards || rewards.owed.toString() === '0' || getAssetInfoByAddress(rewards.token, network).symbol !== 'COMP') return [];
11
26
  return [{
12
27
  symbol: 'COMP',