@gearbox-protocol/sdk 14.12.0-next.67 → 14.12.0-next.69
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/model/index.js +13 -0
- package/dist/cjs/model/liquidations.schema.js +3 -1
- package/dist/cjs/model/opportunities.schema.js +10 -7
- package/dist/cjs/model/positions.schema.js +120 -0
- package/dist/cjs/sdk/accounts/liquidations/LiquidationsService.js +19 -8
- package/dist/cjs/sdk/market/MarketSuite.js +8 -12
- package/dist/cjs/sdk/market/credit/CreditSuite.js +4 -14
- package/dist/cjs/sdk/opportunities/OpportunitiesService.js +8 -63
- package/dist/cjs/sdk/router/RouterV310Contract.js +34 -0
- package/dist/esm/dev/AccountOpener.js +1 -1
- package/dist/esm/dev/withdrawalUtils.js +1 -1
- package/dist/esm/model/index.js +3 -1
- package/dist/esm/model/liquidations.schema.js +3 -1
- package/dist/esm/model/opportunities.schema.js +10 -7
- package/dist/esm/model/positions.schema.js +109 -0
- package/dist/esm/preview/simulate/simulatePoolOperation.js +1 -1
- package/dist/esm/preview/trace/extractTransfers.js +1 -1
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +2 -2
- package/dist/esm/sdk/accounts/liquidations/LiquidationsService.js +20 -9
- package/dist/esm/sdk/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +1 -1
- package/dist/esm/sdk/base/TokensMeta.js +2 -2
- package/dist/esm/sdk/chain/detectNetwork.js +1 -1
- package/dist/esm/sdk/core/createAddressProvider.js +1 -1
- package/dist/esm/sdk/market/MarketSuite.js +8 -12
- package/dist/esm/sdk/market/credit/CreditFacadeV310BaseContract.js +1 -1
- package/dist/esm/sdk/market/credit/CreditSuite.js +5 -15
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +1 -1
- package/dist/esm/sdk/market/zapper/IETHZapperContract.js +1 -1
- package/dist/esm/sdk/market/zapper/ZapperContract.js +1 -1
- package/dist/esm/sdk/opportunities/OpportunitiesService.js +8 -63
- package/dist/esm/sdk/pools/PoolService.js +1 -1
- package/dist/esm/sdk/router/RouterV310Contract.js +34 -0
- package/dist/esm/sdk/utils/viem/simulateWithPriceUpdates.js +1 -1
- package/dist/types/model/index.d.ts +3 -1
- package/dist/types/model/liquidations.d.ts +9 -1
- package/dist/types/model/liquidations.schema.d.ts +5 -3
- package/dist/types/model/opportunities.d.ts +70 -29
- package/dist/types/model/opportunities.schema.d.ts +220 -249
- package/dist/types/model/positions.d.ts +239 -3
- package/dist/types/model/positions.schema.d.ts +701 -0
- package/dist/types/model/primitives.d.ts +3 -2
- package/dist/types/sdk/index.d.ts +3 -3
- package/dist/types/sdk/market/MarketSuite.d.ts +4 -15
- package/dist/types/sdk/market/credit/CreditSuite.d.ts +3 -7
- package/dist/types/sdk/market/index.d.ts +2 -2
- package/dist/types/sdk/opportunities/OpportunitiesService.d.ts +6 -11
- package/dist/types/sdk/router/RouterV310Contract.d.ts +5 -1
- package/dist/types/sdk/router/index.d.ts +2 -2
- package/dist/types/sdk/router/types.d.ts +35 -1
- package/package.json +1 -1
|
@@ -52,11 +52,12 @@ type Bps = number;
|
|
|
52
52
|
type AssetType = "Stable" | "ETH" | "BTC";
|
|
53
53
|
/**
|
|
54
54
|
* Leverage as a plain multiplier, not a percentage and not in basis points.
|
|
55
|
+
* Floating point number.
|
|
55
56
|
*
|
|
56
57
|
* @example
|
|
57
58
|
* ```ts
|
|
58
|
-
* const
|
|
59
|
-
* const
|
|
59
|
+
* const leveraged: Leverage = 5.5;
|
|
60
|
+
* const unleveraged: Leverage = 1;
|
|
60
61
|
* ```
|
|
61
62
|
**/
|
|
62
63
|
type Leverage = number;
|
|
@@ -41,7 +41,7 @@ import { WatchBlocksAsyncParameters, WatchBlocksAsyncReturnType, watchBlocksAsyn
|
|
|
41
41
|
import "./utils/viem/index.js";
|
|
42
42
|
import { PHANTOM_TOKEN_SECURITIZE_REDEMPTION, RWA_FACTORY_SECURITIZE, RWA_LIQUIDATOR_SECURITIZE } from "./market/rwa/securitize/constants.js";
|
|
43
43
|
import { SecuritizeLiquidatorContract } from "./market/rwa/securitize/SecuritizeLiquidatorContract.js";
|
|
44
|
-
import { ClosePathBalances, FindBestClosePathProps, FindClaimAllRewardsProps, FindOneTokenPathProps, FindOpenStrategyPathProps, IRouterContract, OpenStrategyResult, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, SwapOperation } from "./router/types.js";
|
|
44
|
+
import { ClosePathBalances, FindBestClosePathProps, FindClaimAllRewardsProps, FindManyToOnePathProps, FindOneTokenPathProps, FindOpenStrategyPathProps, IRouterContract, OpenStrategyResult, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, SwapOperation } from "./router/types.js";
|
|
45
45
|
import { createRouter } from "./router/createRouter.js";
|
|
46
46
|
import { assetsMap } from "./router/helpers.js";
|
|
47
47
|
import { RouterV310Contract } from "./router/RouterV310Contract.js";
|
|
@@ -101,7 +101,7 @@ import { GaugeContract, GaugeParams } from "./market/pool/GaugeContract.js";
|
|
|
101
101
|
import { LinearInterestRateModelContract } from "./market/pool/LinearInterestRateModelContract.js";
|
|
102
102
|
import { PoolSuite } from "./market/pool/PoolSuite.js";
|
|
103
103
|
import { PoolV310Contract } from "./market/pool/PoolV310Contract.js";
|
|
104
|
-
import { MarketSuite, StrategyRef
|
|
104
|
+
import { MarketSuite, StrategyRef } from "./market/MarketSuite.js";
|
|
105
105
|
import { CreditSuite } from "./market/credit/CreditSuite.js";
|
|
106
106
|
import { ZapperData } from "./market/types.js";
|
|
107
107
|
import { IZapperContract, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem } from "./market/zapper/types.js";
|
|
@@ -157,4 +157,4 @@ import { LiquidationsService } from "./accounts/liquidations/LiquidationsService
|
|
|
157
157
|
import { MultichainLiquidationsService } from "./accounts/liquidations/MultichainLiquidationsService.js";
|
|
158
158
|
import "./accounts/index.js";
|
|
159
159
|
import { SDKOptions, attachOptionsSchema, onchainSDKOptionsSchema } from "./options.js";
|
|
160
|
-
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_RWA_COMPRESSOR, AP_TOKEN_COMPRESSOR, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountToCheck, AdapterData, AddCollateralProps, AddLiquidityProps, AddressMap, AddressProviderAddresses, AddressProviderState, AddressProviderV310Contract, type AddressProviderV3StateHuman, AddressSet, type AliasLossPolicyStateHuman, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, AssertAssignable, Asset, type AssetPriceFeedStateHuman, AssetsMap, AttachOptions, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, type BalancerWeightedPriceFeedStateHuman, BaseContract, BaseContractArgs, type BaseContractStateHuman, BaseParams, BasePlugin, type BasePriceFeedStateHuman, BaseState, BigIntMath, type BotListStateHuman, BotPermissions, type BoundedOracleStateHuman, BoundedPriceFeedContract, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, ChainConfig, ChainContractsRegister, ChainNotConfiguredError, ChainQueryProps, ChangeDeptProps, ClaimDelayedProps, ClaimFarmRewardsProps, ClaimableWithdrawal, ClientOptions, CloseCreditAccountProps, CloseCreditAccountResult, CloseOptions, ClosePathBalances, CompositePriceFeedContract, ConnectedBotData, type ConstantOracleStateHuman, Construct, ConstructOptions, type ContractMethod, ContractOrInterface, ContractParseError, ContractParseErrorOptions, type CoreStateHuman, CreditAccountData, CreditAccountDataPayload, CreditAccountFilter, CreditAccountOperationResult, CreditAccountServiceOptions, CreditAccountTokensSlice, CreditAccountsServiceV310, CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditConfiguratorV310Contract, CreditFacadeState, type CreditFacadeStateHuman, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerDebtParams, type CreditManagerDebtParamsHuman, CreditManagerFilter, CreditManagerOperationResult, CreditManagerState, type CreditManagerStateHuman, CreditManagerV310Contract, CreditSuite, CreditSuiteState, type CreditSuiteStateHuman, Curator, CurrentWithdrawals, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DStokenData, DUST_THRESHOLD, DefaultPartialLiquidationParams, DelayedAddCollateralIntent, DelayedCloseAccountIntent, DelayedDecreaseLeverageIntent, DelayedDepositAndIncreaseLeverageIntent, DelayedDepositIntent, DelayedIncreaseLeverageIntent, DelayedIntent, DelayedIntentExtended, DelayedWithdrawCollateralIntent, DelegatedMulticall, DepositMetadata, EncodableCreditAccountOperation, Erc4626PriceFeedContract, EstimateRawTxGasParameters, EtherscanURLParam, ExecuteSwapProps, ExternalPriceFeedContract, type FetchPythPayloadsOptions, type FetchRedstonePayloadsOptions, FilterDustUSDOptions, FindBestClosePathProps, FindClaimAllRewardsProps, FindOneTokenPathProps, FindOpenStrategyPathProps, FormatBNOptions, FullyLiquidateProps, FullyLiquidateResult, GaugeContract, GaugeData, GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, type GearStakingV3StateHuman, GearboxChain, type GearboxState, type GearboxStateHuman, GetApprovalAddressProps, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetLiquidatableAccountsProps, GetLiquidatableAccountsPropsBase, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetOpenAccountRequirementsProps, GetPendingWithdrawalsProps, GetPendingWithdrawalsResult, GetWithdrawalRequestResultProps, HydrateOptions, IAdapterContract, IAddressProviderContract, IBaseContract, ICreditAccountsService, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, type ILogger, IOnchainSDKPlugin, IOnchainSDKPluginConstructor, IPluginState, IPoolContract, IPoolsService, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTx, IRWAFactory, IRateKeeperContract, IRedemptionLoggerContract, IRouterContract, IUpdatablePriceFeedContract, IWithdrawalCompressorContract, IZapperContract, type InterestRateModelStateHuman, InterestRateModelType, InvalidDelayedIntentError, IsDustOptions, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LPMonopolizedPoolMeta, type LPPriceFeedStateHuman, LatestUpdate, LinearInterestRateModelContract, type LinearInterestRateModelStateHuman, LiquidationsService, LoadRWALiquidatorsProps, type LogFn, type LossPolicyStateHuman, MAX_INT, MAX_UINT16, MAX_UINT256, MIN_INT96, MULTICALL_ADDRESS, MarketData, MarketFilter, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, type MarketStateHuman, MarketSuite, MarketType, MellowLRTPriceFeedContract, Methods, MidasLiquidatorContract, MissingSerializedParamsError, type MultiCall, MultichainAttachOptions, MultichainConstruct, MultichainHydrateOptions, MultichainLiquidationsService, type MultichainNetworkMeta, type MultichainNetworkProps, type MultichainNetworksProps, MultichainOpportunitiesService, type MultichainResult, MultichainSDK, MultichainSDKOptions, type MultichainState, type MultichainStateHuman, MultichainSyncStateOptions, NATIVE_ADDRESS, NOT_DEPLOYED, NO_VERSION, NetworkType, OnDemandPriceUpdates, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OnchainSDK, OnchainSDKOptions, OpenCAProps, OpenStrategyResult, OpportunitiesService, 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, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PartialRecord, PartiallyLiquidateProps, PendingWithdrawal, PendleTWAPPTPriceFeed, PeripheryContract, PermitResult, PhantomTokenContractType, PhantomTokenMeta, PickSomeRequired, PlaceholderAdapterContract, PlaceholderAdapterContractOptions, PlaceholderContract, PluginFactoriesMap, PluginFactory, PluginState, PluginStateVersionError, PluginStatesMap, PluginsMap, PoolQuotaKeeperContract, type PoolQuotaKeeperStateHuman, PoolService, PoolServiceCall, PoolServiceCallResult, PoolState, type PoolStateHuman, PoolSuite, type PoolSuiteStateHuman, PoolV310Contract, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, PriceFeedAnswer, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, PriceFeedRegisterHooks, PriceFeedRegisterOptions, type PriceFeedStateHuman, PriceFeedTreeNode, PriceFeedUsageType, PriceFeedsForTokensOptions, PriceOracleData, type PriceOracleStateHuman, PriceOracleV310Contract, PriceUpdate, PythPriceFeed, QuotaKeeperState, type QuotaParamsHuman, QuotaState, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWADefaultTokenMeta, RWAFactoryData, RWAFactoryStateHuman, RWAFactoryType, RWAInvestorData, RWALiquidatorInfo, RWAMissingOpenAccountRequirements, RWAOnDemandLPMeta, RWAOnDemandLPMonopolizedMeta, RWAOnDemandLpContractType, RWAOnDemandTokenMeta, RWAOpenAccountRequirements, RWAOperationArgs, RWARegistry, RWAState, RWAStateHuman, RWATokenMeta, RWAUnderlyingContractType, RWAUnderlyingData, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, 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, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, RelaxedBaseParams, RemoveLiquidityProps, RepayAndLiquidateCreditAccountProps, RepayCreditAccountProps, RequestableWithdrawal, RetryOptions, RewardInfo, Rewards, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, RouterV310Contract, SDKConstruct, SDKOptions, SECONDS_PER_YEAR, SECURITIZE_REGISTER_VAULT_TYPES, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeCreditAccountData, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature, SendRawTxParameters, SetBotProps, SimpleTokenMeta, SimulateCallOptions, SimulateCallParameters, SimulateCallReturnType, SimulateMulticallParameters, SimulateMulticallReturnType, SimulateWithPriceUpdatesError, SimulateWithPriceUpdatesErrorParams, SimulateWithPriceUpdatesErrorType, SimulateWithPriceUpdatesParameters, SimulateWithPriceUpdatesReturnType, SimulationError, SimulationErrorType, StartDelayedWithdrawalProps, StrategyRef, StrategyTotalsLookup, SunsetStrategy, SupportedValue, SwapOperation, SyncStateOptions, type TimestampedCalldata, TokenInfo, TokenMetaData, TokensMeta, type TumblerStateHuman, TypedObjectUtils, Unarray, UnsupportedZapperFunctionError, UpdatePriceFeedsResult, UpdateQuotasProps, VERSION_RANGE_310, VersionRange, VotingContractStatus, WAD, WAD_DECIMALS_POW, WatchBlocksAsyncParameters, WatchBlocksAsyncReturnType, type WithMultichain, WithdrawCollateralProps, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalMetadata, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, WstETHPriceFeedContract, YearnPriceFeedContract, ZapperContract, ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, ZodAddress, ZodHex, additionalBorrowApyBps, assetsMap, attachOptionsSchema, borrowApyBps, botPermissionsToString, bytes32ToString, chains, childLogger, createAdapter, createAddressProvider, createPriceOracle, createRawTx, createRedemptionLogger, createRouter, createWithdrawalCompressor, createZapper, decodeDelayedIntent, detectNetwork, encodeDelayedIntent, estimateRawTxGas, etherscanApiUrl, etherscanUrl, executeDelegatedMulticalls, fetchPythPayloads, fetchRedstonePayloads, filterDust, filterDustUSD, findCuratorMarketConfigurator, fmtBinaryMask, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAssetType, getCastTraceArgs, getChain, getCuratorName, getFunctionSignature, getNetworkType, getRawPriceUpdates, getSimulateWithPriceUpdatesError, getWithdrawalCompressorAddress, halfRAY, hexEq, hydrateAddressProvider, iCreditAccountAbi, isDust, isLPPriceFeed, isPublicNetwork, isRWAFactory, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, json_parse, json_stringify, maxLeverage, numberWithCommas, onchainSDKOptionsSchema, percentFmt, rayToBps, rayToNumber, retry, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, toAddress, toBN, toBigInt, toClaimableWithdrawal, toPendingWithdrawal, toRequestableWithdrawal, toSignificant, toWithdrawalStatus, usdToNumber, utilizationBps, watchBlocksAsync };
|
|
160
|
+
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_RWA_COMPRESSOR, AP_TOKEN_COMPRESSOR, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountToCheck, AdapterData, AddCollateralProps, AddLiquidityProps, AddressMap, AddressProviderAddresses, AddressProviderState, AddressProviderV310Contract, type AddressProviderV3StateHuman, AddressSet, type AliasLossPolicyStateHuman, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, AssertAssignable, Asset, type AssetPriceFeedStateHuman, AssetsMap, AttachOptions, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, type BalancerWeightedPriceFeedStateHuman, BaseContract, BaseContractArgs, type BaseContractStateHuman, BaseParams, BasePlugin, type BasePriceFeedStateHuman, BaseState, BigIntMath, type BotListStateHuman, BotPermissions, type BoundedOracleStateHuman, BoundedPriceFeedContract, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, ChainConfig, ChainContractsRegister, ChainNotConfiguredError, ChainQueryProps, ChangeDeptProps, ClaimDelayedProps, ClaimFarmRewardsProps, ClaimableWithdrawal, ClientOptions, CloseCreditAccountProps, CloseCreditAccountResult, CloseOptions, ClosePathBalances, CompositePriceFeedContract, ConnectedBotData, type ConstantOracleStateHuman, Construct, ConstructOptions, type ContractMethod, ContractOrInterface, ContractParseError, ContractParseErrorOptions, type CoreStateHuman, CreditAccountData, CreditAccountDataPayload, CreditAccountFilter, CreditAccountOperationResult, CreditAccountServiceOptions, CreditAccountTokensSlice, CreditAccountsServiceV310, CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditConfiguratorV310Contract, CreditFacadeState, type CreditFacadeStateHuman, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerDebtParams, type CreditManagerDebtParamsHuman, CreditManagerFilter, CreditManagerOperationResult, CreditManagerState, type CreditManagerStateHuman, CreditManagerV310Contract, CreditSuite, CreditSuiteState, type CreditSuiteStateHuman, Curator, CurrentWithdrawals, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DStokenData, DUST_THRESHOLD, DefaultPartialLiquidationParams, DelayedAddCollateralIntent, DelayedCloseAccountIntent, DelayedDecreaseLeverageIntent, DelayedDepositAndIncreaseLeverageIntent, DelayedDepositIntent, DelayedIncreaseLeverageIntent, DelayedIntent, DelayedIntentExtended, DelayedWithdrawCollateralIntent, DelegatedMulticall, DepositMetadata, EncodableCreditAccountOperation, Erc4626PriceFeedContract, EstimateRawTxGasParameters, EtherscanURLParam, ExecuteSwapProps, ExternalPriceFeedContract, type FetchPythPayloadsOptions, type FetchRedstonePayloadsOptions, FilterDustUSDOptions, FindBestClosePathProps, FindClaimAllRewardsProps, FindManyToOnePathProps, FindOneTokenPathProps, FindOpenStrategyPathProps, FormatBNOptions, FullyLiquidateProps, FullyLiquidateResult, GaugeContract, GaugeData, GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, type GearStakingV3StateHuman, GearboxChain, type GearboxState, type GearboxStateHuman, GetApprovalAddressProps, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetLiquidatableAccountsProps, GetLiquidatableAccountsPropsBase, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetOpenAccountRequirementsProps, GetPendingWithdrawalsProps, GetPendingWithdrawalsResult, GetWithdrawalRequestResultProps, HydrateOptions, IAdapterContract, IAddressProviderContract, IBaseContract, ICreditAccountsService, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, type ILogger, IOnchainSDKPlugin, IOnchainSDKPluginConstructor, IPluginState, IPoolContract, IPoolsService, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTx, IRWAFactory, IRateKeeperContract, IRedemptionLoggerContract, IRouterContract, IUpdatablePriceFeedContract, IWithdrawalCompressorContract, IZapperContract, type InterestRateModelStateHuman, InterestRateModelType, InvalidDelayedIntentError, IsDustOptions, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LPMonopolizedPoolMeta, type LPPriceFeedStateHuman, LatestUpdate, LinearInterestRateModelContract, type LinearInterestRateModelStateHuman, LiquidationsService, LoadRWALiquidatorsProps, type LogFn, type LossPolicyStateHuman, MAX_INT, MAX_UINT16, MAX_UINT256, MIN_INT96, MULTICALL_ADDRESS, MarketData, MarketFilter, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, type MarketStateHuman, MarketSuite, MarketType, MellowLRTPriceFeedContract, Methods, MidasLiquidatorContract, MissingSerializedParamsError, type MultiCall, MultichainAttachOptions, MultichainConstruct, MultichainHydrateOptions, MultichainLiquidationsService, type MultichainNetworkMeta, type MultichainNetworkProps, type MultichainNetworksProps, MultichainOpportunitiesService, type MultichainResult, MultichainSDK, MultichainSDKOptions, type MultichainState, type MultichainStateHuman, MultichainSyncStateOptions, NATIVE_ADDRESS, NOT_DEPLOYED, NO_VERSION, NetworkType, OnDemandPriceUpdates, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OnchainSDK, OnchainSDKOptions, OpenCAProps, OpenStrategyResult, OpportunitiesService, 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, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PartialRecord, PartiallyLiquidateProps, PendingWithdrawal, PendleTWAPPTPriceFeed, PeripheryContract, PermitResult, PhantomTokenContractType, PhantomTokenMeta, PickSomeRequired, PlaceholderAdapterContract, PlaceholderAdapterContractOptions, PlaceholderContract, PluginFactoriesMap, PluginFactory, PluginState, PluginStateVersionError, PluginStatesMap, PluginsMap, PoolQuotaKeeperContract, type PoolQuotaKeeperStateHuman, PoolService, PoolServiceCall, PoolServiceCallResult, PoolState, type PoolStateHuman, PoolSuite, type PoolSuiteStateHuman, PoolV310Contract, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, PriceFeedAnswer, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, PriceFeedRegisterHooks, PriceFeedRegisterOptions, type PriceFeedStateHuman, PriceFeedTreeNode, PriceFeedUsageType, PriceFeedsForTokensOptions, PriceOracleData, type PriceOracleStateHuman, PriceOracleV310Contract, PriceUpdate, PythPriceFeed, QuotaKeeperState, type QuotaParamsHuman, QuotaState, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWADefaultTokenMeta, RWAFactoryData, RWAFactoryStateHuman, RWAFactoryType, RWAInvestorData, RWALiquidatorInfo, RWAMissingOpenAccountRequirements, RWAOnDemandLPMeta, RWAOnDemandLPMonopolizedMeta, RWAOnDemandLpContractType, RWAOnDemandTokenMeta, RWAOpenAccountRequirements, RWAOperationArgs, RWARegistry, RWAState, RWAStateHuman, RWATokenMeta, RWAUnderlyingContractType, RWAUnderlyingData, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, 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, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, RelaxedBaseParams, RemoveLiquidityProps, RepayAndLiquidateCreditAccountProps, RepayCreditAccountProps, RequestableWithdrawal, RetryOptions, RewardInfo, Rewards, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, RouterV310Contract, SDKConstruct, SDKOptions, SECONDS_PER_YEAR, SECURITIZE_REGISTER_VAULT_TYPES, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeCreditAccountData, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature, SendRawTxParameters, SetBotProps, SimpleTokenMeta, SimulateCallOptions, SimulateCallParameters, SimulateCallReturnType, SimulateMulticallParameters, SimulateMulticallReturnType, SimulateWithPriceUpdatesError, SimulateWithPriceUpdatesErrorParams, SimulateWithPriceUpdatesErrorType, SimulateWithPriceUpdatesParameters, SimulateWithPriceUpdatesReturnType, SimulationError, SimulationErrorType, StartDelayedWithdrawalProps, StrategyRef, SunsetStrategy, SupportedValue, SwapOperation, SyncStateOptions, type TimestampedCalldata, TokenInfo, TokenMetaData, TokensMeta, type TumblerStateHuman, TypedObjectUtils, Unarray, UnsupportedZapperFunctionError, UpdatePriceFeedsResult, UpdateQuotasProps, VERSION_RANGE_310, VersionRange, VotingContractStatus, WAD, WAD_DECIMALS_POW, WatchBlocksAsyncParameters, WatchBlocksAsyncReturnType, type WithMultichain, WithdrawCollateralProps, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalMetadata, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, WstETHPriceFeedContract, YearnPriceFeedContract, ZapperContract, ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, ZodAddress, ZodHex, additionalBorrowApyBps, assetsMap, attachOptionsSchema, borrowApyBps, botPermissionsToString, bytes32ToString, chains, childLogger, createAdapter, createAddressProvider, createPriceOracle, createRawTx, createRedemptionLogger, createRouter, createWithdrawalCompressor, createZapper, decodeDelayedIntent, detectNetwork, encodeDelayedIntent, estimateRawTxGas, etherscanApiUrl, etherscanUrl, executeDelegatedMulticalls, fetchPythPayloads, fetchRedstonePayloads, filterDust, filterDustUSD, findCuratorMarketConfigurator, fmtBinaryMask, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAssetType, getCastTraceArgs, getChain, getCuratorName, getFunctionSignature, getNetworkType, getRawPriceUpdates, getSimulateWithPriceUpdatesError, getWithdrawalCompressorAddress, halfRAY, hexEq, hydrateAddressProvider, iCreditAccountAbi, isDust, isLPPriceFeed, isPublicNetwork, isRWAFactory, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, json_parse, json_stringify, maxLeverage, numberWithCommas, onchainSDKOptionsSchema, percentFmt, rayToBps, rayToNumber, retry, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, toAddress, toBN, toBigInt, toClaimableWithdrawal, toPendingWithdrawal, toRequestableWithdrawal, toSignificant, toWithdrawalStatus, usdToNumber, utilizationBps, watchBlocksAsync };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Curator, Token } from "../../model/primitives.js";
|
|
2
2
|
import { MarketData } from "../base/types.js";
|
|
3
3
|
import { Opportunity, OpportunityFilter, PoolOpportunity, PoolOpportunityDetail, PriceFeedSummary, QuotaAsset, StrategyOpportunityDetail } from "../../model/opportunities.js";
|
|
4
4
|
import "../../model/index.js";
|
|
@@ -27,14 +27,6 @@ interface StrategyRef {
|
|
|
27
27
|
suite: CreditSuite;
|
|
28
28
|
collateral: Address;
|
|
29
29
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Resolves the summed worth of the credit accounts backing one strategy.
|
|
32
|
-
*
|
|
33
|
-
* Passed into the market rather than computed by it: establishing it takes a
|
|
34
|
-
* credit-account query that spans every market of a chain, so doing it per
|
|
35
|
-
* market would turn one query into many.
|
|
36
|
-
*/
|
|
37
|
-
type StrategyTotalsLookup = (creditManager: Address, collateral: Address) => Amount | undefined;
|
|
38
30
|
/**
|
|
39
31
|
* Aggregates all SDK wrappers that make up one Gearbox market.
|
|
40
32
|
*
|
|
@@ -158,14 +150,12 @@ declare class MarketSuite extends SDKConstruct {
|
|
|
158
150
|
* Every opportunity this market offers: its pool, plus one row per
|
|
159
151
|
* `(credit manager, target collateral)` pair.
|
|
160
152
|
*
|
|
161
|
-
* @param totals - Resolves the summed worth of the credit accounts backing a
|
|
162
|
-
* strategy, which only a credit-account query can establish.
|
|
163
153
|
* @param filter - Optional narrowing. A filter naming a kind skips building
|
|
164
154
|
* the other kind entirely; every built row is then checked in full by
|
|
165
155
|
* {@link matchesOpportunityFilter}, so there is one definition of what each
|
|
166
156
|
* criterion means.
|
|
167
157
|
*/
|
|
168
|
-
opportunities(
|
|
158
|
+
opportunities(filter?: OpportunityFilter): Opportunity[];
|
|
169
159
|
/**
|
|
170
160
|
* Passive lending into this market's pool, as the shared read model
|
|
171
161
|
* describes it.
|
|
@@ -189,10 +179,9 @@ declare class MarketSuite extends SDKConstruct {
|
|
|
189
179
|
*
|
|
190
180
|
* @param creditManager - Credit manager the position is opened in.
|
|
191
181
|
* @param collateral - Target collateral of the position.
|
|
192
|
-
* @param totalSupply - Summed worth of the credit accounts backing it.
|
|
193
182
|
* @throws If this market has no such strategy, see {@link mustFindStrategy}.
|
|
194
183
|
*/
|
|
195
|
-
strategyOpportunityDetail(creditManager: Address, collateral: Address
|
|
184
|
+
strategyOpportunityDetail(creditManager: Address, collateral: Address): StrategyOpportunityDetail;
|
|
196
185
|
/**
|
|
197
186
|
* Whether any child contract wrapper has observed events that require a
|
|
198
187
|
* market resync.
|
|
@@ -213,4 +202,4 @@ declare class MarketSuite extends SDKConstruct {
|
|
|
213
202
|
stateHuman(raw?: boolean): MarketStateHuman;
|
|
214
203
|
}
|
|
215
204
|
//#endregion
|
|
216
|
-
export { MarketSuite, StrategyRef
|
|
205
|
+
export { MarketSuite, StrategyRef };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Timestamp } from "../../../model/primitives.js";
|
|
2
2
|
import { CreditSuiteState } from "../../base/types.js";
|
|
3
3
|
import { StrategyOpportunity, StrategyOpportunityDetail } from "../../../model/opportunities.js";
|
|
4
4
|
import "../../../model/index.js";
|
|
@@ -120,19 +120,15 @@ declare class CreditSuite extends SDKConstruct {
|
|
|
120
120
|
* read model does.
|
|
121
121
|
*
|
|
122
122
|
* @param collateral - Target collateral of the position.
|
|
123
|
-
* @param totalSupply - Summed worth of the credit accounts backing it, which
|
|
124
|
-
* only a credit-account query can establish. Defaults to zero, so a caller
|
|
125
|
-
* that does not care about size can omit it.
|
|
126
123
|
* @throws If the credit manager does not value the collateral.
|
|
127
124
|
*/
|
|
128
|
-
strategyOpportunity(collateral: Address
|
|
125
|
+
strategyOpportunity(collateral: Address): StrategyOpportunity;
|
|
129
126
|
/**
|
|
130
127
|
* {@link strategyOpportunity} plus the data only its detail screen needs.
|
|
131
128
|
*
|
|
132
129
|
* @param collateral - Target collateral of the position.
|
|
133
|
-
* @param totalSupply - Summed worth of the credit accounts backing it.
|
|
134
130
|
*/
|
|
135
|
-
strategyOpportunityDetail(collateral: Address
|
|
131
|
+
strategyOpportunityDetail(collateral: Address): StrategyOpportunityDetail;
|
|
136
132
|
/**
|
|
137
133
|
* Whether the facade, manager, or configurator has observed logs that require
|
|
138
134
|
* a credit-suite resync.
|
|
@@ -53,7 +53,7 @@ import { LinearInterestRateModelContract } from "./pool/LinearInterestRateModelC
|
|
|
53
53
|
import { PoolSuite } from "./pool/PoolSuite.js";
|
|
54
54
|
import { PoolV310Contract } from "./pool/PoolV310Contract.js";
|
|
55
55
|
import "./pool/index.js";
|
|
56
|
-
import { MarketSuite, StrategyRef
|
|
56
|
+
import { MarketSuite, StrategyRef } from "./MarketSuite.js";
|
|
57
57
|
import { CreditSuite } from "./credit/CreditSuite.js";
|
|
58
58
|
import "./credit/index.js";
|
|
59
59
|
import { ZapperData } from "./types.js";
|
|
@@ -65,4 +65,4 @@ import { IERC20ZapperContract } from "./zapper/IERC20ZapperContract.js";
|
|
|
65
65
|
import { IETHZapperContract } from "./zapper/IETHZapperContract.js";
|
|
66
66
|
import "./zapper/index.js";
|
|
67
67
|
import { MarketRegister, MarketRegistryState, MarketRegistryStateHuman } from "./MarketRegister.js";
|
|
68
|
-
export { AbstractLPPriceFeedContract, AbstractPriceFeedContract, BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CompositePriceFeedContract, CreditConfiguratorV310Contract, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, DStokenData, Erc4626PriceFeedContract, ExternalPriceFeedContract, type FetchPythPayloadsOptions, type FetchRedstonePayloadsOptions, GaugeContract, GaugeParams, IAdapterContract, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, IPoolContract, IPriceFeedContract, IPriceOracleContract, IRWAFactory, IRateKeeperContract, IUpdatablePriceFeedContract, IZapperContract, InterestRateModelType, LatestUpdate, LinearInterestRateModelContract, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketSuite, MellowLRTPriceFeedContract, MidasLiquidatorContract, OnDemandPriceUpdates, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PendleTWAPPTPriceFeed, PlaceholderAdapterContract, PlaceholderAdapterContractOptions, PoolQuotaKeeperContract, PoolSuite, PoolV310Contract, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedRef, PriceFeedRegister, PriceFeedRegisterHooks, PriceFeedRegisterOptions, PriceFeedUsageType, PriceFeedsForTokensOptions, PriceOracleV310Contract, PriceUpdate, PythPriceFeed, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWAFactoryData, RWAFactoryStateHuman, RWAFactoryType, RWAInvestorData, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOperationArgs, RWARegistry, RWAState, RWAStateHuman, RWAUnderlyingData, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RampEvent, RateKeeperType, RedstonePriceFeedContract, SECURITIZE_REGISTER_VAULT_TYPES, SecuritizeCreditAccountData, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature, StrategyRef,
|
|
68
|
+
export { AbstractLPPriceFeedContract, AbstractPriceFeedContract, BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CompositePriceFeedContract, CreditConfiguratorV310Contract, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, DStokenData, Erc4626PriceFeedContract, ExternalPriceFeedContract, type FetchPythPayloadsOptions, type FetchRedstonePayloadsOptions, GaugeContract, GaugeParams, IAdapterContract, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, IPoolContract, IPriceFeedContract, IPriceOracleContract, IRWAFactory, IRateKeeperContract, IUpdatablePriceFeedContract, IZapperContract, InterestRateModelType, LatestUpdate, LinearInterestRateModelContract, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketSuite, MellowLRTPriceFeedContract, MidasLiquidatorContract, OnDemandPriceUpdates, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PendleTWAPPTPriceFeed, PlaceholderAdapterContract, PlaceholderAdapterContractOptions, PoolQuotaKeeperContract, PoolSuite, PoolV310Contract, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedRef, PriceFeedRegister, PriceFeedRegisterHooks, PriceFeedRegisterOptions, PriceFeedUsageType, PriceFeedsForTokensOptions, PriceOracleV310Contract, PriceUpdate, PythPriceFeed, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWAFactoryData, RWAFactoryStateHuman, RWAFactoryType, RWAInvestorData, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOperationArgs, RWARegistry, RWAState, RWAStateHuman, RWAUnderlyingData, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RampEvent, RateKeeperType, RedstonePriceFeedContract, SECURITIZE_REGISTER_VAULT_TYPES, SecuritizeCreditAccountData, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature, StrategyRef, type TimestampedCalldata, UnsupportedZapperFunctionError, UpdatePriceFeedsResult, WstETHPriceFeedContract, YearnPriceFeedContract, ZapperContract, ZapperData, ZeroPriceFeedContract, createAdapter, createPriceOracle, createZapper, fetchPythPayloads, fetchRedstonePayloads, getRawPriceUpdates, isLPPriceFeed, isRWAFactory, isUpdatablePriceFeed };
|
|
@@ -6,25 +6,20 @@ import "../base/index.js";
|
|
|
6
6
|
/**
|
|
7
7
|
* Builds the `opportunities` read model from the chain.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* the
|
|
9
|
+
* Every value in a row is market state the SDK already holds, so a list costs
|
|
10
|
+
* no RPC round-trip at all. Yield figures that fold in incentives, points or
|
|
11
|
+
* history are deliberately absent: they are the backend's job, and this service
|
|
12
|
+
* never guesses them. So is the size of a strategy — summing it takes a sweep
|
|
13
|
+
* over every credit account of the chain, which is too expensive for a list.
|
|
13
14
|
*
|
|
14
15
|
* The rows themselves are assembled by the market wrappers — see
|
|
15
16
|
* {@link MarketSuite.opportunities} — because every value in them is market
|
|
16
|
-
* state.
|
|
17
|
-
* much the credit accounts of a strategy are worth.
|
|
17
|
+
* state. This service only picks the markets and applies the filter.
|
|
18
18
|
**/
|
|
19
19
|
declare class OpportunitiesService extends SDKConstruct {
|
|
20
|
-
#private;
|
|
21
20
|
/**
|
|
22
21
|
* Every pool and strategy of every loaded market on this chain.
|
|
23
22
|
*
|
|
24
|
-
* Strategies are measured by the value locked in their credit accounts, so
|
|
25
|
-
* the list issues one credit-account query unless the filter rules strategies
|
|
26
|
-
* out entirely.
|
|
27
|
-
*
|
|
28
23
|
* @param filter - Optional narrowing, applied to the built rows.
|
|
29
24
|
**/
|
|
30
25
|
list(filter?: OpportunityFilter): Promise<Opportunity[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FindBestClosePathProps, FindClaimAllRewardsProps, FindOneTokenPathProps, FindOpenStrategyPathProps, IRouterContract, OpenStrategyResult, RouterCloseResult, RouterResult, RouterRewardsResult } from "./types.js";
|
|
1
|
+
import { FindBestClosePathProps, FindClaimAllRewardsProps, FindManyToOnePathProps, FindOneTokenPathProps, FindOpenStrategyPathProps, IRouterContract, OpenStrategyResult, RouterCloseResult, RouterResult, RouterRewardsResult } from "./types.js";
|
|
2
2
|
import { AbstractRouterContract } from "./AbstractRouterContract.js";
|
|
3
3
|
import { OnchainSDK } from "../OnchainSDK.js";
|
|
4
4
|
import { Address } from "viem";
|
|
@@ -899,6 +899,10 @@ declare class RouterV310Contract extends AbstractRouterContract<abi> implements
|
|
|
899
899
|
* {@inheritDoc IRouterContract.findOneTokenPath}
|
|
900
900
|
**/
|
|
901
901
|
findOneTokenPath(props: FindOneTokenPathProps): Promise<RouterResult>;
|
|
902
|
+
/**
|
|
903
|
+
* {@inheritDoc IRouterContract.findManyToOnePath}
|
|
904
|
+
**/
|
|
905
|
+
findManyToOnePath(props: FindManyToOnePathProps): Promise<RouterResult>;
|
|
902
906
|
/**
|
|
903
907
|
* {@inheritDoc IRouterContract.findOpenStrategyPath}
|
|
904
908
|
**/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ClosePathBalances, FindBestClosePathProps, FindClaimAllRewardsProps, FindOneTokenPathProps, FindOpenStrategyPathProps, IRouterContract, OpenStrategyResult, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, SwapOperation } from "./types.js";
|
|
1
|
+
import { ClosePathBalances, FindBestClosePathProps, FindClaimAllRewardsProps, FindManyToOnePathProps, FindOneTokenPathProps, FindOpenStrategyPathProps, IRouterContract, OpenStrategyResult, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, SwapOperation } from "./types.js";
|
|
2
2
|
import { createRouter } from "./createRouter.js";
|
|
3
3
|
import { assetsMap } from "./helpers.js";
|
|
4
4
|
import { RouterV310Contract } from "./RouterV310Contract.js";
|
|
5
|
-
export { ClosePathBalances, FindBestClosePathProps, FindClaimAllRewardsProps, FindOneTokenPathProps, FindOpenStrategyPathProps, IRouterContract, OpenStrategyResult, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, RouterV310Contract, SwapOperation, assetsMap, createRouter };
|
|
5
|
+
export { ClosePathBalances, FindBestClosePathProps, FindClaimAllRewardsProps, FindManyToOnePathProps, FindOneTokenPathProps, FindOpenStrategyPathProps, IRouterContract, OpenStrategyResult, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, RouterV310Contract, SwapOperation, assetsMap, createRouter };
|
|
@@ -106,6 +106,32 @@ interface FindOneTokenPathProps {
|
|
|
106
106
|
*/
|
|
107
107
|
slippage: number | bigint;
|
|
108
108
|
}
|
|
109
|
+
interface FindManyToOnePathProps {
|
|
110
|
+
/**
|
|
111
|
+
* Minimal credit account data on which operation is performed.
|
|
112
|
+
*/
|
|
113
|
+
creditAccount: RouterCASlice;
|
|
114
|
+
/**
|
|
115
|
+
* Minimal credit manager data on which operation is performed.
|
|
116
|
+
*/
|
|
117
|
+
creditManager: RouterCMSlice;
|
|
118
|
+
/**
|
|
119
|
+
* Balances available at execution time.
|
|
120
|
+
*/
|
|
121
|
+
expectedBalances: Array<Asset>;
|
|
122
|
+
/**
|
|
123
|
+
* Balances that must remain on the account after routing.
|
|
124
|
+
*/
|
|
125
|
+
leftoverBalances: Array<Asset>;
|
|
126
|
+
/**
|
|
127
|
+
* Address of desired token to swap into.
|
|
128
|
+
*/
|
|
129
|
+
target: Address;
|
|
130
|
+
/**
|
|
131
|
+
* Slippage in PERCENTAGE_FORMAT (100% = 10_000) per operation.
|
|
132
|
+
*/
|
|
133
|
+
slippage: number | bigint;
|
|
134
|
+
}
|
|
109
135
|
interface FindOpenStrategyPathProps {
|
|
110
136
|
/**
|
|
111
137
|
* Minimal credit manager data on which operation is performed
|
|
@@ -219,6 +245,14 @@ interface IRouterContract extends IBaseContract {
|
|
|
219
245
|
* minimum, and the multi-call sequence to execute.
|
|
220
246
|
**/
|
|
221
247
|
findOneTokenPath: (props: FindOneTokenPathProps) => Promise<RouterResult>;
|
|
248
|
+
/**
|
|
249
|
+
* Find the best path for swapping one or more balances on an existing
|
|
250
|
+
* credit account into a target token while preserving explicit leftovers.
|
|
251
|
+
*
|
|
252
|
+
* @param props - {@link FindManyToOnePathProps}
|
|
253
|
+
* @returns The optimal swap result including amount, minimum and calls.
|
|
254
|
+
*/
|
|
255
|
+
findManyToOnePath: (props: FindManyToOnePathProps) => Promise<RouterResult>;
|
|
222
256
|
/**
|
|
223
257
|
* Find the best path for opening a credit account by converting all
|
|
224
258
|
* collateral (except leftovers) into a single target token.
|
|
@@ -248,4 +282,4 @@ interface IRouterContract extends IBaseContract {
|
|
|
248
282
|
findBestClosePath: (props: FindBestClosePathProps) => Promise<RouterCloseResult>;
|
|
249
283
|
}
|
|
250
284
|
//#endregion
|
|
251
|
-
export { ClosePathBalances, FindBestClosePathProps, FindClaimAllRewardsProps, FindOneTokenPathProps, FindOpenStrategyPathProps, IRouterContract, OpenStrategyResult, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, SwapOperation };
|
|
285
|
+
export { ClosePathBalances, FindBestClosePathProps, FindClaimAllRewardsProps, FindManyToOnePathProps, FindOneTokenPathProps, FindOpenStrategyPathProps, IRouterContract, OpenStrategyResult, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, SwapOperation };
|