@gearbox-protocol/sdk 17.1.0-next.1 → 17.1.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/onchain/MultichainSDK.js +2 -27
- package/dist/cjs/onchain/OnchainSDK.js +5 -6
- package/dist/cjs/onchain/accounts/intents/borrow.js +47 -20
- package/dist/cjs/onchain/accounts/intents/guards.js +6 -4
- package/dist/cjs/onchain/accounts/intents/index.js +40 -9
- package/dist/cjs/onchain/accounts/intents/math.js +4 -10
- package/dist/cjs/onchain/accounts/intents/open-strategy.js +49 -17
- package/dist/cjs/onchain/accounts/intents/plan.js +8 -1
- package/dist/cjs/onchain/accounts/intents/realize.js +55 -24
- package/dist/cjs/onchain/index.js +0 -5
- package/dist/cjs/onchain/market/credit/CreditSuite.js +6 -5
- package/dist/cjs/onchain/market/index.js +0 -5
- package/dist/cjs/onchain/market/pricefeeds/feeds/RedstonePriceFeed.js +1 -7
- package/dist/cjs/onchain/market/pricefeeds/index.js +0 -5
- package/dist/cjs/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.js +5 -5
- package/dist/cjs/onchain/market/pricefeeds/updates/index.js +0 -5
- package/dist/cjs/onchain/options.js +1 -7
- package/dist/cjs/permissionless/index.js +1 -5
- package/dist/cjs/permissionless/utils/index.js +1 -5
- package/dist/cjs/permissionless/utils/price-update/get-price-update-tx.js +5 -0
- package/dist/cjs/permissionless/utils/price-update/get-updatable-feeds.js +6 -4
- package/dist/cjs/permissionless/utils/price-update/index.js +1 -5
- package/dist/cjs/sdk/prepare/PrepareApi.js +83 -32
- package/dist/esm/onchain/MultichainSDK.js +2 -27
- package/dist/esm/onchain/OnchainSDK.js +5 -6
- package/dist/esm/onchain/accounts/intents/borrow.js +47 -20
- package/dist/esm/onchain/accounts/intents/guards.js +6 -4
- package/dist/esm/onchain/accounts/intents/index.js +40 -9
- package/dist/esm/onchain/accounts/intents/math.js +5 -10
- package/dist/esm/onchain/accounts/intents/open-strategy.js +49 -17
- package/dist/esm/onchain/accounts/intents/plan.js +8 -1
- package/dist/esm/onchain/accounts/intents/realize.js +55 -24
- package/dist/esm/onchain/index.js +1 -3
- package/dist/esm/onchain/market/credit/CreditSuite.js +6 -5
- package/dist/esm/onchain/market/index.js +1 -3
- package/dist/esm/onchain/market/pricefeeds/feeds/RedstonePriceFeed.js +1 -7
- package/dist/esm/onchain/market/pricefeeds/index.js +1 -3
- package/dist/esm/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.js +5 -5
- package/dist/esm/onchain/market/pricefeeds/updates/index.js +1 -3
- package/dist/esm/onchain/options.js +1 -7
- package/dist/esm/permissionless/index.js +2 -3
- package/dist/esm/permissionless/utils/index.js +2 -3
- package/dist/esm/permissionless/utils/price-update/get-price-update-tx.js +5 -0
- package/dist/esm/permissionless/utils/price-update/get-updatable-feeds.js +6 -4
- package/dist/esm/permissionless/utils/price-update/index.js +2 -3
- package/dist/esm/sdk/prepare/PrepareApi.js +83 -32
- package/dist/types/onchain/MultichainSDK.d.ts +0 -10
- package/dist/types/onchain/OnchainSDK.d.ts +0 -10
- package/dist/types/onchain/accounts/index.d.ts +2 -2
- package/dist/types/onchain/accounts/intents/borrow.d.ts +5 -0
- package/dist/types/onchain/accounts/intents/guards.d.ts +6 -4
- package/dist/types/onchain/accounts/intents/index.d.ts +4 -4
- package/dist/types/onchain/accounts/intents/math.d.ts +2 -9
- package/dist/types/onchain/accounts/intents/open-strategy.d.ts +5 -0
- package/dist/types/onchain/accounts/intents/realize.d.ts +5 -0
- package/dist/types/onchain/accounts/intents/types.d.ts +49 -6
- package/dist/types/onchain/index.d.ts +4 -6
- package/dist/types/onchain/market/credit/CreditSuite.d.ts +10 -0
- package/dist/types/onchain/market/index.d.ts +3 -5
- package/dist/types/onchain/market/pricefeeds/feeds/RedstonePriceFeed.d.ts +1 -4
- package/dist/types/onchain/market/pricefeeds/index.d.ts +3 -5
- package/dist/types/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.d.ts +4 -4
- package/dist/types/onchain/market/pricefeeds/updates/index.d.ts +3 -5
- package/dist/types/onchain/market/pricefeeds/updates/types.d.ts +2 -16
- package/dist/types/onchain/options.d.ts +0 -7
- package/dist/types/permissionless/index.d.ts +2 -3
- package/dist/types/permissionless/utils/index.d.ts +2 -3
- package/dist/types/permissionless/utils/price-update/get-price-update-tx.d.ts +5 -0
- package/dist/types/permissionless/utils/price-update/get-updatable-feeds.d.ts +9 -3
- package/dist/types/permissionless/utils/price-update/index.d.ts +2 -3
- package/dist/types/sdk/index.d.ts +2 -2
- package/dist/types/sdk/prepare/PrepareApi.d.ts +16 -14
- package/dist/types/sdk/prepare/index.d.ts +2 -2
- package/dist/types/sdk/prepare/types.d.ts +21 -14
- package/package.json +1 -5
- package/dist/cjs/onchain/market/pricefeeds/updates/RedstoneUpdater.js +0 -193
- package/dist/cjs/onchain/market/pricefeeds/updates/fetchRedstonePayloads.js +0 -95
- package/dist/cjs/permissionless/utils/price-update/get-price-feeds.js +0 -60
- package/dist/esm/onchain/market/pricefeeds/updates/RedstoneUpdater.js +0 -191
- package/dist/esm/onchain/market/pricefeeds/updates/fetchRedstonePayloads.js +0 -94
- package/dist/esm/permissionless/utils/price-update/get-price-feeds.js +0 -57
- package/dist/types/onchain/market/pricefeeds/updates/RedstoneUpdater.d.ts +0 -37
- package/dist/types/onchain/market/pricefeeds/updates/fetchRedstonePayloads.d.ts +0 -62
- package/dist/types/permissionless/utils/price-update/get-price-feeds.d.ts +0 -22
|
@@ -170,11 +170,9 @@ import { WstETHPriceFeedContract } from "./market/pricefeeds/feeds/WstETHPriceFe
|
|
|
170
170
|
import { YearnPriceFeedContract } from "./market/pricefeeds/feeds/YearnPriceFeed.js";
|
|
171
171
|
import { ZeroPriceFeedContract } from "./market/pricefeeds/feeds/ZeroPriceFeed.js";
|
|
172
172
|
import { PriceFeedRegistry } from "./market/pricefeeds/PriceFeedRegistry.js";
|
|
173
|
-
import { fetchRedstonePayloads } from "./market/pricefeeds/updates/fetchRedstonePayloads.js";
|
|
174
173
|
import { getRawPriceUpdates } from "./market/pricefeeds/updates/getRawPriceUpdates.js";
|
|
175
174
|
import { isUpdatablePriceFeed } from "./market/pricefeeds/updates/isUpdatablePriceFeed.js";
|
|
176
175
|
import { PriceUpdatesCache } from "./market/pricefeeds/updates/PriceUpdatesCache.js";
|
|
177
|
-
import { RedstoneOptions, RedstoneUpdater } from "./market/pricefeeds/updates/RedstoneUpdater.js";
|
|
178
176
|
import { updatableDependencies } from "./market/pricefeeds/updates/updatableDependencies.js";
|
|
179
177
|
import { UpdatablePriceFeedRegistry } from "./market/pricefeeds/updates/UpdatablePriceFeedRegistry.js";
|
|
180
178
|
import { PriceOracleV310Contract } from "./market/oracle/PriceOracleV310Contract.js";
|
|
@@ -306,4 +304,4 @@ import { replayMulticall } from "./preview/preview/replayMulticall.js";
|
|
|
306
304
|
import { previewOperation } from "./preview/preview/previewOperation.js";
|
|
307
305
|
import "./preview/index.js";
|
|
308
306
|
import "./types/index.js";
|
|
309
|
-
export { ADDRESS_0X0, ADDRESS_PROVIDER_V310, AP_ACCOUNT_FACTORY, AP_ACL, AP_BOT_LIST, AP_BYTECODE_REPOSITORY, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_CREDIT_SUITE_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GAUGE_COMPRESSOR, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_PARTIAL_LIQUIDATION_BOT, AP_PERIPHERY_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_FEED_STORE, AP_PRICE_ORACLE, AP_REDEMPTION_LOGGER, AP_REWARDS_COMPRESSOR, AP_ROUTER, AP_TOKEN_COMPRESSOR, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractAdapterContract, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountBotsService, AccountMigratorAdapterContract, AdapterType, AddressMap, AddressProviderV310Contract, AddressSet, AssetsMap, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, BasePlugin, BigIntMath, BotPermissions, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainContractsRegister, ChainNotConfiguredError, CompositePriceFeedContract, ConstantPriceFeedContract, Construct, ContractParseError, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountOperationsService, CreditAccountState, CreditAccountsServiceV310, CreditConfiguratorV310Contract, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DUST_THRESHOLD, DaiUsdsAdapterContract, ERC4626AdapterContract, ERC4626ReferralAdapterContract, EXECUTE_BYTES_SELECTOR, Erc4626PriceFeedContract, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, IERC20ZapperContract, IETHZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LidoV1AdapterContract, LinearInterestRateModelContract, LiquidationsService, MAX_INT, MAX_LEVERAGE_BUFFER_BPS, MAX_UINT16, MAX_UINT256, MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_INT96, MIN_SAFE_HEALTH_FACTOR_FORM, MULTICALL_ADDRESS, MarketRegister, MarketSuite, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, MissingSerializedParamsError, MultichainConstruct, MultichainLiquidationsService, MultichainOpportunitiesService, MultichainPositionsService, MultichainSDK, NATIVE_ADDRESS, NON_STRATEGY_PHANTOM_TOKEN_TYPES, NOT_DEPLOYED, NO_VERSION, NetworkType, OnchainSDK, OpportunitiesService, PARTIAL_LIQUIDATION_BUFFER_BPS, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PERCENTAGE_FACTOR_1KK, PERIPHERY_CONTRACTS, PHANTOM_TOKEN_CONTRACT_TYPES, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PRICE_DECIMALS, PRICE_DECIMALS_POW, PartialPriceFeedInitError, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PeripheryCompressorV310Contract, PluginStateVersionError, PoolService, PoolSuite, PoolV310Contract, PositionsService, PriceFeedRef, PriceFeedRegistry, PriceOracleV310Contract, PriceUpdatesCache, PythPriceFeed, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWARegistry, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RedemptionLoggerV310Contract, RedstoneOptions, RedstonePriceFeedContract, RedstoneUpdater, RouterV310Contract, SDKConstruct, SECONDS_PER_YEAR, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkRWADataNotLoadedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeDegenNFT, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRedemptionGatewayAdapterContract, SimulateWithPriceUpdatesError, SimulationError, StakingRewardsAdapterContract, TokensMeta, TraderJoePoolVersion, TraderJoeRouterAdapterContract, TypedObjectUtils, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, UpshiftVaultAdapterContract, VERSION_RANGE_310, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, ZapperContract, ZeroPriceFeedContract, ZodAddress, ZodBigInt, ZodHex, accountSnapshotFromCreditAccountData, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, amountOf, assetsMap, attachOptionsSchema, botPermissionsToString, bpsToRay, buildDelayedStrategyPositionOperationPreview, bytes32ToString, calcBorrowApy, calcBorrowRate, calcDefaultQuota, calcEffectiveBorrowApy, calcHealthFactor, calcLiquidationPrice, calcLiquidationPriceForTarget, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcQuotaUpdate, calcRecommendedQuota, calcTimeToLiquidationMs, calcUtilization, calcUtilizationRaw, chains, checkAccountQuotas, checkBorrowLimit, checkCollateralFunding, checkCollateralised, checkCreditAccountFrozen, checkCreditManagerPaused, checkCreditOperation, checkDebtLimits, checkEmergencyLiquidator, checkForbiddenToken, checkHealthFactors, checkIncreaseDebt, checkIncreaseQuota, checkLeverage, checkLiquidation, checkLiquidationEligibility, checkLiquidationFunding, checkLiquidatorEligible, checkMarket, checkMarketExpired, checkMidasAccountGreenlist, checkObtained, checkOperation, checkPoolFunding, checkPoolLiquidity, checkPoolOperation, checkPoolPaused, checkPoolSunset, checkQuotaCount, checkQuotaLimit, checkRWAOpenRequirements, checkRWAOpening, checkReservePriceLimited, checkSimulation, checkWallet, checkWalletAllowance, checkWalletBalance, childLogger, classifyCloseOrRepay, classifyCurveOperation, classifyInnerOperations, collateralPriceInUnderlying, collectTraces, createAdapter, createAddressProvider, createPriceOracle, createRawTx, createRedemptionLogger, createRouter, createWithdrawalCompressor, createZapper, abi as creditFacadeV310Abi, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, decodeDelayedIntent, detectDelayedClaim, detectDelayedOperation, detectNetwork, dominantCollateral, encodeDelayedIntent, erc4626ReferralAdapterAbi, estimateClaimableAt, estimateRawTxGas, etherscanApiUrl, etherscanUrl, executeDelegatedMulticalls, executeMulticallBatches, expectedBalanceDeltas, fetchCreditAccountSlice, fetchRedstonePayloads, filterDust, filterDustUSD, findCallTo, findCallWithInput, findCuratorMarketConfigurator, findExecuteBytes, fmtBinaryMask, fnSigToName, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAccountTargetCollateral, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getAssetType, getCastTraceArgs, getChain, getCuratorName, getFunctionSignature, getLegacyStrategyTarget, getNetworkType, getRawPriceUpdates, getSimulateWithPriceUpdatesError, getWithdrawalCompressorAddress, halfRAY, hasAdapterDeployParamsAbi, healthFactorBps, hexEq, hydrateAddressProvider, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCreditAccountAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isCloseOrRepay, isDust, isLPPriceFeed, isPhantomToken, isPoolOperation, isPublicNetwork, isRWAFactory, isRWAOperation, isRWAToken, isStrategyCollateral, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, isZeroBalance, iwstETHAbi, iwstEthv1AdapterAbi, json_parse, json_stringify, lidoV1_WETHGatewayAbi, makeReplayState, mellowDvvAdapterAbi, midasGreenlistsAccount, minSeizedAmount, numberWithCommas, onchainSDKOptionsSchema, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parseFacadeOperationCalldata, parseOperationCalldata, parsePoolOperationCalldata, parsePosNegAmount, parseRWAFactoryOperationCalldata, percentFmt, pickStrategyTargetCollateral, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, raise, rayToBps, rayToNumber, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent, resolveProtocolCall, retry, rewardsFromTransfers, roundUpQuota, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, soleNonUnderlyingCollateral, strategyName, swapFromTransfers, toAddress, toBN, toBigInt, toChainIds, toClaimableWithdrawal, toCreditAccountSlice, toNetTransfers, toPendingWithdrawal, toRequestableWithdrawal, toSignificant, toToken, toTokenAmount, toWithdrawalStatus, updatableDependencies, usdToNumber, watchBlocksAsync };
|
|
307
|
+
export { ADDRESS_0X0, ADDRESS_PROVIDER_V310, AP_ACCOUNT_FACTORY, AP_ACL, AP_BOT_LIST, AP_BYTECODE_REPOSITORY, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_CREDIT_SUITE_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GAUGE_COMPRESSOR, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_PARTIAL_LIQUIDATION_BOT, AP_PERIPHERY_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_FEED_STORE, AP_PRICE_ORACLE, AP_REDEMPTION_LOGGER, AP_REWARDS_COMPRESSOR, AP_ROUTER, AP_TOKEN_COMPRESSOR, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractAdapterContract, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountBotsService, AccountMigratorAdapterContract, AdapterType, AddressMap, AddressProviderV310Contract, AddressSet, AssetsMap, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, BasePlugin, BigIntMath, BotPermissions, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainContractsRegister, ChainNotConfiguredError, CompositePriceFeedContract, ConstantPriceFeedContract, Construct, ContractParseError, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountOperationsService, CreditAccountState, CreditAccountsServiceV310, CreditConfiguratorV310Contract, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DUST_THRESHOLD, DaiUsdsAdapterContract, ERC4626AdapterContract, ERC4626ReferralAdapterContract, EXECUTE_BYTES_SELECTOR, Erc4626PriceFeedContract, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, IERC20ZapperContract, IETHZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LidoV1AdapterContract, LinearInterestRateModelContract, LiquidationsService, MAX_INT, MAX_LEVERAGE_BUFFER_BPS, MAX_UINT16, MAX_UINT256, MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_INT96, MIN_SAFE_HEALTH_FACTOR_FORM, MULTICALL_ADDRESS, MarketRegister, MarketSuite, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, MissingSerializedParamsError, MultichainConstruct, MultichainLiquidationsService, MultichainOpportunitiesService, MultichainPositionsService, MultichainSDK, NATIVE_ADDRESS, NON_STRATEGY_PHANTOM_TOKEN_TYPES, NOT_DEPLOYED, NO_VERSION, NetworkType, OnchainSDK, OpportunitiesService, PARTIAL_LIQUIDATION_BUFFER_BPS, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PERCENTAGE_FACTOR_1KK, PERIPHERY_CONTRACTS, PHANTOM_TOKEN_CONTRACT_TYPES, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PRICE_DECIMALS, PRICE_DECIMALS_POW, PartialPriceFeedInitError, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PeripheryCompressorV310Contract, PluginStateVersionError, PoolService, PoolSuite, PoolV310Contract, PositionsService, PriceFeedRef, PriceFeedRegistry, PriceOracleV310Contract, PriceUpdatesCache, PythPriceFeed, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWARegistry, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RedemptionLoggerV310Contract, RedstonePriceFeedContract, RouterV310Contract, SDKConstruct, SECONDS_PER_YEAR, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkRWADataNotLoadedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeDegenNFT, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRedemptionGatewayAdapterContract, SimulateWithPriceUpdatesError, SimulationError, StakingRewardsAdapterContract, TokensMeta, TraderJoePoolVersion, TraderJoeRouterAdapterContract, TypedObjectUtils, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, UpshiftVaultAdapterContract, VERSION_RANGE_310, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, ZapperContract, ZeroPriceFeedContract, ZodAddress, ZodBigInt, ZodHex, accountSnapshotFromCreditAccountData, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, amountOf, assetsMap, attachOptionsSchema, botPermissionsToString, bpsToRay, buildDelayedStrategyPositionOperationPreview, bytes32ToString, calcBorrowApy, calcBorrowRate, calcDefaultQuota, calcEffectiveBorrowApy, calcHealthFactor, calcLiquidationPrice, calcLiquidationPriceForTarget, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcQuotaUpdate, calcRecommendedQuota, calcTimeToLiquidationMs, calcUtilization, calcUtilizationRaw, chains, checkAccountQuotas, checkBorrowLimit, checkCollateralFunding, checkCollateralised, checkCreditAccountFrozen, checkCreditManagerPaused, checkCreditOperation, checkDebtLimits, checkEmergencyLiquidator, checkForbiddenToken, checkHealthFactors, checkIncreaseDebt, checkIncreaseQuota, checkLeverage, checkLiquidation, checkLiquidationEligibility, checkLiquidationFunding, checkLiquidatorEligible, checkMarket, checkMarketExpired, checkMidasAccountGreenlist, checkObtained, checkOperation, checkPoolFunding, checkPoolLiquidity, checkPoolOperation, checkPoolPaused, checkPoolSunset, checkQuotaCount, checkQuotaLimit, checkRWAOpenRequirements, checkRWAOpening, checkReservePriceLimited, checkSimulation, checkWallet, checkWalletAllowance, checkWalletBalance, childLogger, classifyCloseOrRepay, classifyCurveOperation, classifyInnerOperations, collateralPriceInUnderlying, collectTraces, createAdapter, createAddressProvider, createPriceOracle, createRawTx, createRedemptionLogger, createRouter, createWithdrawalCompressor, createZapper, abi as creditFacadeV310Abi, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, decodeDelayedIntent, detectDelayedClaim, detectDelayedOperation, detectNetwork, dominantCollateral, encodeDelayedIntent, erc4626ReferralAdapterAbi, estimateClaimableAt, estimateRawTxGas, etherscanApiUrl, etherscanUrl, executeDelegatedMulticalls, executeMulticallBatches, expectedBalanceDeltas, fetchCreditAccountSlice, filterDust, filterDustUSD, findCallTo, findCallWithInput, findCuratorMarketConfigurator, findExecuteBytes, fmtBinaryMask, fnSigToName, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAccountTargetCollateral, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getAssetType, getCastTraceArgs, getChain, getCuratorName, getFunctionSignature, getLegacyStrategyTarget, getNetworkType, getRawPriceUpdates, getSimulateWithPriceUpdatesError, getWithdrawalCompressorAddress, halfRAY, hasAdapterDeployParamsAbi, healthFactorBps, hexEq, hydrateAddressProvider, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCreditAccountAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isCloseOrRepay, isDust, isLPPriceFeed, isPhantomToken, isPoolOperation, isPublicNetwork, isRWAFactory, isRWAOperation, isRWAToken, isStrategyCollateral, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, isZeroBalance, iwstETHAbi, iwstEthv1AdapterAbi, json_parse, json_stringify, lidoV1_WETHGatewayAbi, makeReplayState, mellowDvvAdapterAbi, midasGreenlistsAccount, minSeizedAmount, numberWithCommas, onchainSDKOptionsSchema, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parseFacadeOperationCalldata, parseOperationCalldata, parsePoolOperationCalldata, parsePosNegAmount, parseRWAFactoryOperationCalldata, percentFmt, pickStrategyTargetCollateral, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, raise, rayToBps, rayToNumber, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent, resolveProtocolCall, retry, rewardsFromTransfers, roundUpQuota, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, soleNonUnderlyingCollateral, strategyName, swapFromTransfers, toAddress, toBN, toBigInt, toChainIds, toClaimableWithdrawal, toCreditAccountSlice, toNetTransfers, toPendingWithdrawal, toRequestableWithdrawal, toSignificant, toToken, toTokenAmount, toWithdrawalStatus, updatableDependencies, usdToNumber, watchBlocksAsync };
|
|
@@ -396,7 +396,7 @@ var CreditSuite = class extends SDKConstruct {
|
|
|
396
396
|
curator: market.curator,
|
|
397
397
|
underlyingToken: this.underlyingToken,
|
|
398
398
|
totalBorrowed: oracle.toAmount(pool.underlying, borrowed),
|
|
399
|
-
allowedDepositTokens: this
|
|
399
|
+
allowedDepositTokens: this.allowedDepositTokens(collateral),
|
|
400
400
|
paused: this.isPaused,
|
|
401
401
|
rwa: market.rwa,
|
|
402
402
|
sunset: market.sunset || isSunsetStrategy(cm.address, this.sdk.networkType),
|
|
@@ -470,17 +470,18 @@ var CreditSuite = class extends SDKConstruct {
|
|
|
470
470
|
*
|
|
471
471
|
* 1. unwrapped underlying (USDC, never dcUSDC)
|
|
472
472
|
* 2. target collateral
|
|
473
|
-
* 3. remaining CM collaterals in manager order,
|
|
473
|
+
* 3. remaining CM collaterals in manager order, excluding phantom tokens
|
|
474
|
+
* and tokens without price
|
|
474
475
|
*/
|
|
475
|
-
|
|
476
|
+
allowedDepositTokens(targetCollateral) {
|
|
476
477
|
const unwrappedUnderlying = this.market.unwrappedUnderlying;
|
|
477
|
-
const
|
|
478
|
+
const { mainPrices, reservePrices } = this.market.priceOracle;
|
|
478
479
|
return [
|
|
479
480
|
unwrappedUnderlying,
|
|
480
481
|
targetCollateral,
|
|
481
482
|
...this.creditManager.collateralTokens.filter((token) => {
|
|
482
483
|
const contractType = this.tokensMeta.mustGet(token).contractType;
|
|
483
|
-
return !
|
|
484
|
+
return !this.market.isUnderlyingLike(token) && !isAddressEqual(token, targetCollateral) && !contractType?.startsWith("PHANTOM_TOKEN::") && (!!mainPrices.get(token)?.price || !!reservePrices.get(token)?.price);
|
|
484
485
|
})
|
|
485
486
|
].map((token) => this.tokensMeta.mustGetToken(token));
|
|
486
487
|
}
|
|
@@ -119,11 +119,9 @@ import { WstETHPriceFeedContract } from "./pricefeeds/feeds/WstETHPriceFeed.js";
|
|
|
119
119
|
import { YearnPriceFeedContract } from "./pricefeeds/feeds/YearnPriceFeed.js";
|
|
120
120
|
import { ZeroPriceFeedContract } from "./pricefeeds/feeds/ZeroPriceFeed.js";
|
|
121
121
|
import { PriceFeedRegistry } from "./pricefeeds/PriceFeedRegistry.js";
|
|
122
|
-
import { fetchRedstonePayloads } from "./pricefeeds/updates/fetchRedstonePayloads.js";
|
|
123
122
|
import { getRawPriceUpdates } from "./pricefeeds/updates/getRawPriceUpdates.js";
|
|
124
123
|
import { isUpdatablePriceFeed } from "./pricefeeds/updates/isUpdatablePriceFeed.js";
|
|
125
124
|
import { PriceUpdatesCache } from "./pricefeeds/updates/PriceUpdatesCache.js";
|
|
126
|
-
import { RedstoneOptions, RedstoneUpdater } from "./pricefeeds/updates/RedstoneUpdater.js";
|
|
127
125
|
import { updatableDependencies } from "./pricefeeds/updates/updatableDependencies.js";
|
|
128
126
|
import { UpdatablePriceFeedRegistry } from "./pricefeeds/updates/UpdatablePriceFeedRegistry.js";
|
|
129
127
|
import "./pricefeeds/index.js";
|
|
@@ -150,4 +148,4 @@ import { RWARegistry, RWA_COMPRESSOR_ADDRESS } from "./rwa/RWARegistry.js";
|
|
|
150
148
|
import { isRWAFactory } from "./rwa/types.js";
|
|
151
149
|
import "./rwa/index.js";
|
|
152
150
|
import "./types.js";
|
|
153
|
-
export { AbstractAdapterContract, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterType, BalancerStablePriceFeedContract, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CamelotV3AdapterContract, CompositePriceFeedContract, ConstantPriceFeedContract, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditConfiguratorV310Contract, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DaiUsdsAdapterContract, ERC4626AdapterContract, ERC4626ReferralAdapterContract, Erc4626PriceFeedContract, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, IERC20ZapperContract, IETHZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LidoV1AdapterContract, LinearInterestRateModelContract, MAX_LEVERAGE_BUFFER_BPS, MarketRegister, MarketSuite, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PartialPriceFeedInitError, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolSuite, PoolV310Contract, PriceFeedRef, PriceFeedRegistry, PriceOracleV310Contract, PriceUpdatesCache, PythPriceFeed, RWARegistry, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE,
|
|
151
|
+
export { AbstractAdapterContract, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterType, BalancerStablePriceFeedContract, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CamelotV3AdapterContract, CompositePriceFeedContract, ConstantPriceFeedContract, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditConfiguratorV310Contract, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DaiUsdsAdapterContract, ERC4626AdapterContract, ERC4626ReferralAdapterContract, Erc4626PriceFeedContract, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, IERC20ZapperContract, IETHZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LidoV1AdapterContract, LinearInterestRateModelContract, MAX_LEVERAGE_BUFFER_BPS, MarketRegister, MarketSuite, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PartialPriceFeedInitError, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolSuite, PoolV310Contract, PriceFeedRef, PriceFeedRegistry, PriceOracleV310Contract, PriceUpdatesCache, PythPriceFeed, RWARegistry, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RedstonePriceFeedContract, SecuritizeDegenNFT, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, TraderJoePoolVersion, TraderJoeRouterAdapterContract, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, UpshiftVaultAdapterContract, VelodromeV2RouterAdapterContract, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, ZapperContract, ZeroPriceFeedContract, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, classifyCurveOperation, collateralPriceInUnderlying, createAdapter, createPriceOracle, createZapper, abi as creditFacadeV310Abi, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, dominantCollateral, erc4626ReferralAdapterAbi, expectedBalanceDeltas, fnSigToName, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getRawPriceUpdates, hasAdapterDeployParamsAbi, healthFactorBps, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isLPPriceFeed, isRWAFactory, isStrategyCollateral, isUpdatablePriceFeed, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, minSeizedAmount, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, pickStrategyTargetCollateral, rayToBps, rewardsFromTransfers, strategyName, swapFromTransfers, toNetTransfers, updatableDependencies, usdToNumber };
|
|
@@ -16,6 +16,7 @@ var RedstonePriceFeedContract = class extends AbstractPriceFeedContract {
|
|
|
16
16
|
constructor(options, args) {
|
|
17
17
|
super(options, {
|
|
18
18
|
...args,
|
|
19
|
+
updatable: false,
|
|
19
20
|
name: "RedstonePriceFeed",
|
|
20
21
|
abi: redstonePriceFeedAbi
|
|
21
22
|
});
|
|
@@ -69,13 +70,6 @@ var RedstonePriceFeedContract = class extends AbstractPriceFeedContract {
|
|
|
69
70
|
lastPayloadTimestamp: this.lastPayloadTimestamp.toString()
|
|
70
71
|
};
|
|
71
72
|
}
|
|
72
|
-
createPriceUpdateTx(data) {
|
|
73
|
-
return this.createRawTx({
|
|
74
|
-
functionName: "updatePrice",
|
|
75
|
-
args: [data],
|
|
76
|
-
description: `updating redstone price for ${this.dataId} [${this.labelAddress(this.address)}]`
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
73
|
};
|
|
80
74
|
//#endregion
|
|
81
75
|
export { RedstonePriceFeedContract };
|
|
@@ -21,12 +21,10 @@ import { ZeroPriceFeedContract } from "./feeds/ZeroPriceFeed.js";
|
|
|
21
21
|
import "./feeds/index.js";
|
|
22
22
|
import { PriceFeedRegistry } from "./PriceFeedRegistry.js";
|
|
23
23
|
import "./types.js";
|
|
24
|
-
import { fetchRedstonePayloads } from "./updates/fetchRedstonePayloads.js";
|
|
25
24
|
import { getRawPriceUpdates } from "./updates/getRawPriceUpdates.js";
|
|
26
25
|
import { isUpdatablePriceFeed } from "./updates/isUpdatablePriceFeed.js";
|
|
27
26
|
import { PriceUpdatesCache } from "./updates/PriceUpdatesCache.js";
|
|
28
|
-
import { RedstoneOptions, RedstoneUpdater } from "./updates/RedstoneUpdater.js";
|
|
29
27
|
import { updatableDependencies } from "./updates/updatableDependencies.js";
|
|
30
28
|
import { UpdatablePriceFeedRegistry } from "./updates/UpdatablePriceFeedRegistry.js";
|
|
31
29
|
import "./updates/index.js";
|
|
32
|
-
export { AbstractLPPriceFeedContract, AbstractPriceFeedContract, BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CompositePriceFeedContract, ConstantPriceFeedContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, Erc4626PriceFeedContract, ExternalPriceFeedContract, MellowLRTPriceFeedContract, PartialPriceFeedInitError, PendleTWAPPTPriceFeed, PriceFeedRef, PriceFeedRegistry, PriceUpdatesCache, PythPriceFeed,
|
|
30
|
+
export { AbstractLPPriceFeedContract, AbstractPriceFeedContract, BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CompositePriceFeedContract, ConstantPriceFeedContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, Erc4626PriceFeedContract, ExternalPriceFeedContract, MellowLRTPriceFeedContract, PartialPriceFeedInitError, PendleTWAPPTPriceFeed, PriceFeedRef, PriceFeedRegistry, PriceUpdatesCache, PythPriceFeed, RedstonePriceFeedContract, UpdatablePriceFeedRegistry, WstETHPriceFeedContract, YearnPriceFeedContract, ZeroPriceFeedContract, getRawPriceUpdates, isLPPriceFeed, isUpdatablePriceFeed, updatableDependencies };
|
|
@@ -8,23 +8,22 @@ import { priceFeedCompressorAbi } from "../../../../abi/compressors/priceFeedCom
|
|
|
8
8
|
import { PriceFeedRegistry } from "../PriceFeedRegistry.js";
|
|
9
9
|
import { getRawPriceUpdates } from "./getRawPriceUpdates.js";
|
|
10
10
|
import { isUpdatablePriceFeed } from "./isUpdatablePriceFeed.js";
|
|
11
|
-
import { RedstoneUpdater } from "./RedstoneUpdater.js";
|
|
12
11
|
import { Hooks } from "../../../utils/internal/Hooks.js";
|
|
13
12
|
import "../../../utils/internal/index.js";
|
|
14
13
|
import { updatableDependencies } from "./updatableDependencies.js";
|
|
15
14
|
import { parseAbi } from "viem";
|
|
16
15
|
//#region src/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.ts
|
|
17
16
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* @deprecated Support for updatable price feeds is deprecated.
|
|
18
|
+
* {@link PriceFeedRegistry} that also orchestrates off-chain price updates.
|
|
20
19
|
**/
|
|
21
20
|
var UpdatablePriceFeedRegistry = class extends PriceFeedRegistry {
|
|
22
21
|
#hooks = new Hooks();
|
|
23
22
|
#updaters;
|
|
24
23
|
#latestUpdate;
|
|
25
|
-
constructor(sdk
|
|
24
|
+
constructor(sdk) {
|
|
26
25
|
super(sdk);
|
|
27
|
-
this.#updaters = [
|
|
26
|
+
this.#updaters = [];
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
30
29
|
* @internal
|
|
@@ -121,6 +120,7 @@ var UpdatablePriceFeedRegistry = class extends PriceFeedRegistry {
|
|
|
121
120
|
* Discovered price feeds are not saved anywhere in PriceFeedRegistry, and can later be used to load price feed updates
|
|
122
121
|
*/
|
|
123
122
|
async getPartialUpdatablePriceFeeds(configurators) {
|
|
123
|
+
if (this.#updaters.length === 0) return [];
|
|
124
124
|
const [priceFeedCompressorAddress] = this.sdk.addressProvider.mustGetLatest(AP_PRICE_FEED_COMPRESSOR, VERSION_RANGE_310);
|
|
125
125
|
this.logger?.debug({ configurators }, `calling getUpdatablePriceFeeds in block ${this.sdk.currentBlock}`);
|
|
126
126
|
const result = await this.client.readContract({
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { fetchRedstonePayloads } from "./fetchRedstonePayloads.js";
|
|
2
1
|
import { getRawPriceUpdates } from "./getRawPriceUpdates.js";
|
|
3
2
|
import { isUpdatablePriceFeed } from "./isUpdatablePriceFeed.js";
|
|
4
3
|
import { PriceUpdatesCache } from "./PriceUpdatesCache.js";
|
|
5
|
-
import { RedstoneOptions, RedstoneUpdater } from "./RedstoneUpdater.js";
|
|
6
4
|
import { updatableDependencies } from "./updatableDependencies.js";
|
|
7
5
|
import { UpdatablePriceFeedRegistry } from "./UpdatablePriceFeedRegistry.js";
|
|
8
|
-
export { PriceUpdatesCache,
|
|
6
|
+
export { PriceUpdatesCache, UpdatablePriceFeedRegistry, getRawPriceUpdates, isUpdatablePriceFeed, updatableDependencies };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ZodAddress } from "./utils/zod.js";
|
|
2
2
|
import "./utils/index.js";
|
|
3
|
-
import { RedstoneOptions } from "./market/pricefeeds/updates/RedstoneUpdater.js";
|
|
4
|
-
import "./market/pricefeeds/updates/index.js";
|
|
5
3
|
import { z } from "zod/v4";
|
|
6
4
|
//#region src/onchain/options.ts
|
|
7
5
|
/**
|
|
@@ -56,11 +54,7 @@ const attachOptionsSchema = z.object({
|
|
|
56
54
|
/**
|
|
57
55
|
* Pool addresses whose markets should be skipped.
|
|
58
56
|
**/
|
|
59
|
-
ignoreMarkets: z.array(ZodAddress()).optional()
|
|
60
|
-
/**
|
|
61
|
-
* Options for Redstone price-feed updates.
|
|
62
|
-
**/
|
|
63
|
-
redstone: RedstoneOptions.optional()
|
|
57
|
+
ignoreMarkets: z.array(ZodAddress()).optional()
|
|
64
58
|
});
|
|
65
59
|
//#endregion
|
|
66
60
|
export { attachOptionsSchema, onchainSDKOptionsSchema };
|
|
@@ -28,9 +28,8 @@ import { encodeFunctionParams } from "./utils/abi-encoder.js";
|
|
|
28
28
|
import { getBlockNumberByTimestamp } from "./utils/block-utils.js";
|
|
29
29
|
import { calculateChecksum, convertRawTxToSafeMultisigTx, getSafeBatch, getSafeBatches } from "./utils/governance/batch.js";
|
|
30
30
|
import { convertQueueBatchToExecuteTx } from "./utils/governance/timelock-txs.js";
|
|
31
|
-
import { getUpdatablePriceFeeds } from "./utils/price-update/get-updatable-feeds.js";
|
|
32
|
-
import { getCallTouchedPriceFeeds, getCallsTouchedPriceFeeds, getCallsTouchedUpdatablePriceFeeds } from "./utils/price-update/get-price-feeds.js";
|
|
33
31
|
import { getPriceUpdateTx } from "./utils/price-update/get-price-update-tx.js";
|
|
34
32
|
import { getPrices } from "./utils/price-update/get-prices.js";
|
|
33
|
+
import { getUpdatablePriceFeeds } from "./utils/price-update/get-updatable-feeds.js";
|
|
35
34
|
import "./utils/index.js";
|
|
36
|
-
export { AccessMode, AddressProviderContract, Addresses, ArchiveTransport, BYTECODE_REPOSITORY, BytecodeRepositoryContract, CROSS_CHAIN_GOVERNANCE, CROSS_CHAIN_MULTISIG, CrossChainMultisigContract, GovernorContract, INSTANCE_MANAGER, InstanceManagerContract, MAINNET_CCM_CONSTRUCTOR_PARAMS, MAINNET_DEPLOYMENT_BLOCK, MAINNET_DEPLOYMENT_CCM_SALT, MAINNET_DEPLOYMENT_IM_SALT, MARKET_CONFIGURATOR_FACTORY, MarketConfiguratorContract, MarketConfiguratorFactoryContract, PRICE_FEED_STORE, PUBLIC_CREATE2_FACTORY, PriceFeedStoreContract, RoutingManagerContract, TOKEN_COMPRESSOR, TimeLockContract, TokenCompressorContract, TreasurySplitterContract, WithdrawalCompressorContract, calculateChecksum, checkCreate2Deployment, checkCreate2DeploymentAddress, chunkedLogsTransport, convertPercent, convertQueueBatchToExecuteTx, convertRawTxToSafeMultisigTx, createCallData, createCreate2DeployRawTx, deepJsonParse, deployUsingPublicCreate2, encodeFunctionParams, formatBytecodeSize, formatBytecodeVersion, getBlockNumberByTimestamp,
|
|
35
|
+
export { AccessMode, AddressProviderContract, Addresses, ArchiveTransport, BYTECODE_REPOSITORY, BytecodeRepositoryContract, CROSS_CHAIN_GOVERNANCE, CROSS_CHAIN_MULTISIG, CrossChainMultisigContract, GovernorContract, INSTANCE_MANAGER, InstanceManagerContract, MAINNET_CCM_CONSTRUCTOR_PARAMS, MAINNET_DEPLOYMENT_BLOCK, MAINNET_DEPLOYMENT_CCM_SALT, MAINNET_DEPLOYMENT_IM_SALT, MARKET_CONFIGURATOR_FACTORY, MarketConfiguratorContract, MarketConfiguratorFactoryContract, PRICE_FEED_STORE, PUBLIC_CREATE2_FACTORY, PriceFeedStoreContract, RoutingManagerContract, TOKEN_COMPRESSOR, TimeLockContract, TokenCompressorContract, TreasurySplitterContract, WithdrawalCompressorContract, calculateChecksum, checkCreate2Deployment, checkCreate2DeploymentAddress, chunkedLogsTransport, convertPercent, convertQueueBatchToExecuteTx, convertRawTxToSafeMultisigTx, createCallData, createCreate2DeployRawTx, deepJsonParse, deployUsingPublicCreate2, encodeFunctionParams, formatBytecodeSize, formatBytecodeVersion, getBlockNumberByTimestamp, getCreate2AddressPublicFactory, getCreate2DeploymentAddress, getPriceUpdateTx, getPrices, getSafeBatch, getSafeBatches, getUpdatablePriceFeeds, handleSalt, normalizeSignature, priceFeedSetupParams, shortenHash, significantTrunc };
|
|
@@ -7,9 +7,8 @@ import { getBlockNumberByTimestamp } from "./block-utils.js";
|
|
|
7
7
|
import { calculateChecksum, convertRawTxToSafeMultisigTx, getSafeBatch, getSafeBatches } from "./governance/batch.js";
|
|
8
8
|
import { convertQueueBatchToExecuteTx } from "./governance/timelock-txs.js";
|
|
9
9
|
import "./governance/index.js";
|
|
10
|
-
import { getUpdatablePriceFeeds } from "./price-update/get-updatable-feeds.js";
|
|
11
|
-
import { getCallTouchedPriceFeeds, getCallsTouchedPriceFeeds, getCallsTouchedUpdatablePriceFeeds } from "./price-update/get-price-feeds.js";
|
|
12
10
|
import { getPriceUpdateTx } from "./price-update/get-price-update-tx.js";
|
|
13
11
|
import { getPrices } from "./price-update/get-prices.js";
|
|
12
|
+
import { getUpdatablePriceFeeds } from "./price-update/get-updatable-feeds.js";
|
|
14
13
|
import "./price-update/index.js";
|
|
15
|
-
export { BYTECODE_REPOSITORY, CROSS_CHAIN_GOVERNANCE, CROSS_CHAIN_MULTISIG, INSTANCE_MANAGER, MARKET_CONFIGURATOR_FACTORY, PRICE_FEED_STORE, PUBLIC_CREATE2_FACTORY, TOKEN_COMPRESSOR, calculateChecksum, checkCreate2Deployment, checkCreate2DeploymentAddress, convertPercent, convertQueueBatchToExecuteTx, convertRawTxToSafeMultisigTx, createCreate2DeployRawTx, deepJsonParse, deployUsingPublicCreate2, encodeFunctionParams, formatBytecodeSize, formatBytecodeVersion, getBlockNumberByTimestamp,
|
|
14
|
+
export { BYTECODE_REPOSITORY, CROSS_CHAIN_GOVERNANCE, CROSS_CHAIN_MULTISIG, INSTANCE_MANAGER, MARKET_CONFIGURATOR_FACTORY, PRICE_FEED_STORE, PUBLIC_CREATE2_FACTORY, TOKEN_COMPRESSOR, calculateChecksum, checkCreate2Deployment, checkCreate2DeploymentAddress, convertPercent, convertQueueBatchToExecuteTx, convertRawTxToSafeMultisigTx, createCreate2DeployRawTx, deepJsonParse, deployUsingPublicCreate2, encodeFunctionParams, formatBytecodeSize, formatBytecodeVersion, getBlockNumberByTimestamp, getCreate2AddressPublicFactory, getCreate2DeploymentAddress, getPriceUpdateTx, getPrices, getSafeBatch, getSafeBatches, getUpdatablePriceFeeds, handleSalt, normalizeSignature, shortenHash, significantTrunc };
|
|
@@ -7,6 +7,11 @@ import { PriceFeedStoreContract } from "../../bindings/price-feed-store.js";
|
|
|
7
7
|
import "../../bindings/index.js";
|
|
8
8
|
import { multicall3Abi } from "viem";
|
|
9
9
|
//#region src/permissionless/utils/price-update/get-price-update-tx.ts
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Support for updatable price feeds is deprecated.
|
|
12
|
+
* @param param0
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
10
15
|
async function getPriceUpdateTx({ client, priceFeeds, useMulticall3 = false, gasLimit }) {
|
|
11
16
|
const pfStore = new PriceFeedStoreContract("0x74A868AC479EE145029bB80827BB77F7B7c441cB", client);
|
|
12
17
|
const gearboxClient = client;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { bytes32ToString } from "../../../onchain/utils/bytes32ToString.js";
|
|
2
1
|
import { priceFeedCompressorAbi } from "../../../abi/compressors/priceFeedCompressor.js";
|
|
3
|
-
import { RedstonePriceFeedContract } from "../../../onchain/market/pricefeeds/feeds/RedstonePriceFeed.js";
|
|
4
|
-
import "../../../onchain/index.js";
|
|
5
2
|
import { getContract } from "viem";
|
|
6
3
|
//#region src/permissionless/utils/price-update/get-updatable-feeds.ts
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Support for updatable price feeds is deprecated.
|
|
6
|
+
* @param args
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
7
9
|
async function getUpdatablePriceFeeds(args) {
|
|
8
10
|
const { sdk, client, pfCompressor, priceFeeds } = args;
|
|
9
11
|
return (await getContract({
|
|
10
12
|
address: pfCompressor,
|
|
11
13
|
abi: priceFeedCompressorAbi,
|
|
12
14
|
client
|
|
13
|
-
}).read.loadPriceFeedTree([priceFeeds])).filter((data) =>
|
|
15
|
+
}).read.loadPriceFeedTree([priceFeeds])).filter((data) => data.updatable).map((data) => sdk.priceFeeds.create(data));
|
|
14
16
|
}
|
|
15
17
|
//#endregion
|
|
16
18
|
export { getUpdatablePriceFeeds };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { getUpdatablePriceFeeds } from "./get-updatable-feeds.js";
|
|
2
|
-
import { getCallTouchedPriceFeeds, getCallsTouchedPriceFeeds, getCallsTouchedUpdatablePriceFeeds } from "./get-price-feeds.js";
|
|
3
1
|
import { getPriceUpdateTx } from "./get-price-update-tx.js";
|
|
4
2
|
import { getPrices } from "./get-prices.js";
|
|
5
|
-
|
|
3
|
+
import { getUpdatablePriceFeeds } from "./get-updatable-feeds.js";
|
|
4
|
+
export { getPriceUpdateTx, getPrices, getUpdatablePriceFeeds };
|