@defisaver/positions-sdk 2.1.149 → 2.1.150
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.
- package/cjs/claiming/compV3.js +18 -1
- package/cjs/config/contracts.d.ts +1497 -0
- package/cjs/config/contracts.js +11 -3
- package/cjs/markets/compound/index.d.ts +2 -0
- package/cjs/markets/compound/index.js +32 -1
- package/cjs/markets/compound/marketsAssets.d.ts +9 -0
- package/cjs/markets/compound/marketsAssets.js +10 -1
- package/cjs/types/compound.d.ts +3 -1
- package/cjs/types/compound.js +1 -0
- package/esm/claiming/compV3.js +18 -1
- package/esm/config/contracts.d.ts +1497 -0
- package/esm/config/contracts.js +8 -0
- package/esm/markets/compound/index.d.ts +2 -0
- package/esm/markets/compound/index.js +31 -1
- package/esm/markets/compound/marketsAssets.d.ts +9 -0
- package/esm/markets/compound/marketsAssets.js +9 -0
- package/esm/types/compound.d.ts +3 -1
- package/esm/types/compound.js +1 -0
- package/package.json +1 -1
- package/src/claiming/compV3.ts +17 -2
- package/src/config/contracts.ts +8 -0
- package/src/markets/compound/index.ts +32 -0
- package/src/markets/compound/marketsAssets.ts +11 -0
- package/src/types/compound.ts +2 -0
package/esm/config/contracts.js
CHANGED
|
@@ -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": {
|
|
@@ -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
|
+
};
|
package/esm/types/compound.d.ts
CHANGED
|
@@ -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[];
|
package/esm/types/compound.js
CHANGED
|
@@ -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) {
|
package/package.json
CHANGED
package/src/claiming/compV3.ts
CHANGED
|
@@ -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',
|
package/src/config/contracts.ts
CHANGED
|
@@ -509,6 +509,14 @@ export const cWstETHv3 = {
|
|
|
509
509
|
},
|
|
510
510
|
},
|
|
511
511
|
} as const;
|
|
512
|
+
export const ciUSDCv3 = {
|
|
513
|
+
"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"}],
|
|
514
|
+
"networks": {
|
|
515
|
+
"1": {
|
|
516
|
+
"address": "0x207158a267CBD2598BB3d611D8CBdEE2709F2F8C",
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
} as const;
|
|
512
520
|
export const CompV3View = {
|
|
513
521
|
"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"}],
|
|
514
522
|
"networks": {
|