@defisaver/positions-sdk 2.1.36 → 2.1.37

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 (36) hide show
  1. package/cjs/config/contracts.d.ts +42 -0
  2. package/cjs/config/contracts.js +4 -1
  3. package/cjs/contracts.d.ts +205 -0
  4. package/cjs/contracts.js +11 -2
  5. package/cjs/savings/index.d.ts +3 -2
  6. package/cjs/savings/index.js +3 -1
  7. package/cjs/savings/yearnV3Vaults/index.d.ts +7 -0
  8. package/cjs/savings/yearnV3Vaults/index.js +97 -0
  9. package/cjs/savings/yearnV3Vaults/options.d.ts +8 -0
  10. package/cjs/savings/yearnV3Vaults/options.js +53 -0
  11. package/cjs/types/savings/index.d.ts +3 -1
  12. package/cjs/types/savings/index.js +1 -0
  13. package/cjs/types/savings/yearnV3Vaults.d.ts +16 -0
  14. package/cjs/types/savings/yearnV3Vaults.js +11 -0
  15. package/esm/config/contracts.d.ts +42 -0
  16. package/esm/config/contracts.js +3 -0
  17. package/esm/contracts.d.ts +205 -0
  18. package/esm/contracts.js +8 -0
  19. package/esm/savings/index.d.ts +3 -2
  20. package/esm/savings/index.js +2 -1
  21. package/esm/savings/yearnV3Vaults/index.d.ts +7 -0
  22. package/esm/savings/yearnV3Vaults/index.js +56 -0
  23. package/esm/savings/yearnV3Vaults/options.d.ts +8 -0
  24. package/esm/savings/yearnV3Vaults/options.js +49 -0
  25. package/esm/types/savings/index.d.ts +3 -1
  26. package/esm/types/savings/index.js +1 -0
  27. package/esm/types/savings/yearnV3Vaults.d.ts +16 -0
  28. package/esm/types/savings/yearnV3Vaults.js +8 -0
  29. package/package.json +1 -1
  30. package/src/config/contracts.ts +3 -0
  31. package/src/contracts.ts +9 -0
  32. package/src/savings/index.ts +2 -0
  33. package/src/savings/yearnV3Vaults/index.ts +61 -0
  34. package/src/savings/yearnV3Vaults/options.ts +56 -0
  35. package/src/types/savings/index.ts +3 -1
  36. package/src/types/savings/yearnV3Vaults.ts +18 -0
@@ -85483,3 +85483,45 @@ export declare const SkySavings: {
85483
85483
  };
85484
85484
  };
85485
85485
  };
85486
+ export declare const YearnV3Vault: {
85487
+ readonly abi: readonly [{
85488
+ readonly stateMutability: "view";
85489
+ readonly type: "function";
85490
+ readonly name: "balanceOf";
85491
+ readonly inputs: readonly [{
85492
+ readonly name: "addr";
85493
+ readonly type: "address";
85494
+ }];
85495
+ readonly outputs: readonly [{
85496
+ readonly name: "";
85497
+ readonly type: "uint256";
85498
+ }];
85499
+ }, {
85500
+ readonly stateMutability: "view";
85501
+ readonly type: "function";
85502
+ readonly name: "totalAssets";
85503
+ readonly inputs: readonly [];
85504
+ readonly outputs: readonly [{
85505
+ readonly name: "";
85506
+ readonly type: "uint256";
85507
+ }];
85508
+ }, {
85509
+ readonly stateMutability: "view";
85510
+ readonly type: "function";
85511
+ readonly name: "totalDebt";
85512
+ readonly inputs: readonly [];
85513
+ readonly outputs: readonly [{
85514
+ readonly name: "";
85515
+ readonly type: "uint256";
85516
+ }];
85517
+ }, {
85518
+ readonly stateMutability: "view";
85519
+ readonly type: "function";
85520
+ readonly name: "totalSupply";
85521
+ readonly inputs: readonly [];
85522
+ readonly outputs: readonly [{
85523
+ readonly name: "";
85524
+ readonly type: "uint256";
85525
+ }];
85526
+ }];
85527
+ };
@@ -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.SkySavings = exports.SparkSavingsVault = 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;
5
+ exports.YearnV3Vault = exports.SkySavings = exports.SparkSavingsVault = 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": {
@@ -1293,3 +1293,6 @@ exports.SkySavings = {
1293
1293
  }
1294
1294
  }
1295
1295
  };
1296
+ exports.YearnV3Vault = {
1297
+ "abi": [{ "stateMutability": "view", "type": "function", "name": "balanceOf", "inputs": [{ "name": "addr", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "totalAssets", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "totalDebt", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "totalSupply", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }]
1298
+ };
@@ -47908,6 +47908,211 @@ export declare const getErc20ContractViem: (client: Client, address: HexString)
47908
47908
  readonly type: "event";
47909
47909
  }];
47910
47910
  };
47911
+ export declare const getYearnV3VaultContractViem: (client: Client, address: HexString) => {
47912
+ read: {
47913
+ totalSupply: (options?: import("viem").Prettify<import("viem").UnionOmit<import("viem").ReadContractParameters<readonly [{
47914
+ readonly stateMutability: "view";
47915
+ readonly type: "function";
47916
+ readonly name: "balanceOf";
47917
+ readonly inputs: readonly [{
47918
+ readonly name: "addr";
47919
+ readonly type: "address";
47920
+ }];
47921
+ readonly outputs: readonly [{
47922
+ readonly name: "";
47923
+ readonly type: "uint256";
47924
+ }];
47925
+ }, {
47926
+ readonly stateMutability: "view";
47927
+ readonly type: "function";
47928
+ readonly name: "totalAssets";
47929
+ readonly inputs: readonly [];
47930
+ readonly outputs: readonly [{
47931
+ readonly name: "";
47932
+ readonly type: "uint256";
47933
+ }];
47934
+ }, {
47935
+ readonly stateMutability: "view";
47936
+ readonly type: "function";
47937
+ readonly name: "totalDebt";
47938
+ readonly inputs: readonly [];
47939
+ readonly outputs: readonly [{
47940
+ readonly name: "";
47941
+ readonly type: "uint256";
47942
+ }];
47943
+ }, {
47944
+ readonly stateMutability: "view";
47945
+ readonly type: "function";
47946
+ readonly name: "totalSupply";
47947
+ readonly inputs: readonly [];
47948
+ readonly outputs: readonly [{
47949
+ readonly name: "";
47950
+ readonly type: "uint256";
47951
+ }];
47952
+ }], "totalSupply", readonly []>, "address" | "args" | "abi" | "functionName">> | undefined) => Promise<bigint>;
47953
+ totalDebt: (options?: import("viem").Prettify<import("viem").UnionOmit<import("viem").ReadContractParameters<readonly [{
47954
+ readonly stateMutability: "view";
47955
+ readonly type: "function";
47956
+ readonly name: "balanceOf";
47957
+ readonly inputs: readonly [{
47958
+ readonly name: "addr";
47959
+ readonly type: "address";
47960
+ }];
47961
+ readonly outputs: readonly [{
47962
+ readonly name: "";
47963
+ readonly type: "uint256";
47964
+ }];
47965
+ }, {
47966
+ readonly stateMutability: "view";
47967
+ readonly type: "function";
47968
+ readonly name: "totalAssets";
47969
+ readonly inputs: readonly [];
47970
+ readonly outputs: readonly [{
47971
+ readonly name: "";
47972
+ readonly type: "uint256";
47973
+ }];
47974
+ }, {
47975
+ readonly stateMutability: "view";
47976
+ readonly type: "function";
47977
+ readonly name: "totalDebt";
47978
+ readonly inputs: readonly [];
47979
+ readonly outputs: readonly [{
47980
+ readonly name: "";
47981
+ readonly type: "uint256";
47982
+ }];
47983
+ }, {
47984
+ readonly stateMutability: "view";
47985
+ readonly type: "function";
47986
+ readonly name: "totalSupply";
47987
+ readonly inputs: readonly [];
47988
+ readonly outputs: readonly [{
47989
+ readonly name: "";
47990
+ readonly type: "uint256";
47991
+ }];
47992
+ }], "totalDebt", readonly []>, "address" | "args" | "abi" | "functionName">> | undefined) => Promise<bigint>;
47993
+ balanceOf: (args: readonly [`0x${string}`], options?: import("viem").Prettify<import("viem").UnionOmit<import("viem").ReadContractParameters<readonly [{
47994
+ readonly stateMutability: "view";
47995
+ readonly type: "function";
47996
+ readonly name: "balanceOf";
47997
+ readonly inputs: readonly [{
47998
+ readonly name: "addr";
47999
+ readonly type: "address";
48000
+ }];
48001
+ readonly outputs: readonly [{
48002
+ readonly name: "";
48003
+ readonly type: "uint256";
48004
+ }];
48005
+ }, {
48006
+ readonly stateMutability: "view";
48007
+ readonly type: "function";
48008
+ readonly name: "totalAssets";
48009
+ readonly inputs: readonly [];
48010
+ readonly outputs: readonly [{
48011
+ readonly name: "";
48012
+ readonly type: "uint256";
48013
+ }];
48014
+ }, {
48015
+ readonly stateMutability: "view";
48016
+ readonly type: "function";
48017
+ readonly name: "totalDebt";
48018
+ readonly inputs: readonly [];
48019
+ readonly outputs: readonly [{
48020
+ readonly name: "";
48021
+ readonly type: "uint256";
48022
+ }];
48023
+ }, {
48024
+ readonly stateMutability: "view";
48025
+ readonly type: "function";
48026
+ readonly name: "totalSupply";
48027
+ readonly inputs: readonly [];
48028
+ readonly outputs: readonly [{
48029
+ readonly name: "";
48030
+ readonly type: "uint256";
48031
+ }];
48032
+ }], "balanceOf", readonly [`0x${string}`]>, "address" | "args" | "abi" | "functionName">> | undefined) => Promise<bigint>;
48033
+ totalAssets: (options?: import("viem").Prettify<import("viem").UnionOmit<import("viem").ReadContractParameters<readonly [{
48034
+ readonly stateMutability: "view";
48035
+ readonly type: "function";
48036
+ readonly name: "balanceOf";
48037
+ readonly inputs: readonly [{
48038
+ readonly name: "addr";
48039
+ readonly type: "address";
48040
+ }];
48041
+ readonly outputs: readonly [{
48042
+ readonly name: "";
48043
+ readonly type: "uint256";
48044
+ }];
48045
+ }, {
48046
+ readonly stateMutability: "view";
48047
+ readonly type: "function";
48048
+ readonly name: "totalAssets";
48049
+ readonly inputs: readonly [];
48050
+ readonly outputs: readonly [{
48051
+ readonly name: "";
48052
+ readonly type: "uint256";
48053
+ }];
48054
+ }, {
48055
+ readonly stateMutability: "view";
48056
+ readonly type: "function";
48057
+ readonly name: "totalDebt";
48058
+ readonly inputs: readonly [];
48059
+ readonly outputs: readonly [{
48060
+ readonly name: "";
48061
+ readonly type: "uint256";
48062
+ }];
48063
+ }, {
48064
+ readonly stateMutability: "view";
48065
+ readonly type: "function";
48066
+ readonly name: "totalSupply";
48067
+ readonly inputs: readonly [];
48068
+ readonly outputs: readonly [{
48069
+ readonly name: "";
48070
+ readonly type: "uint256";
48071
+ }];
48072
+ }], "totalAssets", readonly []>, "address" | "args" | "abi" | "functionName">> | undefined) => Promise<bigint>;
48073
+ };
48074
+ address: `0x${string}`;
48075
+ abi: readonly [{
48076
+ readonly stateMutability: "view";
48077
+ readonly type: "function";
48078
+ readonly name: "balanceOf";
48079
+ readonly inputs: readonly [{
48080
+ readonly name: "addr";
48081
+ readonly type: "address";
48082
+ }];
48083
+ readonly outputs: readonly [{
48084
+ readonly name: "";
48085
+ readonly type: "uint256";
48086
+ }];
48087
+ }, {
48088
+ readonly stateMutability: "view";
48089
+ readonly type: "function";
48090
+ readonly name: "totalAssets";
48091
+ readonly inputs: readonly [];
48092
+ readonly outputs: readonly [{
48093
+ readonly name: "";
48094
+ readonly type: "uint256";
48095
+ }];
48096
+ }, {
48097
+ readonly stateMutability: "view";
48098
+ readonly type: "function";
48099
+ readonly name: "totalDebt";
48100
+ readonly inputs: readonly [];
48101
+ readonly outputs: readonly [{
48102
+ readonly name: "";
48103
+ readonly type: "uint256";
48104
+ }];
48105
+ }, {
48106
+ readonly stateMutability: "view";
48107
+ readonly type: "function";
48108
+ readonly name: "totalSupply";
48109
+ readonly inputs: readonly [];
48110
+ readonly outputs: readonly [{
48111
+ readonly name: "";
48112
+ readonly type: "uint256";
48113
+ }];
48114
+ }];
48115
+ };
47911
48116
  export declare const MorphoBlueViewContractViem: (client: Client, network: NetworkNumber, block?: Blockish) => {
47912
48117
  read: {
47913
48118
  getApyAfterValuesEstimation: (args: readonly [{
package/cjs/contracts.js CHANGED
@@ -33,8 +33,8 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- 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.getErc20ContractViem = exports.getSparkSavingsVaultContractViem = exports.getYearnVaultContractViem = exports.getMorphoVaultContractViem = exports.createViemContractFromConfigFunc = exports.getConfigContractAbi = exports.getConfigContractAddress = void 0;
37
- exports.SkySavingsContractView = exports.MakerDsrContractViem = exports.YearnViewContractViem = exports.StkAAVEViem = void 0;
36
+ 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.getYearnV3VaultContractViem = exports.getErc20ContractViem = exports.getSparkSavingsVaultContractViem = exports.getYearnVaultContractViem = exports.getMorphoVaultContractViem = exports.createViemContractFromConfigFunc = exports.getConfigContractAbi = exports.getConfigContractAddress = void 0;
37
+ exports.SkySavingsContractView = exports.MakerDsrContractViem = exports.YearnViewContractViem = exports.StkAAVEViem = exports.LiquityV2sBoldVaultViem = void 0;
38
38
  const viem_1 = require("viem");
39
39
  const configRaw = __importStar(require("./config/contracts"));
40
40
  // @ts-ignore
@@ -121,6 +121,15 @@ const getErc20ContractViem = (client, address) => {
121
121
  });
122
122
  };
123
123
  exports.getErc20ContractViem = getErc20ContractViem;
124
+ const getYearnV3VaultContractViem = (client, address) => {
125
+ const abi = (0, exports.getConfigContractAbi)('YearnV3Vault');
126
+ return (0, viem_1.getContract)({
127
+ address,
128
+ abi,
129
+ client,
130
+ });
131
+ };
132
+ exports.getYearnV3VaultContractViem = getYearnV3VaultContractViem;
124
133
  exports.MorphoBlueViewContractViem = (0, exports.createViemContractFromConfigFunc)('MorphoBlueView');
125
134
  exports.AaveLoanInfoV2ContractViem = (0, exports.createViemContractFromConfigFunc)('AaveLoanInfoV2');
126
135
  exports.AaveV3ViewContractViem = (0, exports.createViemContractFromConfigFunc)('AaveV3View');
@@ -5,5 +5,6 @@ import * as yearnVaults from './yearnVaults';
5
5
  import * as makerDsr from './makerDsr';
6
6
  import * as skyOptions from './skyOptions';
7
7
  import * as sparkSavingsVaults from './sparkSavingsVaults';
8
- export { morphoVaults, yearnVaults, makerDsr, skyOptions, sparkSavingsVaults, };
9
- export declare const getSavingsData: (provider: EthereumProvider, network: NetworkNumber, accounts: EthAddress[]) => Promise<Partial<Record<MakerDsrType | MorphoVaultType | SkySavingsType | SparkSavingsVaultType | YearnVaultType, import("../types").SavingsVaultData>>>;
8
+ import * as yearnV3Vaults from './yearnV3Vaults';
9
+ export { morphoVaults, yearnVaults, makerDsr, skyOptions, sparkSavingsVaults, yearnV3Vaults, };
10
+ export declare const getSavingsData: (provider: EthereumProvider, network: NetworkNumber, accounts: EthAddress[]) => Promise<Partial<Record<MakerDsrType | MorphoVaultType | SkySavingsType | SparkSavingsVaultType | import("../types").YearnV3VaultType | YearnVaultType, import("../types").SavingsVaultData>>>;
@@ -42,7 +42,7 @@ 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.sparkSavingsVaults = exports.skyOptions = exports.makerDsr = exports.yearnVaults = exports.morphoVaults = void 0;
45
+ exports.getSavingsData = exports.yearnV3Vaults = exports.sparkSavingsVaults = exports.skyOptions = exports.makerDsr = exports.yearnVaults = exports.morphoVaults = void 0;
46
46
  const types_1 = require("../types");
47
47
  const morphoVaults = __importStar(require("./morphoVaults"));
48
48
  exports.morphoVaults = morphoVaults;
@@ -54,6 +54,8 @@ const skyOptions = __importStar(require("./skyOptions"));
54
54
  exports.skyOptions = skyOptions;
55
55
  const sparkSavingsVaults = __importStar(require("./sparkSavingsVaults"));
56
56
  exports.sparkSavingsVaults = sparkSavingsVaults;
57
+ const yearnV3Vaults = __importStar(require("./yearnV3Vaults"));
58
+ exports.yearnV3Vaults = yearnV3Vaults;
57
59
  const getSavingsData = (provider, network, accounts) => __awaiter(void 0, void 0, void 0, function* () {
58
60
  const morphoVaultsList = Object.keys(morphoVaults.morphoVaultsOptions.MORPHO_VAULTS);
59
61
  const yearnVaultsList = Object.keys(yearnVaults.yearnVaultsOptions.YEARN_VAULTS);
@@ -0,0 +1,7 @@
1
+ import { Client } from 'viem';
2
+ import { SavingsVaultData, YearnV3Vault } from '../../types';
3
+ import { EthAddress, EthereumProvider, NetworkNumber } from '../../types/common';
4
+ import * as yearnV3VaultsOptions from './options';
5
+ export { yearnV3VaultsOptions, };
6
+ export declare const _getYearnV3VaultData: (provider: Client, network: NetworkNumber, yearnV3Vault: YearnV3Vault, accounts: EthAddress[]) => Promise<SavingsVaultData>;
7
+ export declare function getYearnV3VaultData(provider: EthereumProvider, network: NetworkNumber, yearnV3Vault: YearnV3Vault, accounts: EthAddress[]): Promise<SavingsVaultData>;
@@ -0,0 +1,97 @@
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._getYearnV3VaultData = exports.yearnV3VaultsOptions = void 0;
49
+ exports.getYearnV3VaultData = getYearnV3VaultData;
50
+ const decimal_js_1 = __importDefault(require("decimal.js"));
51
+ const tokens_1 = require("@defisaver/tokens");
52
+ const viem_1 = require("../../services/viem");
53
+ const yearnV3VaultsOptions = __importStar(require("./options"));
54
+ exports.yearnV3VaultsOptions = yearnV3VaultsOptions;
55
+ const contracts_1 = require("../../contracts");
56
+ const _getYearnV3VaultData = (provider, network, yearnV3Vault, accounts) => __awaiter(void 0, void 0, void 0, function* () {
57
+ const yearnV3VaultContract = (0, contracts_1.getYearnV3VaultContractViem)(provider, yearnV3Vault.address);
58
+ const shares = {};
59
+ const [totalAssets, totalSupply, totalDebt] = yield Promise.all([
60
+ yearnV3VaultContract.read.totalAssets(),
61
+ yearnV3VaultContract.read.totalSupply(),
62
+ yearnV3VaultContract.read.totalDebt(),
63
+ ...accounts.map((account) => __awaiter(void 0, void 0, void 0, function* () {
64
+ const share = yield yearnV3VaultContract.read.balanceOf([account]);
65
+ shares[account] = share;
66
+ })),
67
+ ]);
68
+ const poolSize = (0, tokens_1.assetAmountInEth)(totalAssets.toString(), yearnV3Vault.asset);
69
+ const debt = (0, tokens_1.assetAmountInEth)(totalDebt.toString(), yearnV3Vault.asset);
70
+ // DEV: Check if true
71
+ const liquidity = poolSize;
72
+ const supplied = {};
73
+ accounts.forEach((account) => {
74
+ const share = shares[account] || BigInt(0);
75
+ supplied[account.toLowerCase()] = (0, tokens_1.assetAmountInEth)(new decimal_js_1.default(share).mul(totalAssets).div(totalSupply).toFixed()
76
+ .toString(), yearnV3Vault.asset);
77
+ });
78
+ return {
79
+ poolSize,
80
+ supplied,
81
+ liquidity,
82
+ asset: yearnV3Vault.asset,
83
+ optionType: yearnV3Vault.type,
84
+ };
85
+ });
86
+ exports._getYearnV3VaultData = _getYearnV3VaultData;
87
+ function getYearnV3VaultData(provider, network, yearnV3Vault, accounts) {
88
+ return __awaiter(this, void 0, void 0, function* () {
89
+ return (0, exports._getYearnV3VaultData)((0, viem_1.getViemProvider)(provider, network, {
90
+ batch: {
91
+ multicall: {
92
+ batchSize: 2500000,
93
+ },
94
+ },
95
+ }), network, yearnV3Vault, accounts);
96
+ });
97
+ }
@@ -0,0 +1,8 @@
1
+ import { YearnV3Vault, YearnV3VaultType } from '../../types';
2
+ export declare const YEARN_V3_VAULT_USDC: YearnV3Vault;
3
+ export declare const YEARN_V3_VAULT_USDS: YearnV3Vault;
4
+ export declare const YEARN_V3_VAULT_DAI: YearnV3Vault;
5
+ export declare const YEARN_V3_VAULT_USDT: YearnV3Vault;
6
+ export declare const YEARN_V3_VAULT_WETH_1: YearnV3Vault;
7
+ export declare const YEARN_V3_VAULTS: Record<YearnV3VaultType, YearnV3Vault>;
8
+ export declare const getYearnV3Vault: (type: YearnV3VaultType) => YearnV3Vault;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getYearnV3Vault = exports.YEARN_V3_VAULTS = exports.YEARN_V3_VAULT_WETH_1 = exports.YEARN_V3_VAULT_USDT = exports.YEARN_V3_VAULT_DAI = exports.YEARN_V3_VAULT_USDS = exports.YEARN_V3_VAULT_USDC = void 0;
4
+ const types_1 = require("../../types");
5
+ exports.YEARN_V3_VAULT_USDC = {
6
+ type: types_1.YearnV3VaultType.YearnVaultV3USDC,
7
+ name: 'Yearn V3 USDC',
8
+ address: '0xBe53A109B494E5c9f97b9Cd39Fe969BE68BF6204',
9
+ asset: 'USDC',
10
+ deploymentBlock: 19419991,
11
+ isLegacy: false,
12
+ };
13
+ exports.YEARN_V3_VAULT_USDS = {
14
+ type: types_1.YearnV3VaultType.YearnVaultV3USDS,
15
+ name: 'Yearn V3 USDS',
16
+ address: '0x182863131F9a4630fF9E27830d945B1413e347E8',
17
+ asset: 'USDS',
18
+ deploymentBlock: 20917639,
19
+ isLegacy: false,
20
+ };
21
+ exports.YEARN_V3_VAULT_DAI = {
22
+ type: types_1.YearnV3VaultType.YearnVaultV3DAI,
23
+ name: 'Yearn V3 DAI',
24
+ address: '0x028eC7330ff87667b6dfb0D94b954c820195336c',
25
+ asset: 'DAI',
26
+ deploymentBlock: 19419991,
27
+ isLegacy: false,
28
+ };
29
+ exports.YEARN_V3_VAULT_USDT = {
30
+ type: types_1.YearnV3VaultType.YearnVaultV3USDT,
31
+ name: 'Yearn V3 USDT',
32
+ address: '0x310B7Ea7475A0B449Cfd73bE81522F1B88eFAFaa',
33
+ asset: 'USDT',
34
+ deploymentBlock: 20369520,
35
+ isLegacy: false,
36
+ };
37
+ exports.YEARN_V3_VAULT_WETH_1 = {
38
+ type: types_1.YearnV3VaultType.YearnVaultV3WETH_1,
39
+ name: 'Yearn V3 WETH',
40
+ address: '0xc56413869c6CDf96496f2b1eF801fEDBdFA7dDB0',
41
+ asset: 'WETH',
42
+ deploymentBlock: 19419991,
43
+ isLegacy: false,
44
+ };
45
+ exports.YEARN_V3_VAULTS = {
46
+ [types_1.YearnV3VaultType.YearnVaultV3USDC]: exports.YEARN_V3_VAULT_USDC,
47
+ [types_1.YearnV3VaultType.YearnVaultV3USDS]: exports.YEARN_V3_VAULT_USDS,
48
+ [types_1.YearnV3VaultType.YearnVaultV3DAI]: exports.YEARN_V3_VAULT_DAI,
49
+ [types_1.YearnV3VaultType.YearnVaultV3USDT]: exports.YEARN_V3_VAULT_USDT,
50
+ [types_1.YearnV3VaultType.YearnVaultV3WETH_1]: exports.YEARN_V3_VAULT_WETH_1,
51
+ };
52
+ const getYearnV3Vault = (type) => exports.YEARN_V3_VAULTS[type];
53
+ exports.getYearnV3Vault = getYearnV3Vault;
@@ -3,12 +3,14 @@ import { MakerDsrType } from './makerDsr';
3
3
  import { MorphoVaultType } from './morphoVaults';
4
4
  import { SkySavingsType } from './sky';
5
5
  import { SparkSavingsVaultType } from './sparkSavingsVaults';
6
+ import { YearnV3VaultType } from './yearnV3Vaults';
6
7
  import { YearnVaultType } from './yearnVaults';
7
8
  export * from './morphoVaults';
8
9
  export * from './yearnVaults';
9
10
  export * from './makerDsr';
10
11
  export * from './sky';
11
12
  export * from './sparkSavingsVaults';
13
+ export * from './yearnV3Vaults';
12
14
  export interface SavingsVaultData {
13
15
  poolSize: string;
14
16
  liquidity: string;
@@ -16,4 +18,4 @@ export interface SavingsVaultData {
16
18
  asset: string;
17
19
  optionType: string;
18
20
  }
19
- export type SavingsData = Partial<Record<MorphoVaultType | YearnVaultType | MakerDsrType | SkySavingsType | SparkSavingsVaultType, SavingsVaultData>>;
21
+ export type SavingsData = Partial<Record<MorphoVaultType | YearnVaultType | MakerDsrType | SkySavingsType | SparkSavingsVaultType | YearnV3VaultType, SavingsVaultData>>;
@@ -19,3 +19,4 @@ __exportStar(require("./yearnVaults"), exports);
19
19
  __exportStar(require("./makerDsr"), exports);
20
20
  __exportStar(require("./sky"), exports);
21
21
  __exportStar(require("./sparkSavingsVaults"), exports);
22
+ __exportStar(require("./yearnV3Vaults"), exports);
@@ -0,0 +1,16 @@
1
+ import { EthAddress } from '../common';
2
+ export declare enum YearnV3VaultType {
3
+ YearnVaultV3USDC = "yearn_v3_vault_usdc",
4
+ YearnVaultV3USDS = "yearn_v3_vault_usds",
5
+ YearnVaultV3USDT = "yearn_v3_vault_usdt",
6
+ YearnVaultV3DAI = "yearn_v3_vault_dai",
7
+ YearnVaultV3WETH_1 = "yearn_v3_vault_weth_1"
8
+ }
9
+ export interface YearnV3Vault {
10
+ type: YearnV3VaultType;
11
+ address: EthAddress;
12
+ asset: string;
13
+ name: string;
14
+ deploymentBlock: number;
15
+ isLegacy: boolean;
16
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.YearnV3VaultType = void 0;
4
+ var YearnV3VaultType;
5
+ (function (YearnV3VaultType) {
6
+ YearnV3VaultType["YearnVaultV3USDC"] = "yearn_v3_vault_usdc";
7
+ YearnV3VaultType["YearnVaultV3USDS"] = "yearn_v3_vault_usds";
8
+ YearnV3VaultType["YearnVaultV3USDT"] = "yearn_v3_vault_usdt";
9
+ YearnV3VaultType["YearnVaultV3DAI"] = "yearn_v3_vault_dai";
10
+ YearnV3VaultType["YearnVaultV3WETH_1"] = "yearn_v3_vault_weth_1";
11
+ })(YearnV3VaultType || (exports.YearnV3VaultType = YearnV3VaultType = {}));