@gearbox-protocol/sdk 17.2.0 → 17.3.0
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/accounts/intents/leverage-band.js +1 -1
- package/dist/cjs/onchain/accounts/intents/maxBorrow.js +15 -11
- package/dist/cjs/onchain/accounts/intents/testing/sdk-mock.js +5 -2
- package/dist/cjs/onchain/chain/chains.js +1 -2
- package/dist/cjs/onchain/index.js +2 -0
- package/dist/cjs/onchain/market/MarketSuite.js +11 -4
- package/dist/cjs/onchain/market/credit/CreditSuite.js +25 -138
- package/dist/cjs/onchain/market/credit/CreditSuiteStrategy.js +179 -0
- package/dist/cjs/onchain/market/credit/index.js +2 -0
- package/dist/cjs/onchain/market/index.js +2 -0
- package/dist/cjs/onchain/market/pool/PoolQuotaKeeperV310Contract.js +4 -1
- package/dist/cjs/onchain/opportunities/OpportunitiesService.js +7 -9
- package/dist/cjs/rewards/{multichain.js → RewardsService.js} +18 -30
- package/dist/cjs/rewards/errors.js +4 -4
- package/dist/cjs/rewards/helpers.js +88 -0
- package/dist/cjs/rewards/index.js +2 -2
- package/dist/cjs/rewards/merkl-api.js +14 -25
- package/dist/cjs/rewards/toMerklRewards.js +21 -77
- package/dist/cjs/rewards/toTurtleRewards.js +46 -62
- package/dist/cjs/rewards/turtle-api.js +17 -0
- package/dist/cjs/rewards/types.js +1 -0
- package/dist/cjs/sdk/prepare/PrepareApi.js +1 -1
- package/dist/esm/onchain/accounts/intents/leverage-band.js +1 -1
- package/dist/esm/onchain/accounts/intents/maxBorrow.js +15 -11
- package/dist/esm/onchain/accounts/intents/testing/sdk-mock.js +5 -2
- package/dist/esm/onchain/chain/chains.js +1 -2
- package/dist/esm/onchain/index.js +2 -1
- package/dist/esm/onchain/market/MarketSuite.js +11 -4
- package/dist/esm/onchain/market/credit/CreditSuite.js +27 -140
- package/dist/esm/onchain/market/credit/CreditSuiteStrategy.js +178 -0
- package/dist/esm/onchain/market/credit/index.js +2 -1
- package/dist/esm/onchain/market/index.js +2 -1
- package/dist/esm/onchain/market/pool/PoolQuotaKeeperV310Contract.js +4 -1
- package/dist/esm/onchain/opportunities/OpportunitiesService.js +7 -9
- package/dist/esm/rewards/{multichain.js → RewardsService.js} +19 -31
- package/dist/esm/rewards/errors.js +4 -4
- package/dist/esm/rewards/helpers.js +83 -0
- package/dist/esm/rewards/index.js +2 -2
- package/dist/esm/rewards/merkl-api.js +15 -25
- package/dist/esm/rewards/toMerklRewards.js +23 -78
- package/dist/esm/rewards/toTurtleRewards.js +46 -62
- package/dist/esm/rewards/turtle-api.js +17 -1
- package/dist/esm/rewards/types.js +1 -0
- package/dist/esm/sdk/prepare/PrepareApi.js +1 -1
- package/dist/types/model/errors/operation-errors.d.ts +6 -1
- package/dist/types/onchain/accounts/intents/maxBorrow.d.ts +12 -10
- package/dist/types/onchain/index.d.ts +2 -1
- package/dist/types/onchain/market/MarketSuite.d.ts +6 -0
- package/dist/types/onchain/market/credit/CreditSuite.d.ts +18 -52
- package/dist/types/onchain/market/credit/CreditSuiteStrategy.d.ts +78 -0
- package/dist/types/onchain/market/credit/index.d.ts +2 -1
- package/dist/types/onchain/market/credit/types.d.ts +3 -1
- package/dist/types/onchain/market/index.d.ts +2 -1
- package/dist/types/onchain/market/pool/PoolQuotaKeeperV310Contract.d.ts +2 -0
- package/dist/types/rewards/RewardsService.d.ts +29 -0
- package/dist/types/rewards/errors.d.ts +2 -2
- package/dist/types/rewards/helpers.d.ts +44 -0
- package/dist/types/rewards/index.d.ts +3 -3
- package/dist/types/rewards/merkl-api.d.ts +5 -10
- package/dist/types/rewards/toMerklRewards.d.ts +5 -48
- package/dist/types/rewards/toTurtleRewards.d.ts +3 -3
- package/dist/types/rewards/turtle-api.d.ts +5 -1
- package/dist/types/rewards/types.d.ts +41 -0
- package/package.json +1 -1
- package/dist/types/rewards/multichain.d.ts +0 -28
|
@@ -178,6 +178,7 @@ import { LinearInterestRateModelContract } from "./market/pool/LinearInterestRat
|
|
|
178
178
|
import { PoolSuite } from "./market/pool/PoolSuite.js";
|
|
179
179
|
import { PoolV310Contract } from "./market/pool/PoolV310Contract.js";
|
|
180
180
|
import { MarketSuite } from "./market/MarketSuite.js";
|
|
181
|
+
import { CreditSuiteStrategy } from "./market/credit/CreditSuiteStrategy.js";
|
|
181
182
|
import { CreditSuite } from "./market/credit/CreditSuite.js";
|
|
182
183
|
import { StrategyCollateralProps, dominantCollateral, isStrategyCollateral, pickStrategyTargetCollateral } from "./market/credit/collateralUtils.js";
|
|
183
184
|
import { ExpectedBalanceDeltasProps, ExpectedOutput, expectedBalanceDeltas } from "./market/credit/expectedBalanceDeltas.js";
|
|
@@ -338,4 +339,4 @@ import { amountOf } from "./validation/helpers/amount.js";
|
|
|
338
339
|
import { MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_SAFE_HEALTH_FACTOR_FORM } from "./validation/helpers/health-factor-limits.js";
|
|
339
340
|
import { toToken, toTokenAmount } from "./validation/helpers/token.js";
|
|
340
341
|
import "./validation/index.js";
|
|
341
|
-
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, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountBotsService, type AccountCalculatorOperation, AccountMigratorAdapterContract, AccountSnapshot, AccountToCheck, AdapterContractStateHuman, AdapterContractType, AdapterData, AdapterFactoryArgs, AdapterOperation, AdapterOperationBase, AdapterProtocolOperation, AdapterType, type AddCollateralIntent, AddCollateralOp, AddLiquidityProps, AddressMap, AddressProviderAddresses, AddressProviderState, AddressProviderV310Contract, type AddressProviderV3StateHuman, AddressSet, type AdjustLeverageIntent, type AliasLossPolicyStateHuman, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, AssertAssignable, Asset, type AssetPriceFeedStateHuman, AssetWithAmountInTarget, AssetsMap, AttachOptions, BLOCKS_PER_WEEK_BY_NETWORK, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, type BalancerWeightedPriceFeedStateHuman, BaseContract, BaseContractArgs, type BaseContractStateHuman, BaseParams, BasePlugin, type BasePriceFeedStateHuman, BaseState, BasicSwapCall, BigIntMath, type BlockNumberProps, BorrowLimitArgs, BorrowPreviewResult, type BorrowProps, type BorrowState, type BotListStateHuman, BotPermissions, BotStatusCall, BotsDirectResponse, type BoundedOracleStateHuman, BoundedPriceFeedContract, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, CMSlice, CalcBorrowRateProps, CalcDefaultQuotaProps, CalcHealthFactorProps, CalcLiquidationPriceForTargetProps, CalcLiquidationPriceProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, CallTrace, CamelotPool, CamelotV3AdapterContract, ChainBlock, ChainBlockPin, ChainBlockSource, ChainConfig, ChainContractsRegister, ChainNotConfiguredError, ChainQueryOneProps, ChainQueryProps, CheckCollateralFundingInput, CheckLiquidationEligibilityInput, CheckLiquidationFundingInput, CheckLiquidationInput, CheckLiquidationOptions, CheckMidasAccountGreenlistInput, CheckOperationInput, CheckOperationOptions, CheckPoolFundingInput, CheckRWAOpenRequirementsInput, CheckRWAOpeningInput, CheckSimulationInput, CheckWalletAllowanceInput, CheckWalletBalanceInput, CheckWalletInput, ClaimFarmRewardsProps, type ClaimRemainder, ClaimableWithdrawal, ClassifyInnerOperationsProps, ClientOptions, CloseCreditAccountOperation, CloseCreditAccountResult, CloseOrRepayOperation, ClosePathBalances, CollateralFundingPreview, CollateralisedArgs, CompareBalancesOp, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConnectedBotData, ConnectedBotsCall, ConnectedBotsPerAccount, type ConstantOracleStateHuman, ConstantPriceFeedContract, Construct, ConstructOptions, type ContractMethod, ContractOrInterface, ContractParseError, ContractParseErrorOptions, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, type CoreStateHuman, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountData, CreditAccountDataCall, CreditAccountDataPayload, CreditAccountFilter, CreditAccountFrozenArgs, CreditAccountOperation, CreditAccountOperationResult, CreditAccountOperationsService, CreditAccountReadOptions, type CreditAccountSlice, CreditAccountState, CreditAccountStateProps, CreditAccountTokenQuota, CreditAccountTokensSlice, CreditAccountsCall, CreditAccountsQuery, CreditAccountsReadOptions, CreditAccountsServiceV310, CreditAccountsTarget, CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditConfiguratorV310Contract, CreditFacadeState, type CreditFacadeStateHuman, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerDebtParams, type CreditManagerDebtParamsHuman, CreditManagerFilter, CreditManagerOperationResult, CreditManagerPausedArgs, CreditManagerState, type CreditManagerStateHuman, CreditManagerV310Contract, CreditOperationArgs, CreditOperationError, CreditOperationPreview, CreditSimulationInput, CreditSuite, CreditSuiteState, type CreditSuiteStateHuman, CurrentWithdrawals, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DStokenData, DUST_THRESHOLD, DaiUsdsAdapterContract, DebtLimitsArgs, DecreaseDebtOp, type DelayableIntent, DelayedIntentExtended, type DelayedRoute, type DelayedStart, type DelayedStartResult, DelayedWithdrawalClaim, DelayedWithdrawalRequest, DelegatedMulticall, DepositMetadata, type DepositStrategyIntent, DetectedDelayedClaim, DetectedDelayedOperation, DirectTokenTransferOperation, ERC4626AdapterContract, ERC4626ReferralAdapterContract, EXECUTE_BYTES_SELECTOR, EmergencyLiquidatorArgs, EmptyAccountPreviewResult, EncodableCreditAccountOperation, Erc4626PriceFeedContract, EstimateRawTxGasParameters, EtherscanURLParam, ExecuteMulticallBatchesOptions, type ExecutionCost, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, FacadeOperationMetadata, FilterDustUSDOptions, FindBestClosePathProps, FindClaimAllRewardsProps, FindManyToOnePathProps, FindOneTokenPathProps, FindOpenStrategyPathProps, type FinishIntentProps, type FinishIntentResult, FluidDexAdapterContract, ForbiddenTokenArgs, FormatBNOptions, FullyLiquidateProps, FullyLiquidateResult, GaugeContract, GaugeData, GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, type GearStakingV3StateHuman, GearboxChain, type GearboxState, type GearboxStateHuman, GetApprovalAddressProps, GetConnectedBotsResponse, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetCurrentWithdrawalsProps, GetCurrentWithdrawalsPropsBase, GetExternalAccountCurrentWithdrawalsProps, GetInvestorOptions, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetOpenAccountRequirementsProps, GetReward, GetWithdrawalRequestResultProps, HealthFactorThresholds, HydrateOptions, IAdapterContract, IAddressProviderContract, IBaseContract, ICreditAccountsService, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IDegenNFT, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, type ILogger, IMultichainOpportunitiesService, IMultichainPositionsService, IOnchainSDKPlugin, IOnchainSDKPluginConstructor, IPluginState, IPoolContract, IPoolsService, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTask, type IPriceUpdateTx, type IPriceUpdater, IRWAFactory, IRateKeeperContract, IRedemptionLoggerContract, IRouterContract, type IUpdatablePriceFeedContract, IWithdrawalCompressorContract, IZapperContract, IncreaseDebtOp, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, InnerFacadeOperation, InnerOperation, type InstantRoute, type IntentPreviewResult, type IntentRoutesResult, type IntentValidationError, type InterestRateModelStateHuman, InterestRateModelType, IsDustOptions, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LPMonopolizedPoolMeta, type LPPriceFeedStateHuman, type LatestUpdate, LegacyAdapterOperation, LeverageArgs, type LeverageBand, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, type LinearInterestRateModelStateHuman, LiquidateCreditAccountOperation, LiquidationEligibilityError, LiquidationFees, LiquidationValidationError, LiquidationsService, LiquidatorEligibleArgs, ListPoolPositionsProps, ListPositionsProps, ListPositionsPropsBase, ListStrategyPositionsProps, LoadRWALiquidatorsProps, type LogFn, type LossPolicyStateHuman, 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, MakerDeposit, MakerRedeem, MarketData, MarketExpiredArgs, MarketFilter, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketStateError, type MarketStateHuman, MarketSuite, MarketType, MaxBorrowAmount, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, Methods, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, MissingSerializedParamsError, type MultiCall, MulticallBatch, MulticallOperation, MulticallWithFailure, MultichainAttachOptions, type MultichainChainIdsProps, MultichainConstruct, MultichainHydrateOptions, MultichainLiquidationsService, type MultichainNetworkProps, MultichainOpportunitiesService, MultichainPositionsService, MultichainSDK, MultichainSDKOptions, type MultichainState, type MultichainStateHuman, MultichainSyncStateOptions, NATIVE_ADDRESS, NON_STRATEGY_PHANTOM_TOKEN_TYPES, NOT_DEPLOYED, NO_VERSION, NetworkType, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OnchainSDK, OnchainSDKOptions, OpenCAProps, OpenCreditAccountOperation, OpenStrategyPreviewResult, type OpenStrategyProps, OpenStrategyResult, type OpenStrategyState, Operation, OperationMetadata, type OperationState, OperationValidationError, OpportunitiesService, OptimalRepaidAmountProps, OuterFacadeOperation, 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, ParsedCall, ParsedCallArgs, ParsedCallV2, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialLiquidationOperation, PartialLiquidationParams, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PartialRecord, PartiallyLiquidateProps, type PathLossRate, PendingWithdrawal, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PeripheryCompressorV310Contract, PeripheryContract, PermitResult, PhantomTokenContractType, PhantomTokenMeta, PickSomeRequired, PluginFactoriesMap, PluginFactory, PluginState, PluginStateVersionError, PluginStatesMap, PluginsMap, PoolDepositOperation, PoolLiquidityArgs, PoolMintOperation, PoolOperation, PoolOperationArgs, PoolOperationError, PoolPausedArgs, PoolQuotaKeeperContract, type PoolQuotaKeeperStateHuman, PoolRedeemOperation, PoolService, PoolServiceCall, PoolServiceCallResult, PoolSimulation, PoolState, type PoolStateHuman, PoolSuite, type PoolSuiteStateHuman, PoolSunsetArgs, PoolV310Contract, PoolWithdrawOperation, PositionsService, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, PreviewOperationError, PriceFeedAnswer, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedMapEntry, PriceFeedRef, PriceFeedRegistry, type PriceFeedStateHuman, PriceFeedTreeNode, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleData, type PriceOracleStateHuman, PriceOracleV310Contract, PriceUpdate, PriceUpdatesCache, ProjectedPoolOptions, PythPriceFeed, QuotaCountArgs, QuotaKeeperState, QuotaLimitArgs, QuotaMode, type QuotaParamsHuman, QuotaSlice, QuotaState, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWADefaultTokenMeta, RWAFactoryData, RWAFactoryProtocol, RWAFactoryStateHuman, RWAInvestorData, RWALiquidatorInfo, RWAMulticallOperation, RWAOnDemandLPMeta, RWAOnDemandLPMonopolizedMeta, RWAOnDemandLpContractType, RWAOnDemandTokenMeta, RWAOpenCreditAccountOperation, RWAOpeningError, RWAOperation, RWAOperationMetadata, RWARegistry, RWAState, RWAStateHuman, RWATokenMeta, RWAUnderlyingContractType, RWAUnderlyingData, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RampEvent, RateKeeperState, type RateKeeperStateHuman, RateKeeperType, type RawTx, RedemptionLog, RedemptionLoggerV310Contract, RedemptionPhantomRename, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, type RefusedIntent, RelaxedBaseParams, RemoveLiquidityProps, type RepayStrategyIntent, ReplayMulticallResult, ReplayState, ReplayableOperation, RequestableWithdrawal, ReservePriceLimitedArgs, type ResumableIntent, RetryOptions, RewardInfo, Rewards, type RouteErrors, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, RouterV310Contract, SDKConstruct, SDKOptions, SECONDS_PER_YEAR, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkRWADataNotLoadedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeCreditAccountData, SecuritizeDegenNFT, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, SendRawTxParameters, SetBotProps, SetBotResult, SimpleTokenMeta, SimulateCallOptions, SimulateCallParameters, SimulateCallReturnType, SimulateMulticallParameters, SimulateMulticallReturnType, SimulatePoolOperationProps, SimulateWithPriceUpdatesError, SimulateWithPriceUpdatesErrorParams, SimulateWithPriceUpdatesErrorType, SimulateWithPriceUpdatesParameters, SimulateWithPriceUpdatesReturnType, SimulationError, SimulationErrorType, SimulationValidationError, StakingRewardsAdapterContract, type StartIntent, StoreExpectedBalancesOp, StrategyCollateralProps, StrategyRateInputs, SupportedValue, Swap, SwapOperation, SyncStateOptions, type TimestampedCalldata, TokenAmount, TokenInfo, TokenMetaData, TokenTransfer, TokensMeta, TokensMetaState, TraceAdapterExt, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, type TumblerStateHuman, TypedObjectUtils, Unarray, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatePriceFeedsResult, UpdateQuotaOp, UpshiftVaultAdapterContract, VERSION_RANGE_310, VaultDeposit, VelodromeV2RouterAdapterContract, VersionRange, VersionedAbi, VotingContractStatus, WAD, WAD_DECIMALS_POW, WalletFundingError, WatchBlocksAsyncParameters, WatchBlocksAsyncReturnType, WeighedFactors, type WithBlock, type WithMultichain, type WithPartialState, type WithdrawAssetIntent, type WithdrawCeilings, WithdrawCollateral, WithdrawCollateralOp, type WithdrawStrategyIntent, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalMetadata, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, type ZapperStateHuman, 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, 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 };
|
|
342
|
+
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, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountBotsService, type AccountCalculatorOperation, AccountMigratorAdapterContract, AccountSnapshot, AccountToCheck, AdapterContractStateHuman, AdapterContractType, AdapterData, AdapterFactoryArgs, AdapterOperation, AdapterOperationBase, AdapterProtocolOperation, AdapterType, type AddCollateralIntent, AddCollateralOp, AddLiquidityProps, AddressMap, AddressProviderAddresses, AddressProviderState, AddressProviderV310Contract, type AddressProviderV3StateHuman, AddressSet, type AdjustLeverageIntent, type AliasLossPolicyStateHuman, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, AssertAssignable, Asset, type AssetPriceFeedStateHuman, AssetWithAmountInTarget, AssetsMap, AttachOptions, BLOCKS_PER_WEEK_BY_NETWORK, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, type BalancerWeightedPriceFeedStateHuman, BaseContract, BaseContractArgs, type BaseContractStateHuman, BaseParams, BasePlugin, type BasePriceFeedStateHuman, BaseState, BasicSwapCall, BigIntMath, type BlockNumberProps, BorrowLimitArgs, BorrowPreviewResult, type BorrowProps, type BorrowState, type BotListStateHuman, BotPermissions, BotStatusCall, BotsDirectResponse, type BoundedOracleStateHuman, BoundedPriceFeedContract, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, CMSlice, CalcBorrowRateProps, CalcDefaultQuotaProps, CalcHealthFactorProps, CalcLiquidationPriceForTargetProps, CalcLiquidationPriceProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, CallTrace, CamelotPool, CamelotV3AdapterContract, ChainBlock, ChainBlockPin, ChainBlockSource, ChainConfig, ChainContractsRegister, ChainNotConfiguredError, ChainQueryOneProps, ChainQueryProps, CheckCollateralFundingInput, CheckLiquidationEligibilityInput, CheckLiquidationFundingInput, CheckLiquidationInput, CheckLiquidationOptions, CheckMidasAccountGreenlistInput, CheckOperationInput, CheckOperationOptions, CheckPoolFundingInput, CheckRWAOpenRequirementsInput, CheckRWAOpeningInput, CheckSimulationInput, CheckWalletAllowanceInput, CheckWalletBalanceInput, CheckWalletInput, ClaimFarmRewardsProps, type ClaimRemainder, ClaimableWithdrawal, ClassifyInnerOperationsProps, ClientOptions, CloseCreditAccountOperation, CloseCreditAccountResult, CloseOrRepayOperation, ClosePathBalances, CollateralFundingPreview, CollateralisedArgs, CompareBalancesOp, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConnectedBotData, ConnectedBotsCall, ConnectedBotsPerAccount, type ConstantOracleStateHuman, ConstantPriceFeedContract, Construct, ConstructOptions, type ContractMethod, ContractOrInterface, ContractParseError, ContractParseErrorOptions, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, type CoreStateHuman, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountData, CreditAccountDataCall, CreditAccountDataPayload, CreditAccountFilter, CreditAccountFrozenArgs, CreditAccountOperation, CreditAccountOperationResult, CreditAccountOperationsService, CreditAccountReadOptions, type CreditAccountSlice, CreditAccountState, CreditAccountStateProps, CreditAccountTokenQuota, CreditAccountTokensSlice, CreditAccountsCall, CreditAccountsQuery, CreditAccountsReadOptions, CreditAccountsServiceV310, CreditAccountsTarget, CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditConfiguratorV310Contract, CreditFacadeState, type CreditFacadeStateHuman, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerDebtParams, type CreditManagerDebtParamsHuman, CreditManagerFilter, CreditManagerOperationResult, CreditManagerPausedArgs, CreditManagerState, type CreditManagerStateHuman, CreditManagerV310Contract, CreditOperationArgs, CreditOperationError, CreditOperationPreview, CreditSimulationInput, CreditSuite, CreditSuiteState, type CreditSuiteStateHuman, CreditSuiteStrategy, CurrentWithdrawals, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DStokenData, DUST_THRESHOLD, DaiUsdsAdapterContract, DebtLimitsArgs, DecreaseDebtOp, type DelayableIntent, DelayedIntentExtended, type DelayedRoute, type DelayedStart, type DelayedStartResult, DelayedWithdrawalClaim, DelayedWithdrawalRequest, DelegatedMulticall, DepositMetadata, type DepositStrategyIntent, DetectedDelayedClaim, DetectedDelayedOperation, DirectTokenTransferOperation, ERC4626AdapterContract, ERC4626ReferralAdapterContract, EXECUTE_BYTES_SELECTOR, EmergencyLiquidatorArgs, EmptyAccountPreviewResult, EncodableCreditAccountOperation, Erc4626PriceFeedContract, EstimateRawTxGasParameters, EtherscanURLParam, ExecuteMulticallBatchesOptions, type ExecutionCost, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, FacadeOperationMetadata, FilterDustUSDOptions, FindBestClosePathProps, FindClaimAllRewardsProps, FindManyToOnePathProps, FindOneTokenPathProps, FindOpenStrategyPathProps, type FinishIntentProps, type FinishIntentResult, FluidDexAdapterContract, ForbiddenTokenArgs, FormatBNOptions, FullyLiquidateProps, FullyLiquidateResult, GaugeContract, GaugeData, GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, type GearStakingV3StateHuman, GearboxChain, type GearboxState, type GearboxStateHuman, GetApprovalAddressProps, GetConnectedBotsResponse, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetCurrentWithdrawalsProps, GetCurrentWithdrawalsPropsBase, GetExternalAccountCurrentWithdrawalsProps, GetInvestorOptions, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetOpenAccountRequirementsProps, GetReward, GetWithdrawalRequestResultProps, HealthFactorThresholds, HydrateOptions, IAdapterContract, IAddressProviderContract, IBaseContract, ICreditAccountsService, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IDegenNFT, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, type ILogger, IMultichainOpportunitiesService, IMultichainPositionsService, IOnchainSDKPlugin, IOnchainSDKPluginConstructor, IPluginState, IPoolContract, IPoolsService, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTask, type IPriceUpdateTx, type IPriceUpdater, IRWAFactory, IRateKeeperContract, IRedemptionLoggerContract, IRouterContract, type IUpdatablePriceFeedContract, IWithdrawalCompressorContract, IZapperContract, IncreaseDebtOp, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, InnerFacadeOperation, InnerOperation, type InstantRoute, type IntentPreviewResult, type IntentRoutesResult, type IntentValidationError, type InterestRateModelStateHuman, InterestRateModelType, IsDustOptions, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LPMonopolizedPoolMeta, type LPPriceFeedStateHuman, type LatestUpdate, LegacyAdapterOperation, LeverageArgs, type LeverageBand, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, type LinearInterestRateModelStateHuman, LiquidateCreditAccountOperation, LiquidationEligibilityError, LiquidationFees, LiquidationValidationError, LiquidationsService, LiquidatorEligibleArgs, ListPoolPositionsProps, ListPositionsProps, ListPositionsPropsBase, ListStrategyPositionsProps, LoadRWALiquidatorsProps, type LogFn, type LossPolicyStateHuman, 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, MakerDeposit, MakerRedeem, MarketData, MarketExpiredArgs, MarketFilter, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketStateError, type MarketStateHuman, MarketSuite, MarketType, MaxBorrowAmount, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, Methods, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, MissingSerializedParamsError, type MultiCall, MulticallBatch, MulticallOperation, MulticallWithFailure, MultichainAttachOptions, type MultichainChainIdsProps, MultichainConstruct, MultichainHydrateOptions, MultichainLiquidationsService, type MultichainNetworkProps, MultichainOpportunitiesService, MultichainPositionsService, MultichainSDK, MultichainSDKOptions, type MultichainState, type MultichainStateHuman, MultichainSyncStateOptions, NATIVE_ADDRESS, NON_STRATEGY_PHANTOM_TOKEN_TYPES, NOT_DEPLOYED, NO_VERSION, NetworkType, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OnchainSDK, OnchainSDKOptions, OpenCAProps, OpenCreditAccountOperation, OpenStrategyPreviewResult, type OpenStrategyProps, OpenStrategyResult, type OpenStrategyState, Operation, OperationMetadata, type OperationState, OperationValidationError, OpportunitiesService, OptimalRepaidAmountProps, OuterFacadeOperation, 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, ParsedCall, ParsedCallArgs, ParsedCallV2, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialLiquidationOperation, PartialLiquidationParams, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PartialRecord, PartiallyLiquidateProps, type PathLossRate, PendingWithdrawal, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PeripheryCompressorV310Contract, PeripheryContract, PermitResult, PhantomTokenContractType, PhantomTokenMeta, PickSomeRequired, PluginFactoriesMap, PluginFactory, PluginState, PluginStateVersionError, PluginStatesMap, PluginsMap, PoolDepositOperation, PoolLiquidityArgs, PoolMintOperation, PoolOperation, PoolOperationArgs, PoolOperationError, PoolPausedArgs, PoolQuotaKeeperContract, type PoolQuotaKeeperStateHuman, PoolRedeemOperation, PoolService, PoolServiceCall, PoolServiceCallResult, PoolSimulation, PoolState, type PoolStateHuman, PoolSuite, type PoolSuiteStateHuman, PoolSunsetArgs, PoolV310Contract, PoolWithdrawOperation, PositionsService, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, PreviewOperationError, PriceFeedAnswer, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedMapEntry, PriceFeedRef, PriceFeedRegistry, type PriceFeedStateHuman, PriceFeedTreeNode, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleData, type PriceOracleStateHuman, PriceOracleV310Contract, PriceUpdate, PriceUpdatesCache, ProjectedPoolOptions, PythPriceFeed, QuotaCountArgs, QuotaKeeperState, QuotaLimitArgs, QuotaMode, type QuotaParamsHuman, QuotaSlice, QuotaState, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWADefaultTokenMeta, RWAFactoryData, RWAFactoryProtocol, RWAFactoryStateHuman, RWAInvestorData, RWALiquidatorInfo, RWAMulticallOperation, RWAOnDemandLPMeta, RWAOnDemandLPMonopolizedMeta, RWAOnDemandLpContractType, RWAOnDemandTokenMeta, RWAOpenCreditAccountOperation, RWAOpeningError, RWAOperation, RWAOperationMetadata, RWARegistry, RWAState, RWAStateHuman, RWATokenMeta, RWAUnderlyingContractType, RWAUnderlyingData, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RampEvent, RateKeeperState, type RateKeeperStateHuman, RateKeeperType, type RawTx, RedemptionLog, RedemptionLoggerV310Contract, RedemptionPhantomRename, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, type RefusedIntent, RelaxedBaseParams, RemoveLiquidityProps, type RepayStrategyIntent, ReplayMulticallResult, ReplayState, ReplayableOperation, RequestableWithdrawal, ReservePriceLimitedArgs, type ResumableIntent, RetryOptions, RewardInfo, Rewards, type RouteErrors, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, RouterV310Contract, SDKConstruct, SDKOptions, SECONDS_PER_YEAR, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkRWADataNotLoadedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeCreditAccountData, SecuritizeDegenNFT, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, SendRawTxParameters, SetBotProps, SetBotResult, SimpleTokenMeta, SimulateCallOptions, SimulateCallParameters, SimulateCallReturnType, SimulateMulticallParameters, SimulateMulticallReturnType, SimulatePoolOperationProps, SimulateWithPriceUpdatesError, SimulateWithPriceUpdatesErrorParams, SimulateWithPriceUpdatesErrorType, SimulateWithPriceUpdatesParameters, SimulateWithPriceUpdatesReturnType, SimulationError, SimulationErrorType, SimulationValidationError, StakingRewardsAdapterContract, type StartIntent, StoreExpectedBalancesOp, StrategyCollateralProps, StrategyRateInputs, SupportedValue, Swap, SwapOperation, SyncStateOptions, type TimestampedCalldata, TokenAmount, TokenInfo, TokenMetaData, TokenTransfer, TokensMeta, TokensMetaState, TraceAdapterExt, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, type TumblerStateHuman, TypedObjectUtils, Unarray, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatePriceFeedsResult, UpdateQuotaOp, UpshiftVaultAdapterContract, VERSION_RANGE_310, VaultDeposit, VelodromeV2RouterAdapterContract, VersionRange, VersionedAbi, VotingContractStatus, WAD, WAD_DECIMALS_POW, WalletFundingError, WatchBlocksAsyncParameters, WatchBlocksAsyncReturnType, WeighedFactors, type WithBlock, type WithMultichain, type WithPartialState, type WithdrawAssetIntent, type WithdrawCeilings, WithdrawCollateral, WithdrawCollateralOp, type WithdrawStrategyIntent, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalMetadata, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, type ZapperStateHuman, 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, 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 };
|
|
@@ -12,6 +12,7 @@ import { IPriceOracleContract } from "./oracle/types.js";
|
|
|
12
12
|
import "./oracle/index.js";
|
|
13
13
|
import { PoolSuite } from "./pool/PoolSuite.js";
|
|
14
14
|
import "./pool/index.js";
|
|
15
|
+
import { CreditSuiteStrategy } from "./credit/CreditSuiteStrategy.js";
|
|
15
16
|
import { CreditSuite } from "./credit/CreditSuite.js";
|
|
16
17
|
import "./credit/index.js";
|
|
17
18
|
import { OnchainSDK } from "../OnchainSDK.js";
|
|
@@ -173,6 +174,11 @@ declare class MarketSuite extends SDKConstruct {
|
|
|
173
174
|
* condition means.
|
|
174
175
|
*/
|
|
175
176
|
opportunities(filter?: OpportunityFilter): Opportunity[];
|
|
177
|
+
/**
|
|
178
|
+
* Strategies this market lists as opportunities; see
|
|
179
|
+
* {@link CreditSuiteStrategy.isListed}.
|
|
180
|
+
*/
|
|
181
|
+
strategies(): CreditSuiteStrategy[];
|
|
176
182
|
/**
|
|
177
183
|
* Passive lending into this market's pool, as the shared read model
|
|
178
184
|
* describes it.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Bps, Timestamp, Token, UnderlyingToken } from "../../../model/primitives.js";
|
|
2
|
-
import {
|
|
3
|
-
import { StrategyOpportunity, StrategyOpportunityDetail } from "../../../model/opportunities.js";
|
|
2
|
+
import { RWAOperationArgs } from "../../../model/rwa.js";
|
|
4
3
|
import { CreditOperationMarket } from "../../../model/previews.js";
|
|
5
4
|
import "../../../model/index.js";
|
|
6
5
|
import { CreditAccountData, CreditSuiteState } from "../../base/types.js";
|
|
@@ -11,6 +10,7 @@ import { IRouterContract } from "../../router/types.js";
|
|
|
11
10
|
import "../../router/index.js";
|
|
12
11
|
import { MarketConfiguratorContract } from "../MarketConfiguratorContract.js";
|
|
13
12
|
import { MarketSuite } from "../MarketSuite.js";
|
|
13
|
+
import { CreditSuiteStrategy } from "./CreditSuiteStrategy.js";
|
|
14
14
|
import { MultiCall, RawTx } from "../../types/transactions.js";
|
|
15
15
|
import { OnchainSDK } from "../../OnchainSDK.js";
|
|
16
16
|
import "../../types/index.js";
|
|
@@ -99,16 +99,6 @@ declare class CreditSuite extends SDKConstruct {
|
|
|
99
99
|
* `undefined` when the facade has none, or when the NFT is not a KYC gate.
|
|
100
100
|
*/
|
|
101
101
|
degenNFT(): Promise<IDegenNFT | undefined>;
|
|
102
|
-
/**
|
|
103
|
-
* The KYC gate of this suite's strategy; `null` when there is none.
|
|
104
|
-
* Wallet-independent.
|
|
105
|
-
*/
|
|
106
|
-
kycRequirement(targetCollateral: Address): Promise<KycRequirement | null>;
|
|
107
|
-
/**
|
|
108
|
-
* Whether `wallet` may open this suite's strategy today; `true` when there
|
|
109
|
-
* is no KYC gate.
|
|
110
|
-
*/
|
|
111
|
-
isEligibleForStrategy(wallet: Address, targetCollateral: Address): Promise<boolean>;
|
|
112
102
|
/**
|
|
113
103
|
* Builds a transaction that executes a multicall on one of this suite's
|
|
114
104
|
* credit accounts.
|
|
@@ -175,7 +165,8 @@ declare class CreditSuite extends SDKConstruct {
|
|
|
175
165
|
* row all spread it, so the five fields are filled in one place and cannot
|
|
176
166
|
* drift apart between the halves of the SDK.
|
|
177
167
|
*
|
|
178
|
-
* The curator comes from the same getter
|
|
168
|
+
* The curator comes from the same getter
|
|
169
|
+
* {@link CreditSuiteStrategy.opportunity} reads, so
|
|
179
170
|
* a result and the opportunity beside it name one entity.
|
|
180
171
|
*/
|
|
181
172
|
creditOperationMarket(): CreditOperationMarket;
|
|
@@ -194,44 +185,38 @@ declare class CreditSuite extends SDKConstruct {
|
|
|
194
185
|
*/
|
|
195
186
|
isForbidden(token: Address): boolean;
|
|
196
187
|
/**
|
|
197
|
-
* Largest debt
|
|
198
|
-
* and which limit set that number.
|
|
188
|
+
* Largest debt this credit manager allows to borrow, and which limit set that number.
|
|
199
189
|
*
|
|
200
190
|
* Minimum of:
|
|
201
191
|
* - the pool's available liquidity,
|
|
202
192
|
* - this manager's remaining debt allowance, and
|
|
203
193
|
* - the facade's per-account `maxDebt`.
|
|
204
|
-
*
|
|
205
|
-
*
|
|
194
|
+
*
|
|
195
|
+
* If the credit manager allows no debt at all, the answer is `0`.
|
|
206
196
|
*/
|
|
207
197
|
maxBorrowAmount(): MaxBorrowAmount;
|
|
208
198
|
/**
|
|
209
|
-
*
|
|
210
|
-
*
|
|
199
|
+
* This suite's leveraged strategy, or `undefined` when no target collateral
|
|
200
|
+
* can be resolved.
|
|
211
201
|
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
* 2. the collateral with the biggest index in
|
|
217
|
-
* {@link ICreditManagerContract.collateralTokens} that
|
|
218
|
-
* {@link isStrategyCollateral} accepts with quota required;
|
|
219
|
-
* 3. the biggest-index collateral that {@link isStrategyCollateral} accepts
|
|
220
|
-
* without quota.
|
|
202
|
+
* The strategy exists whether or not it is offered today, because its
|
|
203
|
+
* target also names existing positions; see
|
|
204
|
+
* {@link CreditSuiteStrategy.isListed} for whether it is listed as an
|
|
205
|
+
* opportunity.
|
|
221
206
|
*/
|
|
222
|
-
get
|
|
207
|
+
get strategy(): CreditSuiteStrategy | undefined;
|
|
223
208
|
/**
|
|
224
|
-
*
|
|
225
|
-
*
|
|
209
|
+
* Whether `token` can be this suite's strategy target; see
|
|
210
|
+
* {@link isStrategyCollateral}.
|
|
226
211
|
*/
|
|
227
|
-
|
|
212
|
+
isStrategyCollateral(token: Address, requireQuota?: boolean): boolean;
|
|
228
213
|
/**
|
|
229
214
|
* Collateral token an existing credit account in this suite is a strategy
|
|
230
215
|
* in. Same as {@link StrategyPosition.targetCollateral}.
|
|
231
216
|
*
|
|
232
217
|
* Resolution, in order:
|
|
233
218
|
* 1. a hardcoded per-account override, when present;
|
|
234
|
-
* 2. {@link
|
|
219
|
+
* 2. the target of {@link strategy};
|
|
235
220
|
* 3. `null` when neither can be resolved.
|
|
236
221
|
*/
|
|
237
222
|
accountTargetCollateral(creditAccount: Address): Token | null;
|
|
@@ -243,15 +228,6 @@ declare class CreditSuite extends SDKConstruct {
|
|
|
243
228
|
* symbol when no target can be resolved.
|
|
244
229
|
*/
|
|
245
230
|
accountStrategyName(creditAccount: Address): string;
|
|
246
|
-
/**
|
|
247
|
-
* Describes this suite's leveraged strategy as the shared read model does,
|
|
248
|
-
* or `undefined` when credit suite does not offer a strategy opportunity.
|
|
249
|
-
*/
|
|
250
|
-
strategyOpportunity(): StrategyOpportunity | undefined;
|
|
251
|
-
/**
|
|
252
|
-
* {@link strategyOpportunity} plus the data only its detail screen needs.
|
|
253
|
-
*/
|
|
254
|
-
strategyOpportunityDetail(): StrategyOpportunityDetail | undefined;
|
|
255
231
|
/**
|
|
256
232
|
* Everything a partial liquidation of credit account needs, with any parameter the
|
|
257
233
|
* caller pinned down taken as given and the rest derived from current state.
|
|
@@ -268,16 +244,6 @@ declare class CreditSuite extends SDKConstruct {
|
|
|
268
244
|
* @param ca - Credit account to partially liquidate.
|
|
269
245
|
*/
|
|
270
246
|
optimalHFForPartialLiquidation(ca: CreditAccountData): bigint;
|
|
271
|
-
/**
|
|
272
|
-
* Tokens a user can transfer from their wallet when opening an account in
|
|
273
|
-
* this suite:
|
|
274
|
-
*
|
|
275
|
-
* 1. unwrapped underlying (USDC, never dcUSDC)
|
|
276
|
-
* 2. target collateral
|
|
277
|
-
* 3. remaining CM collaterals in manager order, excluding phantom tokens
|
|
278
|
-
* and tokens without price
|
|
279
|
-
*/
|
|
280
|
-
allowedDepositTokens(targetCollateral: Address): Token[];
|
|
281
247
|
/**
|
|
282
248
|
* Whether the facade, manager, or configurator has observed logs that require
|
|
283
249
|
* a credit-suite resync.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Token } from "../../../model/primitives.js";
|
|
2
|
+
import { KycRequirement } from "../../../model/rwa.js";
|
|
3
|
+
import { StrategyOpportunity, StrategyOpportunityDetail } from "../../../model/opportunities.js";
|
|
4
|
+
import "../../../model/index.js";
|
|
5
|
+
import { MaxBorrowAmount } from "./types.js";
|
|
6
|
+
import { CreditSuite } from "./CreditSuite.js";
|
|
7
|
+
import { Address } from "viem";
|
|
8
|
+
//#region src/onchain/market/credit/CreditSuiteStrategy.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* The leveraged strategy a credit suite runs: one target collateral bought
|
|
11
|
+
* with underlying borrowed from the pool.
|
|
12
|
+
*
|
|
13
|
+
* A view over live suite state, see {@link CreditSuite.strategy}.
|
|
14
|
+
*/
|
|
15
|
+
declare class CreditSuiteStrategy {
|
|
16
|
+
/**
|
|
17
|
+
* Credit suite this strategy borrows through.
|
|
18
|
+
*/
|
|
19
|
+
readonly suite: CreditSuite;
|
|
20
|
+
/**
|
|
21
|
+
* Collateral token a position in this strategy is built to hold.
|
|
22
|
+
*/
|
|
23
|
+
readonly targetCollateral: Address;
|
|
24
|
+
constructor(suite: CreditSuite, targetCollateral: Address);
|
|
25
|
+
/**
|
|
26
|
+
* {@link targetCollateral} as the shared read model describes it.
|
|
27
|
+
*/
|
|
28
|
+
get token(): Token;
|
|
29
|
+
/**
|
|
30
|
+
* Display name of this strategy, e.g. `"wstETH / WETH"`.
|
|
31
|
+
*/
|
|
32
|
+
get name(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Tokens a user can transfer from their wallet when opening a position in
|
|
35
|
+
* this strategy:
|
|
36
|
+
*
|
|
37
|
+
* 1. unwrapped underlying (USDC, never dcUSDC)
|
|
38
|
+
* 2. target collateral
|
|
39
|
+
* 3. remaining CM collaterals in manager order, excluding phantom tokens
|
|
40
|
+
* and tokens without price
|
|
41
|
+
*/
|
|
42
|
+
get allowedDepositTokens(): Token[];
|
|
43
|
+
/**
|
|
44
|
+
* Largest debt one new position can take right now, and which limit set
|
|
45
|
+
* that number.
|
|
46
|
+
*
|
|
47
|
+
* `amount` is `0` whenever no position can be opened right now,
|
|
48
|
+
* and `limit` explains why.
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
maxBorrowAmount(): MaxBorrowAmount;
|
|
52
|
+
/**
|
|
53
|
+
* Whether this strategy is offered as an opportunity right now: it lends
|
|
54
|
+
* more than the pool's seed amount, and its target can be opened today.
|
|
55
|
+
*/
|
|
56
|
+
get isListed(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Describes this strategy as the shared read model does. Whether it is
|
|
59
|
+
* listed at all is {@link isListed}.
|
|
60
|
+
*/
|
|
61
|
+
opportunity(): StrategyOpportunity;
|
|
62
|
+
/**
|
|
63
|
+
* {@link opportunity} plus the data only its detail screen needs.
|
|
64
|
+
*/
|
|
65
|
+
opportunityDetail(): StrategyOpportunityDetail;
|
|
66
|
+
/**
|
|
67
|
+
* The KYC gate of this strategy; `null` when there is none.
|
|
68
|
+
* Wallet-independent.
|
|
69
|
+
*/
|
|
70
|
+
kycRequirement(): Promise<KycRequirement | null>;
|
|
71
|
+
/**
|
|
72
|
+
* Whether `wallet` may open this strategy today; `true` when there is no
|
|
73
|
+
* KYC gate.
|
|
74
|
+
*/
|
|
75
|
+
isEligible(wallet: Address): Promise<boolean>;
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { CreditSuiteStrategy };
|
|
@@ -3,7 +3,8 @@ import { CreditConfiguratorV310Contract, RampEvent } from "./CreditConfiguratorV
|
|
|
3
3
|
import { CreditFacadeV310Abi as abi, CreditFacadeV310BaseContract } from "./CreditFacadeV310BaseContract.js";
|
|
4
4
|
import { CreditFacadeV310Contract } from "./CreditFacadeV310Contract.js";
|
|
5
5
|
import { CreditManagerV310Contract } from "./CreditManagerV310Contract.js";
|
|
6
|
+
import { CreditSuiteStrategy } from "./CreditSuiteStrategy.js";
|
|
6
7
|
import { CreditSuite } from "./CreditSuite.js";
|
|
7
8
|
import { StrategyCollateralProps, dominantCollateral, isStrategyCollateral, pickStrategyTargetCollateral } from "./collateralUtils.js";
|
|
8
9
|
import { ExpectedBalanceDeltasProps, ExpectedOutput, expectedBalanceDeltas } from "./expectedBalanceDeltas.js";
|
|
9
|
-
export { BalanceDelta, CreditAccountTokenQuota, CreditConfiguratorV310Contract, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, ExpectedBalanceDeltasProps, ExpectedOutput, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, LiquidationFees, MaxBorrowAmount, PartialLiquidationParams, PrepareUpdateQuotasProps, QuotaSlice, RampEvent, StrategyCollateralProps, dominantCollateral, expectedBalanceDeltas, isStrategyCollateral, pickStrategyTargetCollateral };
|
|
10
|
+
export { BalanceDelta, CreditAccountTokenQuota, CreditConfiguratorV310Contract, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, CreditSuiteStrategy, ExpectedBalanceDeltasProps, ExpectedOutput, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, LiquidationFees, MaxBorrowAmount, PartialLiquidationParams, PrepareUpdateQuotasProps, QuotaSlice, RampEvent, StrategyCollateralProps, dominantCollateral, expectedBalanceDeltas, isStrategyCollateral, pickStrategyTargetCollateral };
|
|
@@ -21,7 +21,9 @@ interface ICreditConfiguratorContract extends IBaseContract {
|
|
|
21
21
|
stateHuman: (raw?: boolean) => CreditConfiguratorStateHuman;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* Largest debt
|
|
24
|
+
* Largest debt that can be borrowed right now, and which limit set it. See
|
|
25
|
+
* {@link CreditSuite.maxBorrowAmount} and
|
|
26
|
+
* {@link CreditSuiteStrategy.maxBorrowAmount} for the bounds each applies.
|
|
25
27
|
**/
|
|
26
28
|
interface MaxBorrowAmount {
|
|
27
29
|
/** In the pool's underlying. */
|
|
@@ -143,6 +143,7 @@ import { PoolSuite } from "./pool/PoolSuite.js";
|
|
|
143
143
|
import { PoolV310Contract } from "./pool/PoolV310Contract.js";
|
|
144
144
|
import "./pool/index.js";
|
|
145
145
|
import { MarketSuite } from "./MarketSuite.js";
|
|
146
|
+
import { CreditSuiteStrategy } from "./credit/CreditSuiteStrategy.js";
|
|
146
147
|
import { CreditSuite } from "./credit/CreditSuite.js";
|
|
147
148
|
import { StrategyCollateralProps, dominantCollateral, isStrategyCollateral, pickStrategyTargetCollateral } from "./credit/collateralUtils.js";
|
|
148
149
|
import { ExpectedBalanceDeltasProps, ExpectedOutput, expectedBalanceDeltas } from "./credit/expectedBalanceDeltas.js";
|
|
@@ -157,4 +158,4 @@ import "./zapper/index.js";
|
|
|
157
158
|
import { MarketRegister, MarketRegistryState, MarketRegistryStateHuman } from "./MarketRegister.js";
|
|
158
159
|
import { DEFAULT_QUOTA_BUFFER_BPS, MAX_LEVERAGE_BUFFER_BPS, OptimalRepaidAmountProps, PARTIAL_LIQUIDATION_BUFFER_BPS, QuotaMode, StrategyRateInputs, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, healthFactorBps, minSeizedAmount, optimalHFForPartialLiquidation, optimalRepaidAmount, rayToBps, usdToNumber } from "./math.js";
|
|
159
160
|
import { strategyName } from "./strategyName.js";
|
|
160
|
-
export { AbstractAdapterContract, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterContractStateHuman, AdapterContractType, AdapterFactoryArgs, AdapterProtocolOperation, AdapterType, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BasicSwapCall, BoundedPriceFeedContract, CamelotPool, CamelotV3AdapterContract, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConstantPriceFeedContract, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, CreditAccountTokenQuota, CreditConfiguratorV310Contract, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DStokenData, DaiUsdsAdapterContract, DelayedWithdrawalClaim, DelayedWithdrawalRequest, ERC4626AdapterContract, ERC4626ReferralAdapterContract, Erc4626PriceFeedContract, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, GaugeParams, GetInvestorOptions, GetOpenAccountRequirementsProps, GetReward, IAdapterContract, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IDegenNFT, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, IPoolContract, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTask, type IPriceUpdater, IRWAFactory, IRateKeeperContract, type IUpdatablePriceFeedContract, IZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, InterestRateModelType, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, type LatestUpdate, LegacyAdapterOperation, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, LiquidationFees, MAX_LEVERAGE_BUFFER_BPS, MakerDeposit, MakerRedeem, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketSuite, MaxBorrowAmount, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, OptimalRepaidAmountProps, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialLiquidationParams, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolQuotaKeeperContract, PoolSuite, PoolV310Contract, PrepareUpdateQuotasProps, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedRef, PriceFeedRegistry, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleV310Contract, PriceUpdate, PriceUpdatesCache, PythPriceFeed, QuotaMode, QuotaSlice, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWAFactoryData, RWAFactoryProtocol, RWAFactoryStateHuman, RWAInvestorData, RWARegistry, RWAState, RWAStateHuman, RWAUnderlyingData, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RampEvent, RateKeeperType, RedstonePriceFeedContract, SecuritizeCreditAccountData, SecuritizeDegenNFT, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, StrategyCollateralProps, StrategyRateInputs, Swap, type TimestampedCalldata, TokenAmount, TokenTransfer, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatePriceFeedsResult, UpshiftVaultAdapterContract, VaultDeposit, VelodromeV2RouterAdapterContract, VersionedAbi, WithdrawCollateral, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, ZeroPriceFeedContract, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, classifyCurveOperation, collateralPriceInUnderlying, createAdapter, createPriceOracle, createZapper, 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 };
|
|
161
|
+
export { AbstractAdapterContract, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterContractStateHuman, AdapterContractType, AdapterFactoryArgs, AdapterProtocolOperation, AdapterType, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BasicSwapCall, BoundedPriceFeedContract, CamelotPool, CamelotV3AdapterContract, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConstantPriceFeedContract, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, CreditAccountTokenQuota, CreditConfiguratorV310Contract, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, CreditSuiteStrategy, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DStokenData, DaiUsdsAdapterContract, DelayedWithdrawalClaim, DelayedWithdrawalRequest, ERC4626AdapterContract, ERC4626ReferralAdapterContract, Erc4626PriceFeedContract, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, GaugeParams, GetInvestorOptions, GetOpenAccountRequirementsProps, GetReward, IAdapterContract, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IDegenNFT, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, IPoolContract, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTask, type IPriceUpdater, IRWAFactory, IRateKeeperContract, type IUpdatablePriceFeedContract, IZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, InterestRateModelType, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, type LatestUpdate, LegacyAdapterOperation, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, LiquidationFees, MAX_LEVERAGE_BUFFER_BPS, MakerDeposit, MakerRedeem, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketSuite, MaxBorrowAmount, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, OptimalRepaidAmountProps, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialLiquidationParams, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolQuotaKeeperContract, PoolSuite, PoolV310Contract, PrepareUpdateQuotasProps, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedRef, PriceFeedRegistry, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleV310Contract, PriceUpdate, PriceUpdatesCache, PythPriceFeed, QuotaMode, QuotaSlice, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWAFactoryData, RWAFactoryProtocol, RWAFactoryStateHuman, RWAInvestorData, RWARegistry, RWAState, RWAStateHuman, RWAUnderlyingData, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RampEvent, RateKeeperType, RedstonePriceFeedContract, SecuritizeCreditAccountData, SecuritizeDegenNFT, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, StrategyCollateralProps, StrategyRateInputs, Swap, type TimestampedCalldata, TokenAmount, TokenTransfer, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatePriceFeedsResult, UpshiftVaultAdapterContract, VaultDeposit, VelodromeV2RouterAdapterContract, VersionedAbi, WithdrawCollateral, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, ZeroPriceFeedContract, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, classifyCurveOperation, collateralPriceInUnderlying, createAdapter, createPriceOracle, createZapper, 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 };
|
|
@@ -494,6 +494,8 @@ declare class PoolQuotaKeeperV310Contract extends BaseContract<abi> implements I
|
|
|
494
494
|
/**
|
|
495
495
|
* How much more quota the market will take for a token, in the underlying.
|
|
496
496
|
* `0n` when the market has no quota entry; not the same as {@link hasActiveQuota}.
|
|
497
|
+
* Never negative: a limit lowered under what is already quoted leaves no
|
|
498
|
+
* room, not a debt.
|
|
497
499
|
*/
|
|
498
500
|
quotaAvailable(token: Address): bigint;
|
|
499
501
|
/**
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ChainId } from "../model/primitives.js";
|
|
2
|
+
import { DataResponse } from "../model/response.js";
|
|
3
|
+
import "../model/index.js";
|
|
4
|
+
import { PluginsMap } from "../onchain/plugins/types.js";
|
|
5
|
+
import { MultichainSDK } from "../onchain/MultichainSDK.js";
|
|
6
|
+
import { MultichainConstruct } from "../onchain/base/MultichainConstruct.js";
|
|
7
|
+
import "../onchain/index.js";
|
|
8
|
+
import { Reward } from "./types.js";
|
|
9
|
+
import { Address } from "viem";
|
|
10
|
+
//#region src/rewards/RewardsService.d.ts
|
|
11
|
+
interface RewardsServiceKeys {
|
|
12
|
+
/** Raises Merkl's rate limit; the keyless path answers too. */
|
|
13
|
+
merklApiKey?: string;
|
|
14
|
+
/** Turtle is skipped without one: its API answers no keyless request. */
|
|
15
|
+
turtleApiKey?: string;
|
|
16
|
+
}
|
|
17
|
+
declare class RewardsService<const Plugins extends PluginsMap = {}> extends MultichainConstruct<Plugins> {
|
|
18
|
+
#private;
|
|
19
|
+
constructor(sdk: MultichainSDK<Plugins>, keys?: RewardsServiceKeys);
|
|
20
|
+
/**
|
|
21
|
+
* Every claimable reward a wallet holds — Merkl campaigns and the Gearbox
|
|
22
|
+
* organisation's Turtle streams — across the chains the handle carries.
|
|
23
|
+
* A chain is `status: "error"` only when every source failed on it; a chain
|
|
24
|
+
* with nothing to claim is a `"success"` with no rewards.
|
|
25
|
+
**/
|
|
26
|
+
list(wallet: Address, chainIds?: ChainId[]): Promise<DataResponse<Reward[]>>;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { RewardsService };
|
|
@@ -3,7 +3,7 @@ import "../model/index.js";
|
|
|
3
3
|
import { BaseError } from "viem";
|
|
4
4
|
//#region src/rewards/errors.d.ts
|
|
5
5
|
/**
|
|
6
|
-
* Thrown when
|
|
6
|
+
* Thrown when Merkl did not answer for a chain.
|
|
7
7
|
*
|
|
8
8
|
* Everything a reader needs is in the message: this error travels to consumers
|
|
9
9
|
* inside a chain's {@link ChainFailed} metadata, where it is typed `unknown`
|
|
@@ -12,7 +12,7 @@ import { BaseError } from "viem";
|
|
|
12
12
|
declare class MerklRequestFailedError extends BaseError {
|
|
13
13
|
name: string;
|
|
14
14
|
readonly chainId: ChainId;
|
|
15
|
-
constructor(chainId: ChainId, path: string,
|
|
15
|
+
constructor(chainId: ChainId, path: string, cause: unknown);
|
|
16
16
|
}
|
|
17
17
|
/** Turtle answers for every chain at once, so this names no chain. */
|
|
18
18
|
declare class TurtleRequestFailedError extends BaseError {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Token } from "../model/primitives.js";
|
|
2
|
+
import "../model/index.js";
|
|
3
|
+
import { MerklReward, RewardsSdk } from "./types.js";
|
|
4
|
+
import { Address } from "viem";
|
|
5
|
+
//#region src/rewards/helpers.d.ts
|
|
6
|
+
/** A claimable amount of one token in one pool, before it is merged. */
|
|
7
|
+
interface RewardPart {
|
|
8
|
+
pool: Address;
|
|
9
|
+
poolToken: Token;
|
|
10
|
+
token: Token;
|
|
11
|
+
value: bigint;
|
|
12
|
+
/** USD price of one whole token, as the source sends it. */
|
|
13
|
+
price: number | string | null | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The pool a source names, and its share token. A v3.1 pool is its own
|
|
17
|
+
* ERC-4626 share token, so its address is the only token a campaign can name;
|
|
18
|
+
* the `AddressMap` owns the casing a source writes it in.
|
|
19
|
+
*/
|
|
20
|
+
declare function resolvePool(sdk: RewardsSdk): (address: string | undefined) => {
|
|
21
|
+
pool: `0x${string}`;
|
|
22
|
+
poolToken: Token;
|
|
23
|
+
} | undefined;
|
|
24
|
+
/** Sources send amounts as free-form strings, which `toBigInt` throws on. */
|
|
25
|
+
declare function parseAmount(value: string | undefined): bigint | undefined;
|
|
26
|
+
/** What is left of `total` after `claimed`, when anything is. */
|
|
27
|
+
declare function remaining(total: bigint | undefined, claimed: bigint | undefined): bigint | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* An incentive token is rarely protocol collateral, so the registry usually
|
|
30
|
+
* has no entry for it — and both sources always name it.
|
|
31
|
+
*/
|
|
32
|
+
declare function toRewardToken(sdk: RewardsSdk, address: Address, named: {
|
|
33
|
+
symbol: string;
|
|
34
|
+
name?: string;
|
|
35
|
+
decimals: number;
|
|
36
|
+
}): Token;
|
|
37
|
+
/**
|
|
38
|
+
* One reward per pool and incentive token, at the last part's price. Amounts
|
|
39
|
+
* are summed raw and priced once at the end — pricing each part and adding the results would round
|
|
40
|
+
* every one of them.
|
|
41
|
+
*/
|
|
42
|
+
declare function mergeRewards(sdk: RewardsSdk, source: MerklReward["source"], parts: readonly RewardPart[]): MerklReward[];
|
|
43
|
+
//#endregion
|
|
44
|
+
export { RewardPart, mergeRewards, parseAmount, remaining, resolvePool, toRewardToken };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { MerklReward, PointsReward, Reward } from "./types.js";
|
|
2
|
+
import { RewardsService } from "./RewardsService.js";
|
|
1
3
|
import { MerklRequestFailedError, TurtleRequestFailedError } from "./errors.js";
|
|
2
4
|
import { MerkleXYZUserRewardsV4Response } from "./merkl-api.js";
|
|
3
|
-
import { MerklReward, PointsReward, Reward } from "./toMerklRewards.js";
|
|
4
|
-
import { GetRewardsMultichainProps, getRewardsMultichain } from "./multichain.js";
|
|
5
5
|
import { TurtleWalletRewards } from "./turtle-api.js";
|
|
6
|
-
export {
|
|
6
|
+
export { MerklRequestFailedError, type MerklReward, type MerkleXYZUserRewardsV4Response, type PointsReward, type Reward, RewardsService, TurtleRequestFailedError, type TurtleWalletRewards };
|
|
@@ -38,10 +38,6 @@ interface MerkleXYZChain {
|
|
|
38
38
|
name: string;
|
|
39
39
|
icon: string;
|
|
40
40
|
}
|
|
41
|
-
/**
|
|
42
|
-
* Merkl's own host and the Angle mirror, tried in this order.
|
|
43
|
-
*/
|
|
44
|
-
declare const MERKL_DOMAINS: readonly ["https://api.merkl.xyz", "https://api-merkl.angle.money"];
|
|
45
41
|
declare const MERKL_API_KEY_HEADER = "X-API-Key";
|
|
46
42
|
interface FetchMerklUserRewardsProps {
|
|
47
43
|
chainId: ChainId;
|
|
@@ -53,12 +49,11 @@ interface FetchMerklUserRewardsProps {
|
|
|
53
49
|
/**
|
|
54
50
|
* The wallet's raw Merkl rewards on one chain.
|
|
55
51
|
*
|
|
56
|
-
* Rejects with {@link MerklRequestFailedError} when
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* was never established.
|
|
52
|
+
* Rejects with {@link MerklRequestFailedError} when Merkl does not answer, so a
|
|
53
|
+
* caller can tell an unreachable Merkl from a wallet with nothing to claim. A
|
|
54
|
+
* non-2xx counts as no answer: it carries no rewards either way, and treating
|
|
55
|
+
* it as success would report emptiness that was never established.
|
|
61
56
|
*/
|
|
62
57
|
declare function fetchMerklUserRewards({ chainId, user, apiKey }: FetchMerklUserRewardsProps): Promise<MerkleXYZUserRewardsV4Response>;
|
|
63
58
|
//#endregion
|
|
64
|
-
export { FetchMerklUserRewardsProps, MERKL_API_KEY_HEADER,
|
|
59
|
+
export { FetchMerklUserRewardsProps, MERKL_API_KEY_HEADER, MerkleXYZUserRewardsV4, MerkleXYZUserRewardsV4Response, fetchMerklUserRewards };
|
|
@@ -1,54 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PointsProgramPnL } from "../model/positions.js";
|
|
3
|
-
import "../model/index.js";
|
|
4
|
-
import { OnchainSDK } from "../onchain/OnchainSDK.js";
|
|
5
|
-
import "../onchain/index.js";
|
|
1
|
+
import { MerklReward, RewardsSdk } from "./types.js";
|
|
6
2
|
import { MerkleXYZUserRewardsV4Response } from "./merkl-api.js";
|
|
7
|
-
import { Address } from "viem";
|
|
8
3
|
//#region src/rewards/toMerklRewards.d.ts
|
|
9
4
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* reassembles one out of the loose fields Merkl sends.
|
|
14
|
-
*/
|
|
15
|
-
interface MerklReward {
|
|
16
|
-
/** Where the reward is claimed. */
|
|
17
|
-
readonly source: "merkl" | "turtle";
|
|
18
|
-
readonly chainId: ChainId;
|
|
19
|
-
/** Market pool whose depositors the campaign rewards. */
|
|
20
|
-
readonly pool: Address;
|
|
21
|
-
/** That pool's share token — what the campaign is keyed on. */
|
|
22
|
-
readonly poolToken: Token;
|
|
23
|
-
/**
|
|
24
|
-
* The incentive token being handed out, how much of it is claimable
|
|
25
|
-
* (distributed minus already claimed, always > 0) and what that is worth.
|
|
26
|
-
*
|
|
27
|
-
* Priced by Merkl, not by the market oracles: a campaign's incentive token
|
|
28
|
-
* is rarely collateral in the pool it incentivises, so the oracles usually
|
|
29
|
-
* do not know it — GEAR, which most Gearbox campaigns pay in, among them.
|
|
30
|
-
* `valueUsd` is `null` for a token Merkl does not price either.
|
|
31
|
-
*/
|
|
32
|
-
readonly amount: TokenAmount;
|
|
33
|
-
}
|
|
34
|
-
/** Points have no token and no price, and are not claimed. */
|
|
35
|
-
interface PointsReward extends Omit<MerklReward, "amount"> {
|
|
36
|
-
readonly points: PointsProgramPnL;
|
|
37
|
-
}
|
|
38
|
-
type Reward = MerklReward | PointsReward;
|
|
39
|
-
type RewardsSdk = Pick<OnchainSDK, "chainId" | "marketRegister" | "tokensMeta">;
|
|
40
|
-
/**
|
|
41
|
-
* Merkl's answer for one chain, turned into rows of the read model.
|
|
5
|
+
* Merkl's answer for one chain, one reward per pool and incentive token.
|
|
6
|
+
* A breakdown Merkl cannot be read from is skipped rather than thrown on: it
|
|
7
|
+
* must not sink the chain, which the caller would then be told is unreachable.
|
|
42
8
|
*/
|
|
43
9
|
declare function toMerklRewards(sdk: RewardsSdk, response: MerkleXYZUserRewardsV4Response): MerklReward[];
|
|
44
|
-
/**
|
|
45
|
-
* An incentive token is rarely protocol collateral, so the registry usually
|
|
46
|
-
* has no entry for it — and both sources always name it.
|
|
47
|
-
*/
|
|
48
|
-
declare function toRewardToken(sdk: RewardsSdk, address: Address, named: {
|
|
49
|
-
symbol: string;
|
|
50
|
-
name?: string;
|
|
51
|
-
decimals: number;
|
|
52
|
-
}): Token;
|
|
53
10
|
//#endregion
|
|
54
|
-
export {
|
|
11
|
+
export { toMerklRewards };
|