@defisaver/positions-sdk 2.1.22-dev-savings-3 → 2.1.22-dev-savings-5

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.
Files changed (42) hide show
  1. package/cjs/config/contracts.d.ts +24 -0
  2. package/cjs/config/contracts.js +9 -1
  3. package/cjs/contracts.d.ts +306 -0
  4. package/cjs/contracts.js +2 -0
  5. package/cjs/savings/index.d.ts +4 -3
  6. package/cjs/savings/index.js +11 -7
  7. package/cjs/savings/makerDSR/index.d.ts +7 -0
  8. package/cjs/savings/makerDSR/index.js +94 -0
  9. package/cjs/savings/makerDSR/options.d.ts +2 -0
  10. package/cjs/savings/makerDSR/options.js +10 -0
  11. package/cjs/savings/morphoVaults/index.js +1 -0
  12. package/cjs/savings/yearnVaults/index.js +1 -0
  13. package/cjs/types/savings/index.d.ts +4 -8
  14. package/cjs/types/savings/index.js +1 -0
  15. package/cjs/types/savings/makerDsr.d.ts +10 -0
  16. package/cjs/types/savings/makerDsr.js +7 -0
  17. package/esm/config/contracts.d.ts +24 -0
  18. package/esm/config/contracts.js +8 -0
  19. package/esm/contracts.d.ts +306 -0
  20. package/esm/contracts.js +1 -0
  21. package/esm/savings/index.d.ts +4 -3
  22. package/esm/savings/index.js +10 -7
  23. package/esm/savings/makerDSR/index.d.ts +7 -0
  24. package/esm/savings/makerDSR/index.js +53 -0
  25. package/esm/savings/makerDSR/options.d.ts +2 -0
  26. package/esm/savings/makerDSR/options.js +7 -0
  27. package/esm/savings/morphoVaults/index.js +1 -0
  28. package/esm/savings/yearnVaults/index.js +1 -0
  29. package/esm/types/savings/index.d.ts +4 -8
  30. package/esm/types/savings/index.js +1 -0
  31. package/esm/types/savings/makerDsr.d.ts +10 -0
  32. package/esm/types/savings/makerDsr.js +4 -0
  33. package/package.json +1 -1
  34. package/src/config/contracts.ts +9 -1
  35. package/src/contracts.ts +3 -1
  36. package/src/savings/index.ts +12 -7
  37. package/src/savings/makerDsr/index.ts +54 -0
  38. package/src/savings/makerDsr/options.ts +8 -0
  39. package/src/savings/morphoVaults/index.ts +1 -0
  40. package/src/savings/yearnVaults/index.ts +1 -0
  41. package/src/types/savings/index.ts +4 -8
  42. package/src/types/savings/makerDsr.ts +12 -0
@@ -85311,3 +85311,27 @@ export declare const YearnView: {
85311
85311
  };
85312
85312
  };
85313
85313
  };
85314
+ export declare const MakerDsr: {
85315
+ abi: {
85316
+ constant: boolean;
85317
+ inputs: {
85318
+ internalType: string;
85319
+ name: string;
85320
+ type: string;
85321
+ }[];
85322
+ name: string;
85323
+ outputs: {
85324
+ internalType: string;
85325
+ name: string;
85326
+ type: string;
85327
+ }[];
85328
+ payable: boolean;
85329
+ stateMutability: string;
85330
+ type: string;
85331
+ }[];
85332
+ networks: {
85333
+ "1": {
85334
+ address: string;
85335
+ };
85336
+ };
85337
+ };
@@ -2,7 +2,7 @@
2
2
  /* eslint-disable */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.LiquityView = exports.crvUSDFactory = exports.crvUSDView = exports.crvUSDsfrxETHAmm = exports.crvUSDtBTCAmm = exports.crvUSDWBTCAmm = exports.crvUSDETHAmm = exports.crvUSDwstETHAmm = exports.crvUSDsfrxETHController = exports.crvUSDtBTCController = exports.crvUSDWBTCController = exports.crvUSDETHController = exports.crvUSDwstETHController = exports.SparkProtocolDataProvider = exports.SparkPoolAddressesProvider = exports.SparkLendingPool = exports.SparkIncentiveDataProvider = exports.SparkView = exports.Pot = exports.IAToken = exports.IVariableDebtToken = exports.Comptroller = exports.CompoundLoanInfo = exports.AaveLendingPoolV2 = exports.AaveProtocolDataProvider = exports.LendingPoolAddressesProvider = exports.AaveLoanInfoV2 = exports.wstETH = exports.CompV3BulkerL2 = exports.CompV3BulkerMainnetETH = exports.CompV3BulkerMainnetUSDC = exports.CompV3View = exports.cWstETHv3 = exports.cUSDSv3 = exports.cUSDTv3 = exports.cETHv3 = exports.cUSDbCv3 = exports.cUSDCev3 = exports.cUSDCv3 = exports.AaveUiIncentiveDataProviderV3 = exports.AaveV3EtherfiProtocolDataProvider = exports.AaveV3LidoProtocolDataProvider = exports.AaveV3ProtocolDataProvider = exports.AaveV3EtherfiLendingPool = exports.AaveV3LidoLendingPool = exports.AaveV3LendingPool = exports.AaveV3EtherfiPoolAddressesProvider = exports.AaveV3LidoPoolAddressesProvider = exports.AaveV3PoolAddressesProvider = exports.AaveV3View = void 0;
5
- exports.YearnView = exports.YearnVault = exports.MorphoVault = exports.StkAAVE = exports.LiquityV2sBoldVault = exports.LiquityV2ActivePool = exports.AaveRewardsController = exports.MorphoDistributor = exports.SparkRewardsController = exports.SparkAirdrop = exports.UUPS = exports.LiquityStabilityPool = exports.LiquityLQTYStaking = exports.AaveUmbrellaView = exports.Erc4626 = exports.Erc20 = exports.AaveIncentivesController = exports.McdCdpManager = exports.McdGetCdps = exports.FluidView = exports.LiquityV2StabilityPool = exports.EulerV2View = exports.LiquityV2TroveNFT = exports.LiquityV2CollSurplusPool = exports.LiquityV2View = exports.LiquityV2LegacyView = exports.LlamaLendControllerAbi = exports.LlamaLendView = exports.DFSFeedRegistry = exports.FeedRegistry = exports.MorphoBlueView = exports.WeETHPriceFeed = exports.WstETHPriceFeed = exports.USDCPriceFeed = exports.BTCPriceFeed = exports.ETHPriceFeed = exports.COMPPriceFeed = exports.McdDog = exports.McdJug = exports.McdVat = exports.McdSpotter = exports.McdView = exports.LiquityActivePool = exports.PriceFeed = exports.TroveManager = exports.CollSurplusPool = void 0;
5
+ exports.MakerDsr = exports.YearnView = exports.YearnVault = exports.MorphoVault = exports.StkAAVE = exports.LiquityV2sBoldVault = exports.LiquityV2ActivePool = exports.AaveRewardsController = exports.MorphoDistributor = exports.SparkRewardsController = exports.SparkAirdrop = exports.UUPS = exports.LiquityStabilityPool = exports.LiquityLQTYStaking = exports.AaveUmbrellaView = exports.Erc4626 = exports.Erc20 = exports.AaveIncentivesController = exports.McdCdpManager = exports.McdGetCdps = exports.FluidView = exports.LiquityV2StabilityPool = exports.EulerV2View = exports.LiquityV2TroveNFT = exports.LiquityV2CollSurplusPool = exports.LiquityV2View = exports.LiquityV2LegacyView = exports.LlamaLendControllerAbi = exports.LlamaLendView = exports.DFSFeedRegistry = exports.FeedRegistry = exports.MorphoBlueView = exports.WeETHPriceFeed = exports.WstETHPriceFeed = exports.USDCPriceFeed = exports.BTCPriceFeed = exports.ETHPriceFeed = exports.COMPPriceFeed = exports.McdDog = exports.McdJug = exports.McdVat = exports.McdSpotter = exports.McdView = exports.LiquityActivePool = exports.PriceFeed = exports.TroveManager = exports.CollSurplusPool = void 0;
6
6
  exports.AaveV3View = {
7
7
  "abi": [{ "inputs": [], "name": "AAVE_REFERRAL_CODE", "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_umbrella", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getAdditionalUmbrellaStakingData", "outputs": [{ "components": [{ "internalType": "address", "name": "stkToken", "type": "address" }, { "internalType": "uint256", "name": "totalShares", "type": "uint256" }, { "internalType": "address", "name": "stkUnderlyingToken", "type": "address" }, { "internalType": "address", "name": "aToken", "type": "address" }, { "internalType": "uint256", "name": "cooldownPeriod", "type": "uint256" }, { "internalType": "uint256", "name": "unstakeWindow", "type": "uint256" }, { "internalType": "uint256", "name": "stkTokenToWaTokenRate", "type": "uint256" }, { "internalType": "uint256", "name": "waTokenToATokenRate", "type": "uint256" }, { "internalType": "uint256[]", "name": "rewardsEmissionRates", "type": "uint256[]" }, { "internalType": "uint256", "name": "userCooldownAmount", "type": "uint256" }, { "internalType": "uint256", "name": "userEndOfCooldown", "type": "uint256" }, { "internalType": "uint256", "name": "userWithdrawalWindow", "type": "uint256" }], "internalType": "struct AaveV3View.UmbrellaStkData[]", "name": "retVal", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }], "name": "getAllEmodes", "outputs": [{ "components": [{ "internalType": "uint16", "name": "ltv", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationBonus", "type": "uint16" }, { "internalType": "uint128", "name": "collateralBitmap", "type": "uint128" }, { "internalType": "string", "name": "label", "type": "string" }, { "internalType": "uint128", "name": "borrowableBitmap", "type": "uint128" }], "internalType": "struct DataTypes.EModeCategoryNew[]", "name": "emodesData", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "components": [{ "internalType": "address", "name": "reserveAddress", "type": "address" }, { "internalType": "uint256", "name": "liquidityAdded", "type": "uint256" }, { "internalType": "uint256", "name": "liquidityTaken", "type": "uint256" }, { "internalType": "bool", "name": "isDebtAsset", "type": "bool" }], "internalType": "struct AaveV3View.LiquidityChangeParams[]", "name": "_reserveParams", "type": "tuple[]" }], "name": "getApyAfterValuesEstimation", "outputs": [{ "components": [{ "internalType": "address", "name": "reserveAddress", "type": "address" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "variableBorrowRate", "type": "uint256" }], "internalType": "struct AaveV3View.EstimatedRates[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getAssetPrice", "outputs": [{ "internalType": "uint256", "name": "price", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address[]", "name": "_tokens", "type": "address[]" }], "name": "getCollFactors", "outputs": [{ "internalType": "uint256[]", "name": "collFactors", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "emodeCategory", "type": "uint256" }, { "internalType": "contract IPoolV3", "name": "lendingPool", "type": "address" }], "name": "getEModeCollateralFactor", "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "contract IPoolV3", "name": "_lendingPool", "type": "address" }, { "internalType": "uint8", "name": "_id", "type": "uint8" }], "name": "getEmodeData", "outputs": [{ "components": [{ "internalType": "uint16", "name": "ltv", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationBonus", "type": "uint16" }, { "internalType": "uint128", "name": "collateralBitmap", "type": "uint128" }, { "internalType": "string", "name": "label", "type": "string" }, { "internalType": "uint128", "name": "borrowableBitmap", "type": "uint128" }], "internalType": "struct DataTypes.EModeCategoryNew", "name": "emodeData", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address[]", "name": "_tokenAddresses", "type": "address[]" }], "name": "getFullTokensInfo", "outputs": [{ "components": [{ "internalType": "address", "name": "aTokenAddress", "type": "address" }, { "internalType": "address", "name": "underlyingTokenAddress", "type": "address" }, { "internalType": "uint16", "name": "assetId", "type": "uint16" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "borrowRateVariable", "type": "uint256" }, { "internalType": "uint256", "name": "borrowRateStable", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "availableLiquidity", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrow", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowVar", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowStab", "type": "uint256" }, { "internalType": "uint256", "name": "collateralFactor", "type": "uint256" }, { "internalType": "uint256", "name": "liquidationRatio", "type": "uint256" }, { "internalType": "uint256", "name": "price", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint256", "name": "borrowCap", "type": "uint256" }, { "internalType": "uint256", "name": "emodeCategory", "type": "uint256" }, { "internalType": "uint256", "name": "debtCeilingForIsolationMode", "type": "uint256" }, { "internalType": "uint256", "name": "isolationModeTotalDebt", "type": "uint256" }, { "internalType": "bool", "name": "usageAsCollateralEnabled", "type": "bool" }, { "internalType": "bool", "name": "borrowingEnabled", "type": "bool" }, { "internalType": "bool", "name": "stableBorrowRateEnabled", "type": "bool" }, { "internalType": "bool", "name": "isolationModeBorrowingEnabled", "type": "bool" }, { "internalType": "bool", "name": "isSiloedForBorrowing", "type": "bool" }, { "internalType": "uint256", "name": "eModeCollateralFactor", "type": "uint256" }, { "internalType": "bool", "name": "isFlashLoanEnabled", "type": "bool" }, { "internalType": "uint16", "name": "ltv", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationBonus", "type": "uint16" }, { "internalType": "address", "name": "priceSource", "type": "address" }, { "internalType": "string", "name": "label", "type": "string" }, { "internalType": "bool", "name": "isActive", "type": "bool" }, { "internalType": "bool", "name": "isPaused", "type": "bool" }, { "internalType": "bool", "name": "isFrozen", "type": "bool" }, { "internalType": "address", "name": "debtTokenAddress", "type": "address" }], "internalType": "struct AaveV3View.TokenInfoFull[]", "name": "tokens", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getHealthFactor", "outputs": [{ "internalType": "uint256", "name": "healthFactor", "type": "uint256" }], "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": "uint128", "name": "ratio", "type": "uint128" }, { "internalType": "uint256", "name": "eMode", "type": "uint256" }, { "internalType": "address[]", "name": "collAddr", "type": "address[]" }, { "internalType": "bool[]", "name": "enabledAsColl", "type": "bool[]" }, { "internalType": "address[]", "name": "borrowAddr", "type": "address[]" }, { "internalType": "uint256[]", "name": "collAmounts", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "borrowStableAmounts", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "borrowVariableAmounts", "type": "uint256[]" }, { "internalType": "uint16", "name": "ltv", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationBonus", "type": "uint16" }, { "internalType": "address", "name": "priceSource", "type": "address" }, { "internalType": "string", "name": "label", "type": "string" }], "internalType": "struct AaveV3View.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": "uint128", "name": "ratio", "type": "uint128" }, { "internalType": "uint256", "name": "eMode", "type": "uint256" }, { "internalType": "address[]", "name": "collAddr", "type": "address[]" }, { "internalType": "bool[]", "name": "enabledAsColl", "type": "bool[]" }, { "internalType": "address[]", "name": "borrowAddr", "type": "address[]" }, { "internalType": "uint256[]", "name": "collAmounts", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "borrowStableAmounts", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "borrowVariableAmounts", "type": "uint256[]" }, { "internalType": "uint16", "name": "ltv", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationBonus", "type": "uint16" }, { "internalType": "address", "name": "priceSource", "type": "address" }, { "internalType": "string", "name": "label", "type": "string" }], "internalType": "struct AaveV3View.LoanData[]", "name": "loans", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "uint256", "name": "data", "type": "uint256" }], "internalType": "struct DataTypes.ReserveConfigurationMap", "name": "self", "type": "tuple" }], "name": "getLtv", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address[]", "name": "_tokens", "type": "address[]" }], "name": "getPrices", "outputs": [{ "internalType": "uint256[]", "name": "prices", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getRatio", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address[]", "name": "_users", "type": "address[]" }], "name": "getRatios", "outputs": [{ "internalType": "uint256[]", "name": "ratios", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }], "name": "getSafetyRatio", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "address[]", "name": "_tokens", "type": "address[]" }], "name": "getTokenBalances", "outputs": [{ "components": [{ "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "balance", "type": "uint256" }, { "internalType": "uint256", "name": "borrowsStable", "type": "uint256" }, { "internalType": "uint256", "name": "borrowsVariable", "type": "uint256" }, { "internalType": "uint256", "name": "stableBorrowRate", "type": "uint256" }, { "internalType": "bool", "name": "enabledAsCollateral", "type": "bool" }], "internalType": "struct AaveV3View.UserToken[]", "name": "userTokens", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address", "name": "_tokenAddr", "type": "address" }], "name": "getTokenInfoFull", "outputs": [{ "components": [{ "internalType": "address", "name": "aTokenAddress", "type": "address" }, { "internalType": "address", "name": "underlyingTokenAddress", "type": "address" }, { "internalType": "uint16", "name": "assetId", "type": "uint16" }, { "internalType": "uint256", "name": "supplyRate", "type": "uint256" }, { "internalType": "uint256", "name": "borrowRateVariable", "type": "uint256" }, { "internalType": "uint256", "name": "borrowRateStable", "type": "uint256" }, { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, { "internalType": "uint256", "name": "availableLiquidity", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrow", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowVar", "type": "uint256" }, { "internalType": "uint256", "name": "totalBorrowStab", "type": "uint256" }, { "internalType": "uint256", "name": "collateralFactor", "type": "uint256" }, { "internalType": "uint256", "name": "liquidationRatio", "type": "uint256" }, { "internalType": "uint256", "name": "price", "type": "uint256" }, { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, { "internalType": "uint256", "name": "borrowCap", "type": "uint256" }, { "internalType": "uint256", "name": "emodeCategory", "type": "uint256" }, { "internalType": "uint256", "name": "debtCeilingForIsolationMode", "type": "uint256" }, { "internalType": "uint256", "name": "isolationModeTotalDebt", "type": "uint256" }, { "internalType": "bool", "name": "usageAsCollateralEnabled", "type": "bool" }, { "internalType": "bool", "name": "borrowingEnabled", "type": "bool" }, { "internalType": "bool", "name": "stableBorrowRateEnabled", "type": "bool" }, { "internalType": "bool", "name": "isolationModeBorrowingEnabled", "type": "bool" }, { "internalType": "bool", "name": "isSiloedForBorrowing", "type": "bool" }, { "internalType": "uint256", "name": "eModeCollateralFactor", "type": "uint256" }, { "internalType": "bool", "name": "isFlashLoanEnabled", "type": "bool" }, { "internalType": "uint16", "name": "ltv", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationThreshold", "type": "uint16" }, { "internalType": "uint16", "name": "liquidationBonus", "type": "uint16" }, { "internalType": "address", "name": "priceSource", "type": "address" }, { "internalType": "string", "name": "label", "type": "string" }, { "internalType": "bool", "name": "isActive", "type": "bool" }, { "internalType": "bool", "name": "isPaused", "type": "bool" }, { "internalType": "bool", "name": "isFrozen", "type": "bool" }, { "internalType": "address", "name": "debtTokenAddress", "type": "address" }], "internalType": "struct AaveV3View.TokenInfoFull", "name": "_tokenInfo", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }, { "internalType": "address[]", "name": "_tokenAddresses", "type": "address[]" }], "name": "getTokensInfo", "outputs": [{ "components": [{ "internalType": "address", "name": "aTokenAddress", "type": "address" }, { "internalType": "address", "name": "underlyingTokenAddress", "type": "address" }, { "internalType": "uint256", "name": "collateralFactor", "type": "uint256" }, { "internalType": "uint256", "name": "price", "type": "uint256" }], "internalType": "struct AaveV3View.TokenInfo[]", "name": "tokens", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_market", "type": "address" }], "name": "isBorrowAllowed", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }],
8
8
  "networks": {
@@ -1274,3 +1274,11 @@ exports.YearnView = {
1274
1274
  }
1275
1275
  }
1276
1276
  };
1277
+ exports.MakerDsr = {
1278
+ "abi": [{ "constant": true, "inputs": [], "name": "chi", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "pie", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "Pie", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }],
1279
+ "networks": {
1280
+ "1": {
1281
+ "address": "0x197e90f9fad81970ba7976f33cbd77088e5d7cf7",
1282
+ }
1283
+ }
1284
+ };
@@ -496629,3 +496629,309 @@ export declare const YearnViewContractViem: (client: Client, network: NetworkNum
496629
496629
  readonly type: "function";
496630
496630
  }];
496631
496631
  };
496632
+ export declare const MakerDsrContractViem: (client: Client, network: NetworkNumber, block?: Blockish) => {
496633
+ read: {
496634
+ [x: string]: (...parameters: [options?: import("viem").Prettify<import("viem").UnionOmit<import("viem").ReadContractParameters<{
496635
+ constant: boolean;
496636
+ inputs: {
496637
+ internalType: string;
496638
+ name: string;
496639
+ type: string;
496640
+ }[];
496641
+ name: string;
496642
+ outputs: {
496643
+ internalType: string;
496644
+ name: string;
496645
+ type: string;
496646
+ }[];
496647
+ payable: boolean;
496648
+ stateMutability: string;
496649
+ type: string;
496650
+ }[], string, readonly unknown[]>, "address" | "args" | "abi" | "functionName">> | undefined] | [args: readonly unknown[], options?: import("viem").Prettify<import("viem").UnionOmit<import("viem").ReadContractParameters<{
496651
+ constant: boolean;
496652
+ inputs: {
496653
+ internalType: string;
496654
+ name: string;
496655
+ type: string;
496656
+ }[];
496657
+ name: string;
496658
+ outputs: {
496659
+ internalType: string;
496660
+ name: string;
496661
+ type: string;
496662
+ }[];
496663
+ payable: boolean;
496664
+ stateMutability: string;
496665
+ type: string;
496666
+ }[], string, readonly unknown[]>, "address" | "args" | "abi" | "functionName">> | undefined]) => Promise<import("viem").ReadContractReturnType>;
496667
+ };
496668
+ estimateGas: {
496669
+ [x: string]: (...parameters: [options: import("viem").Prettify<import("viem").UnionOmit<import("viem").EstimateContractGasParameters<{
496670
+ constant: boolean;
496671
+ inputs: {
496672
+ internalType: string;
496673
+ name: string;
496674
+ type: string;
496675
+ }[];
496676
+ name: string;
496677
+ outputs: {
496678
+ internalType: string;
496679
+ name: string;
496680
+ type: string;
496681
+ }[];
496682
+ payable: boolean;
496683
+ stateMutability: string;
496684
+ type: string;
496685
+ }[], string, readonly unknown[], import("viem").Chain | undefined>, "address" | "args" | "abi" | "functionName">>] | [args: readonly unknown[], options: import("viem").Prettify<import("viem").UnionOmit<import("viem").EstimateContractGasParameters<{
496686
+ constant: boolean;
496687
+ inputs: {
496688
+ internalType: string;
496689
+ name: string;
496690
+ type: string;
496691
+ }[];
496692
+ name: string;
496693
+ outputs: {
496694
+ internalType: string;
496695
+ name: string;
496696
+ type: string;
496697
+ }[];
496698
+ payable: boolean;
496699
+ stateMutability: string;
496700
+ type: string;
496701
+ }[], string, readonly unknown[], import("viem").Chain | undefined>, "address" | "args" | "abi" | "functionName">>]) => Promise<import("viem").EstimateContractGasReturnType>;
496702
+ } & {
496703
+ [x: string]: (...parameters: [options: import("viem").Prettify<import("viem").UnionOmit<import("viem").EstimateContractGasParameters<{
496704
+ constant: boolean;
496705
+ inputs: {
496706
+ internalType: string;
496707
+ name: string;
496708
+ type: string;
496709
+ }[];
496710
+ name: string;
496711
+ outputs: {
496712
+ internalType: string;
496713
+ name: string;
496714
+ type: string;
496715
+ }[];
496716
+ payable: boolean;
496717
+ stateMutability: string;
496718
+ type: string;
496719
+ }[], string, readonly unknown[], import("viem").Chain | undefined>, "address" | "args" | "abi" | "functionName">>] | [args: readonly unknown[], options: import("viem").Prettify<import("viem").UnionOmit<import("viem").EstimateContractGasParameters<{
496720
+ constant: boolean;
496721
+ inputs: {
496722
+ internalType: string;
496723
+ name: string;
496724
+ type: string;
496725
+ }[];
496726
+ name: string;
496727
+ outputs: {
496728
+ internalType: string;
496729
+ name: string;
496730
+ type: string;
496731
+ }[];
496732
+ payable: boolean;
496733
+ stateMutability: string;
496734
+ type: string;
496735
+ }[], string, readonly unknown[], import("viem").Chain | undefined>, "address" | "args" | "abi" | "functionName">>]) => Promise<import("viem").EstimateContractGasReturnType>;
496736
+ };
496737
+ simulate: {
496738
+ [x: string]: <chainOverride extends import("viem").Chain | undefined = undefined, accountOverride extends import("viem").Account | import("viem").Address | undefined = undefined>(...parameters: [options?: Omit<import("viem").SimulateContractParameters<{
496739
+ constant: boolean;
496740
+ inputs: {
496741
+ internalType: string;
496742
+ name: string;
496743
+ type: string;
496744
+ }[];
496745
+ name: string;
496746
+ outputs: {
496747
+ internalType: string;
496748
+ name: string;
496749
+ type: string;
496750
+ }[];
496751
+ payable: boolean;
496752
+ stateMutability: string;
496753
+ type: string;
496754
+ }[], string, readonly unknown[], import("viem").Chain | undefined, chainOverride, accountOverride>, "address" | "args" | "abi" | "functionName"> | undefined] | [args: readonly unknown[], options?: Omit<import("viem").SimulateContractParameters<{
496755
+ constant: boolean;
496756
+ inputs: {
496757
+ internalType: string;
496758
+ name: string;
496759
+ type: string;
496760
+ }[];
496761
+ name: string;
496762
+ outputs: {
496763
+ internalType: string;
496764
+ name: string;
496765
+ type: string;
496766
+ }[];
496767
+ payable: boolean;
496768
+ stateMutability: string;
496769
+ type: string;
496770
+ }[], string, readonly unknown[], import("viem").Chain | undefined, chainOverride, accountOverride>, "address" | "args" | "abi" | "functionName"> | undefined]) => Promise<import("viem").SimulateContractReturnType>;
496771
+ };
496772
+ createEventFilter: {
496773
+ [x: string]: <strict extends boolean | undefined = undefined>(...parameters: [options?: ({
496774
+ fromBlock?: bigint | import("viem").BlockTag | undefined;
496775
+ toBlock?: bigint | import("viem").BlockTag | undefined;
496776
+ } & {
496777
+ strict?: strict | undefined;
496778
+ }) | undefined] | [args: readonly unknown[] | {
496779
+ [x: string]: unknown;
496780
+ address?: undefined;
496781
+ abi?: undefined;
496782
+ eventName?: undefined;
496783
+ fromBlock?: undefined;
496784
+ strict?: undefined;
496785
+ toBlock?: undefined;
496786
+ args?: undefined;
496787
+ }, options?: ({
496788
+ fromBlock?: bigint | import("viem").BlockTag | undefined;
496789
+ toBlock?: bigint | import("viem").BlockTag | undefined;
496790
+ } & {
496791
+ strict?: strict | undefined;
496792
+ }) | undefined]) => Promise<import("viem").CreateContractEventFilterReturnType>;
496793
+ };
496794
+ getEvents: {
496795
+ [x: string]: (...parameters: [options?: {
496796
+ strict?: boolean | undefined;
496797
+ blockHash?: `0x${string}` | undefined;
496798
+ fromBlock?: bigint | import("viem").BlockTag | undefined;
496799
+ toBlock?: bigint | import("viem").BlockTag | undefined;
496800
+ } | undefined] | [args?: readonly unknown[] | {
496801
+ [x: string]: unknown;
496802
+ address?: undefined;
496803
+ abi?: undefined;
496804
+ args?: undefined;
496805
+ eventName?: undefined;
496806
+ fromBlock?: undefined;
496807
+ onError?: undefined;
496808
+ onLogs?: undefined;
496809
+ strict?: undefined;
496810
+ poll?: undefined;
496811
+ batch?: undefined;
496812
+ pollingInterval?: undefined;
496813
+ } | undefined, options?: {
496814
+ strict?: boolean | undefined;
496815
+ blockHash?: `0x${string}` | undefined;
496816
+ fromBlock?: bigint | import("viem").BlockTag | undefined;
496817
+ toBlock?: bigint | import("viem").BlockTag | undefined;
496818
+ } | undefined]) => Promise<import("viem").GetContractEventsReturnType<{
496819
+ constant: boolean;
496820
+ inputs: {
496821
+ internalType: string;
496822
+ name: string;
496823
+ type: string;
496824
+ }[];
496825
+ name: string;
496826
+ outputs: {
496827
+ internalType: string;
496828
+ name: string;
496829
+ type: string;
496830
+ }[];
496831
+ payable: boolean;
496832
+ stateMutability: string;
496833
+ type: string;
496834
+ }[], string>>;
496835
+ };
496836
+ watchEvent: {
496837
+ [x: string]: (...parameters: [options?: {
496838
+ batch?: boolean | undefined | undefined;
496839
+ pollingInterval?: number | undefined | undefined;
496840
+ strict?: boolean | undefined;
496841
+ onError?: ((error: Error) => void) | undefined | undefined;
496842
+ fromBlock?: bigint | undefined;
496843
+ onLogs: import("viem").WatchContractEventOnLogsFn<{
496844
+ constant: boolean;
496845
+ inputs: {
496846
+ internalType: string;
496847
+ name: string;
496848
+ type: string;
496849
+ }[];
496850
+ name: string;
496851
+ outputs: {
496852
+ internalType: string;
496853
+ name: string;
496854
+ type: string;
496855
+ }[];
496856
+ payable: boolean;
496857
+ stateMutability: string;
496858
+ type: string;
496859
+ }[], string, undefined>;
496860
+ poll?: true | undefined | undefined;
496861
+ } | undefined] | [args: readonly unknown[] | {
496862
+ [x: string]: unknown;
496863
+ address?: undefined;
496864
+ abi?: undefined;
496865
+ args?: undefined;
496866
+ eventName?: undefined;
496867
+ fromBlock?: undefined;
496868
+ onError?: undefined;
496869
+ onLogs?: undefined;
496870
+ strict?: undefined;
496871
+ poll?: undefined;
496872
+ batch?: undefined;
496873
+ pollingInterval?: undefined;
496874
+ }, options?: {
496875
+ batch?: boolean | undefined | undefined;
496876
+ pollingInterval?: number | undefined | undefined;
496877
+ strict?: boolean | undefined;
496878
+ onError?: ((error: Error) => void) | undefined | undefined;
496879
+ fromBlock?: bigint | undefined;
496880
+ onLogs: import("viem").WatchContractEventOnLogsFn<{
496881
+ constant: boolean;
496882
+ inputs: {
496883
+ internalType: string;
496884
+ name: string;
496885
+ type: string;
496886
+ }[];
496887
+ name: string;
496888
+ outputs: {
496889
+ internalType: string;
496890
+ name: string;
496891
+ type: string;
496892
+ }[];
496893
+ payable: boolean;
496894
+ stateMutability: string;
496895
+ type: string;
496896
+ }[], string, undefined>;
496897
+ poll?: true | undefined | undefined;
496898
+ } | undefined]) => import("viem").WatchContractEventReturnType;
496899
+ };
496900
+ write: {
496901
+ [x: string]: <chainOverride extends import("viem").Chain | undefined, options extends import("viem").UnionOmit<import("viem").WriteContractParameters<{
496902
+ constant: boolean;
496903
+ inputs: {
496904
+ internalType: string;
496905
+ name: string;
496906
+ type: string;
496907
+ }[];
496908
+ name: string;
496909
+ outputs: {
496910
+ internalType: string;
496911
+ name: string;
496912
+ type: string;
496913
+ }[];
496914
+ payable: boolean;
496915
+ stateMutability: string;
496916
+ type: string;
496917
+ }[], string, readonly unknown[], import("viem").Chain | undefined, import("viem").Account | undefined, chainOverride>, "address" | "args" | "abi" | "functionName"> extends infer T ? { [K in keyof T]: T[K]; } : never, Rest extends unknown[] = [options: options]>(...parameters: Rest | [args: readonly unknown[], ...parameters: Rest]) => Promise<import("viem").WriteContractReturnType>;
496918
+ };
496919
+ address: `0x${string}`;
496920
+ abi: {
496921
+ constant: boolean;
496922
+ inputs: {
496923
+ internalType: string;
496924
+ name: string;
496925
+ type: string;
496926
+ }[];
496927
+ name: string;
496928
+ outputs: {
496929
+ internalType: string;
496930
+ name: string;
496931
+ type: string;
496932
+ }[];
496933
+ payable: boolean;
496934
+ stateMutability: string;
496935
+ type: string;
496936
+ }[];
496937
+ };
package/cjs/contracts.js CHANGED
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.YearnViewContractViem = exports.StkAAVEViem = exports.LiquityV2sBoldVaultViem = exports.AaveRewardsControllerViem = exports.SparkRewardsControllerViem = exports.UUPSViem = exports.LiquityStabilityPoolViem = exports.LiquityLQTYStakingViem = exports.AaveUmbrellaViewViem = exports.AaveIncentivesControllerViem = exports.FluidViewContractViem = exports.LiquityV2LegacyViewContractViem = exports.LiquityV2ViewContractViem = exports.LiquityActivePoolContractViem = exports.LiquityPriceFeedContractViem = exports.LiquityTroveManagerContractViem = exports.LiquityCollSurplusPoolContractViem = exports.LiquityViewContractViem = exports.BTCPriceFeedContractViem = exports.WeETHPriceFeedContractViem = exports.ComptrollerContractViem = exports.CompoundLoanInfoContractViem = exports.McdJugContractViem = exports.McdDogContractViem = exports.McdSpotterContractViem = exports.McdVatContractViem = exports.McdViewContractViem = exports.McdGetCdpsContractViem = exports.LlamaLendViewContractViem = exports.CrvUSDFactoryContractViem = exports.CrvUSDViewContractViem = exports.EulerV2ViewContractViem = exports.SparkIncentiveDataProviderContractViem = exports.SparkViewContractViem = exports.CompV3ViewContractViem = exports.WstETHPriceFeedContractViem = exports.USDCPriceFeedContractViem = exports.ETHPriceFeedContractViem = exports.COMPPriceFeedContractViem = exports.DFSFeedRegistryContractViem = exports.FeedRegistryContractViem = exports.AaveIncentiveDataProviderV3ContractViem = exports.AaveV3ViewContractViem = exports.AaveLoanInfoV2ContractViem = exports.MorphoBlueViewContractViem = exports.getYearnVaultContractViem = exports.getMorphoVaultContractViem = exports.createViemContractFromConfigFunc = exports.getConfigContractAbi = exports.getConfigContractAddress = void 0;
37
+ exports.MakerDsrContractViem = void 0;
37
38
  const viem_1 = require("viem");
38
39
  const configRaw = __importStar(require("./config/contracts"));
39
40
  // @ts-ignore
@@ -147,3 +148,4 @@ exports.AaveRewardsControllerViem = (0, exports.createViemContractFromConfigFunc
147
148
  exports.LiquityV2sBoldVaultViem = (0, exports.createViemContractFromConfigFunc)('LiquityV2sBoldVault');
148
149
  exports.StkAAVEViem = (0, exports.createViemContractFromConfigFunc)('StkAAVE');
149
150
  exports.YearnViewContractViem = (0, exports.createViemContractFromConfigFunc)('YearnView');
151
+ exports.MakerDsrContractViem = (0, exports.createViemContractFromConfigFunc)('MakerDsr');
@@ -1,6 +1,7 @@
1
- import { SavingsData } from '../types';
1
+ import { MakerDsrType, MorphoVaultType, YearnVaultType } from '../types';
2
2
  import { EthAddress, EthereumProvider, NetworkNumber } from '../types/common';
3
3
  import * as morphoVaults from './morphoVaults';
4
4
  import * as yearnVaults from './yearnVaults';
5
- export { morphoVaults, yearnVaults, };
6
- export declare const getSavingsData: (provider: EthereumProvider, network: NetworkNumber, accounts: EthAddress[]) => Promise<SavingsData>;
5
+ import * as makerDsr from './makerDSR';
6
+ export { morphoVaults, yearnVaults, makerDsr, };
7
+ export declare const getSavingsData: (provider: EthereumProvider, network: NetworkNumber, accounts: EthAddress[]) => Promise<Partial<Record<MakerDsrType | MorphoVaultType | YearnVaultType, import("../types").SavingsVaultData>>>;
@@ -42,29 +42,33 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
42
42
  });
43
43
  };
44
44
  Object.defineProperty(exports, "__esModule", { value: true });
45
- exports.getSavingsData = exports.yearnVaults = exports.morphoVaults = void 0;
45
+ exports.getSavingsData = exports.makerDsr = exports.yearnVaults = exports.morphoVaults = void 0;
46
+ const types_1 = require("../types");
46
47
  const morphoVaults = __importStar(require("./morphoVaults"));
47
48
  exports.morphoVaults = morphoVaults;
48
49
  const yearnVaults = __importStar(require("./yearnVaults"));
49
50
  exports.yearnVaults = yearnVaults;
51
+ const makerDsr = __importStar(require("./makerDSR"));
52
+ exports.makerDsr = makerDsr;
50
53
  const getSavingsData = (provider, network, accounts) => __awaiter(void 0, void 0, void 0, function* () {
51
54
  const morphoVaultsList = Object.keys(morphoVaults.morphoVaultsOptions.MORPHO_VAULTS);
52
55
  const yearnVaultsList = Object.keys(yearnVaults.yearnVaultsOptions.YEARN_VAULTS);
53
- const savingsData = {
54
- morphoVaults: {},
55
- yearnVaults: {},
56
- };
56
+ const savingsData = {};
57
57
  yield Promise.all([
58
58
  ...morphoVaultsList.map((vaultKey) => __awaiter(void 0, void 0, void 0, function* () {
59
59
  const vault = morphoVaults.morphoVaultsOptions.getMorphoVault(vaultKey);
60
60
  const data = yield morphoVaults.getMorphoVaultData(provider, network, vault, accounts);
61
- savingsData.morphoVaults[vaultKey] = data;
61
+ savingsData[vaultKey] = data;
62
62
  })),
63
63
  ...yearnVaultsList.map((vaultKey) => __awaiter(void 0, void 0, void 0, function* () {
64
64
  const vault = yearnVaults.yearnVaultsOptions.getYearnVault(vaultKey);
65
65
  const data = yield yearnVaults.getYearnVaultData(provider, network, vault, accounts);
66
- savingsData.yearnVaults[vaultKey] = data;
66
+ savingsData[vaultKey] = data;
67
67
  })),
68
+ (() => __awaiter(void 0, void 0, void 0, function* () {
69
+ const data = yield makerDsr.getMakerDsrData(provider, network, accounts);
70
+ savingsData[types_1.MakerDsrType.MakerDsrVault] = data;
71
+ }))(),
68
72
  ]);
69
73
  return savingsData;
70
74
  });
@@ -0,0 +1,7 @@
1
+ import { Client } from 'viem';
2
+ import { SavingsVaultData } from '../../types';
3
+ import { EthAddress, EthereumProvider, NetworkNumber } from '../../types/common';
4
+ import * as makerDsrOptions from './options';
5
+ export { makerDsrOptions, };
6
+ export declare const _getMakerDsrData: (provider: Client, network: NetworkNumber, accounts: EthAddress[]) => Promise<SavingsVaultData>;
7
+ export declare function getMakerDsrData(provider: EthereumProvider, network: NetworkNumber, accounts: EthAddress[]): Promise<SavingsVaultData>;
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ var __importDefault = (this && this.__importDefault) || function (mod) {
45
+ return (mod && mod.__esModule) ? mod : { "default": mod };
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports._getMakerDsrData = exports.makerDsrOptions = void 0;
49
+ exports.getMakerDsrData = getMakerDsrData;
50
+ const decimal_js_1 = __importDefault(require("decimal.js"));
51
+ const viem_1 = require("../../services/viem");
52
+ const types_1 = require("../../types");
53
+ const makerDsrOptions = __importStar(require("./options"));
54
+ exports.makerDsrOptions = makerDsrOptions;
55
+ const contracts_1 = require("../../contracts");
56
+ const _getMakerDsrData = (provider, network, accounts) => __awaiter(void 0, void 0, void 0, function* () {
57
+ const contract = (0, contracts_1.MakerDsrContractViem)(provider, network);
58
+ const pieAmounts = {};
59
+ const [Pie, chi] = yield Promise.all([
60
+ contract.read.Pie(),
61
+ contract.read.chi(),
62
+ ...accounts.map((account) => __awaiter(void 0, void 0, void 0, function* () {
63
+ const pieAmount = yield contract.read.pie([account]);
64
+ pieAmounts[account] = pieAmount;
65
+ })),
66
+ ]);
67
+ const totalSupplyRad = new decimal_js_1.default(Pie).mul(chi).toString();
68
+ const poolSize = new decimal_js_1.default(totalSupplyRad).div(1e45).toString();
69
+ const supplied = {};
70
+ accounts.forEach((account) => {
71
+ const pie = pieAmounts[account] || BigInt(0);
72
+ const radAmount = new decimal_js_1.default(pie).mul(chi).toString();
73
+ supplied[account.toLowerCase()] = new decimal_js_1.default(radAmount).div(1e45).toString();
74
+ });
75
+ return {
76
+ poolSize,
77
+ liquidity: poolSize,
78
+ supplied,
79
+ asset: 'DAI',
80
+ optionType: types_1.MakerDsrType.MakerDsrVault,
81
+ };
82
+ });
83
+ exports._getMakerDsrData = _getMakerDsrData;
84
+ function getMakerDsrData(provider, network, accounts) {
85
+ return __awaiter(this, void 0, void 0, function* () {
86
+ return (0, exports._getMakerDsrData)((0, viem_1.getViemProvider)(provider, network, {
87
+ batch: {
88
+ multicall: {
89
+ batchSize: 2500000,
90
+ },
91
+ },
92
+ }), network, accounts);
93
+ });
94
+ }
@@ -0,0 +1,2 @@
1
+ import { MakerDsrVault } from '../../types';
2
+ export declare const MAKER_DSR_VAULT: MakerDsrVault;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAKER_DSR_VAULT = void 0;
4
+ const types_1 = require("../../types");
5
+ exports.MAKER_DSR_VAULT = {
6
+ type: types_1.MakerDsrType.MakerDsrVault,
7
+ name: 'Maker DSR',
8
+ address: '0x197e90f9fad81970ba7976f33cbd77088e5d7cf7',
9
+ asset: 'DAI',
10
+ };
@@ -101,6 +101,7 @@ const _getMorphoVaultData = (provider, network, morphoVault, accounts) => __awai
101
101
  supplied,
102
102
  liquidity,
103
103
  asset: morphoVault.asset,
104
+ optionType: morphoVault.type,
104
105
  };
105
106
  });
106
107
  exports._getMorphoVaultData = _getMorphoVaultData;
@@ -80,6 +80,7 @@ const _getYearnVaultData = (provider, network, yearnVault, accounts) => __awaite
80
80
  liquidity,
81
81
  supplied,
82
82
  asset: yearnVault.asset,
83
+ optionType: yearnVault.type,
83
84
  };
84
85
  });
85
86
  exports._getYearnVaultData = _getYearnVaultData;