@gearbox-protocol/sdk 16.6.0 → 16.6.2
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/dev/midasUtils.js +8 -5
- package/dist/cjs/onchain/OnchainSDK.js +3 -3
- package/dist/cjs/onchain/index.js +49 -38
- package/dist/cjs/onchain/market/index.js +49 -38
- package/dist/cjs/onchain/market/oracle/PriceOracleBaseContract.js +3 -3
- package/dist/cjs/onchain/market/pricefeeds/AbstractPriceFeed.js +0 -5
- package/dist/cjs/onchain/market/pricefeeds/PriceFeedRegistry.js +127 -0
- package/dist/cjs/onchain/market/pricefeeds/{BalancerStablePriceFeed.js → feeds/BalancerStablePriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{BalancerWeightedPriceFeed.js → feeds/BalancerWeightedPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{BoundedPriceFeed.js → feeds/BoundedPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{CompositePriceFeed.js → feeds/CompositePriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{ConstantPriceFeed.js → feeds/ConstantPriceFeed.js} +3 -3
- package/dist/cjs/onchain/market/pricefeeds/{CurveCryptoPriceFeed.js → feeds/CurveCryptoPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{CurveStablePriceFeed.js → feeds/CurveStablePriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{CurveUSDPriceFeed.js → feeds/CurveUSDPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{Erc4626PriceFeed.js → feeds/Erc4626PriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{ExternalPriceFeed.js → feeds/ExternalPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{MellowLRTPriceFeed.js → feeds/MellowLRTPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{PendleTWAPPTPriceFeed.js → feeds/PendleTWAPPTPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{PythPriceFeed.js → feeds/PythPriceFeed.js} +3 -3
- package/dist/cjs/onchain/market/pricefeeds/{RedstonePriceFeed.js → feeds/RedstonePriceFeed.js} +6 -6
- package/dist/cjs/onchain/market/pricefeeds/{WstETHPriceFeed.js → feeds/WstETHPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{YearnPriceFeed.js → feeds/YearnPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{ZeroPriceFeed.js → feeds/ZeroPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/feeds/index.js +35 -0
- package/dist/cjs/onchain/market/pricefeeds/index.js +51 -39
- package/dist/cjs/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.js +189 -0
- package/dist/cjs/onchain/market/pricefeeds/{getRawPriceUpdates.js → updates/getRawPriceUpdates.js} +2 -2
- package/dist/cjs/onchain/market/pricefeeds/updates/index.js +8 -0
- package/dist/cjs/onchain/market/pricefeeds/{isUpdatablePriceFeed.js → updates/isUpdatablePriceFeed.js} +1 -1
- package/dist/cjs/onchain/market/pricefeeds/updates/updatableDependencies.js +14 -0
- package/dist/cjs/permissionless/utils/price-update/get-price-update-tx.js +2 -2
- package/dist/cjs/permissionless/utils/price-update/get-updatable-feeds.js +2 -2
- package/dist/esm/dev/midasUtils.js +8 -5
- package/dist/esm/onchain/OnchainSDK.js +3 -3
- package/dist/esm/onchain/index.js +25 -20
- package/dist/esm/onchain/market/index.js +25 -20
- package/dist/esm/onchain/market/oracle/PriceOracleBaseContract.js +1 -1
- package/dist/esm/onchain/market/pricefeeds/AbstractPriceFeed.js +0 -5
- package/dist/esm/onchain/market/pricefeeds/PriceFeedRegistry.js +126 -0
- package/dist/esm/onchain/market/pricefeeds/{BalancerStablePriceFeed.js → feeds/BalancerStablePriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{BalancerWeightedPriceFeed.js → feeds/BalancerWeightedPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{BoundedPriceFeed.js → feeds/BoundedPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{CompositePriceFeed.js → feeds/CompositePriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{ConstantPriceFeed.js → feeds/ConstantPriceFeed.js} +3 -3
- package/dist/esm/onchain/market/pricefeeds/{CurveCryptoPriceFeed.js → feeds/CurveCryptoPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{CurveStablePriceFeed.js → feeds/CurveStablePriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{CurveUSDPriceFeed.js → feeds/CurveUSDPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{Erc4626PriceFeed.js → feeds/Erc4626PriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{ExternalPriceFeed.js → feeds/ExternalPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{MellowLRTPriceFeed.js → feeds/MellowLRTPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{PendleTWAPPTPriceFeed.js → feeds/PendleTWAPPTPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{PythPriceFeed.js → feeds/PythPriceFeed.js} +3 -3
- package/dist/esm/onchain/market/pricefeeds/{RedstonePriceFeed.js → feeds/RedstonePriceFeed.js} +6 -6
- package/dist/esm/onchain/market/pricefeeds/{WstETHPriceFeed.js → feeds/WstETHPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{YearnPriceFeed.js → feeds/YearnPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{ZeroPriceFeed.js → feeds/ZeroPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/feeds/index.js +18 -0
- package/dist/esm/onchain/market/pricefeeds/index.js +27 -21
- package/dist/esm/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.js +188 -0
- package/dist/esm/onchain/market/pricefeeds/{getRawPriceUpdates.js → updates/getRawPriceUpdates.js} +2 -2
- package/dist/esm/onchain/market/pricefeeds/updates/index.js +5 -1
- package/dist/esm/onchain/market/pricefeeds/{isUpdatablePriceFeed.js → updates/isUpdatablePriceFeed.js} +1 -1
- package/dist/esm/onchain/market/pricefeeds/updates/updatableDependencies.js +13 -0
- package/dist/esm/permissionless/utils/price-update/get-price-update-tx.js +1 -1
- package/dist/esm/permissionless/utils/price-update/get-updatable-feeds.js +1 -1
- package/dist/types/dev/midasUtils.d.ts +6 -2
- package/dist/types/onchain/OnchainSDK.d.ts +2 -2
- package/dist/types/onchain/index.d.ts +27 -22
- package/dist/types/onchain/market/index.d.ts +27 -22
- package/dist/types/onchain/market/oracle/PriceOracleBaseContract.d.ts +2 -1
- package/dist/types/onchain/market/oracle/types.d.ts +2 -1
- package/dist/types/onchain/market/pricefeeds/AbstractPriceFeed.d.ts +1 -2
- package/dist/types/onchain/market/pricefeeds/PriceFeedRegistry.d.ts +60 -0
- package/dist/types/onchain/market/pricefeeds/feeds/BalancerStablePriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/{BalancerWeightedPriceFeed.d.ts → feeds/BalancerWeightedPriceFeed.d.ts} +7 -7
- package/dist/types/onchain/market/pricefeeds/feeds/BoundedPriceFeed.d.ts +15 -0
- package/dist/types/onchain/market/pricefeeds/{CompositePriceFeed.d.ts → feeds/CompositePriceFeed.d.ts} +6 -6
- package/dist/types/onchain/market/pricefeeds/{ConstantPriceFeed.d.ts → feeds/ConstantPriceFeed.d.ts} +6 -6
- package/dist/types/onchain/market/pricefeeds/feeds/CurveCryptoPriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/CurveStablePriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/CurveUSDPriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/Erc4626PriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/ExternalPriceFeed.d.ts +11 -0
- package/dist/types/onchain/market/pricefeeds/feeds/MellowLRTPriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/{PendleTWAPPTPriceFeed.d.ts → feeds/PendleTWAPPTPriceFeed.d.ts} +3 -3
- package/dist/types/onchain/market/pricefeeds/{PythPriceFeed.d.ts → feeds/PythPriceFeed.d.ts} +3 -3
- package/dist/types/onchain/market/pricefeeds/{RedstonePriceFeed.d.ts → feeds/RedstonePriceFeed.d.ts} +9 -9
- package/dist/types/onchain/market/pricefeeds/feeds/WstETHPriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/YearnPriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/ZeroPriceFeed.d.ts +11 -0
- package/dist/types/onchain/market/pricefeeds/feeds/index.d.ts +18 -0
- package/dist/types/onchain/market/pricefeeds/index.d.ts +28 -22
- package/dist/types/onchain/market/pricefeeds/types.d.ts +1 -31
- package/dist/types/onchain/market/pricefeeds/updates/RedstoneUpdater.d.ts +1 -1
- package/dist/types/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.d.ts +106 -0
- package/dist/types/onchain/market/pricefeeds/updates/getRawPriceUpdates.d.ts +6 -0
- package/dist/types/onchain/market/pricefeeds/updates/index.d.ts +7 -3
- package/dist/types/onchain/market/pricefeeds/updates/isUpdatablePriceFeed.d.ts +6 -0
- package/dist/types/onchain/market/pricefeeds/updates/types.d.ts +56 -2
- package/dist/types/onchain/market/pricefeeds/updates/updatableDependencies.d.ts +10 -0
- package/package.json +1 -1
- package/dist/cjs/onchain/market/pricefeeds/PriceFeedsRegister.js +0 -301
- package/dist/esm/onchain/market/pricefeeds/PriceFeedsRegister.js +0 -300
- package/dist/types/onchain/market/pricefeeds/BalancerStablePriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/BoundedPriceFeed.d.ts +0 -15
- package/dist/types/onchain/market/pricefeeds/CurveCryptoPriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/CurveStablePriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/CurveUSDPriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/Erc4626PriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/ExternalPriceFeed.d.ts +0 -11
- package/dist/types/onchain/market/pricefeeds/MellowLRTPriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/PriceFeedsRegister.d.ts +0 -180
- package/dist/types/onchain/market/pricefeeds/WstETHPriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/YearnPriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/ZeroPriceFeed.d.ts +0 -11
- package/dist/types/onchain/market/pricefeeds/getRawPriceUpdates.d.ts +0 -5
- package/dist/types/onchain/market/pricefeeds/isUpdatablePriceFeed.d.ts +0 -5
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_onchain_utils_createRawTx = require("../../../utils/createRawTx.js");
|
|
3
|
+
const require_onchain_constants_address_provider = require("../../../constants/address-provider.js");
|
|
4
|
+
const require_onchain_constants_addresses = require("../../../constants/addresses.js");
|
|
5
|
+
const require_onchain_constants_versions = require("../../../constants/versions.js");
|
|
6
|
+
require("../../../constants/index.js");
|
|
7
|
+
require("../../../utils/index.js");
|
|
8
|
+
const require_abi_compressors_priceFeedCompressor = require("../../../../abi/compressors/priceFeedCompressor.js");
|
|
9
|
+
const require_onchain_market_pricefeeds_PriceFeedRegistry = require("../PriceFeedRegistry.js");
|
|
10
|
+
const require_onchain_market_pricefeeds_updates_getRawPriceUpdates = require("./getRawPriceUpdates.js");
|
|
11
|
+
const require_onchain_market_pricefeeds_updates_isUpdatablePriceFeed = require("./isUpdatablePriceFeed.js");
|
|
12
|
+
const require_onchain_market_pricefeeds_updates_RedstoneUpdater = require("./RedstoneUpdater.js");
|
|
13
|
+
const require_onchain_utils_internal_Hooks = require("../../../utils/internal/Hooks.js");
|
|
14
|
+
require("../../../utils/internal/index.js");
|
|
15
|
+
const require_onchain_market_pricefeeds_updates_updatableDependencies = require("./updatableDependencies.js");
|
|
16
|
+
let viem = require("viem");
|
|
17
|
+
//#region src/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.ts
|
|
18
|
+
/**
|
|
19
|
+
* {@link PriceFeedRegistry} that also orchestrates off-chain price updates
|
|
20
|
+
* (Redstone, etc.).
|
|
21
|
+
**/
|
|
22
|
+
var UpdatablePriceFeedRegistry = class extends require_onchain_market_pricefeeds_PriceFeedRegistry.PriceFeedRegistry {
|
|
23
|
+
#hooks = new require_onchain_utils_internal_Hooks.Hooks();
|
|
24
|
+
#updaters;
|
|
25
|
+
#latestUpdate;
|
|
26
|
+
constructor(sdk, opts = {}) {
|
|
27
|
+
super(sdk);
|
|
28
|
+
this.#updaters = [new require_onchain_market_pricefeeds_updates_RedstoneUpdater.RedstoneUpdater(sdk, opts.redstone)];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
* Registers a callback for price-feed registry lifecycle events.
|
|
33
|
+
* @param event - Event name.
|
|
34
|
+
* @param handler - Callback to invoke.
|
|
35
|
+
**/
|
|
36
|
+
addHook = this.#hooks.addHook.bind(this.#hooks);
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
* Removes a previously registered hook.
|
|
40
|
+
* @param event - Event name.
|
|
41
|
+
* @param handler - Callback to remove.
|
|
42
|
+
**/
|
|
43
|
+
removeHook = this.#hooks.removeHook.bind(this.#hooks);
|
|
44
|
+
/**
|
|
45
|
+
* Generates transactions to push fresh off-chain prices to updatable feeds.
|
|
46
|
+
*
|
|
47
|
+
* @param priceFeeds - Top-level price feeds whose updatable dependencies
|
|
48
|
+
* will be resolved, or a filter (`{ main: true }` / `{ reserve: true }`)
|
|
49
|
+
* to gather feeds from all oracles. When omitted, all registered feeds
|
|
50
|
+
* are used.
|
|
51
|
+
**/
|
|
52
|
+
async generatePriceFeedsUpdateTxs(priceFeeds) {
|
|
53
|
+
let updateables = this.feeds;
|
|
54
|
+
let filterRemark = "";
|
|
55
|
+
if (priceFeeds) {
|
|
56
|
+
if (Array.isArray(priceFeeds)) updateables = priceFeeds.flatMap((pf) => require_onchain_market_pricefeeds_updates_updatableDependencies.updatableDependencies(pf));
|
|
57
|
+
else if ("main" in priceFeeds && priceFeeds.main) {
|
|
58
|
+
filterRemark = " main";
|
|
59
|
+
updateables = this.sdk.marketRegister.priceOracles.flatMap((o) => o.mainPriceFeeds.values()).flatMap((pf) => require_onchain_market_pricefeeds_updates_updatableDependencies.updatableDependencies(pf.priceFeed));
|
|
60
|
+
} else if ("reserve" in priceFeeds && priceFeeds.reserve) {
|
|
61
|
+
filterRemark = " reserve";
|
|
62
|
+
updateables = this.sdk.marketRegister.priceOracles.flatMap((o) => o.reservePriceFeeds.values()).flatMap((pf) => require_onchain_market_pricefeeds_updates_updatableDependencies.updatableDependencies(pf.priceFeed));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return this.#generateUpdateTxs(updateables, filterRemark);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Similar to {@link generatePriceFeedsUpdateTxs}, but returns raw structures instead of transactions
|
|
69
|
+
* @param priceFeeds
|
|
70
|
+
* @returns
|
|
71
|
+
*/
|
|
72
|
+
async generatePriceFeedsUpdates(priceFeeds) {
|
|
73
|
+
const updates = await this.generatePriceFeedsUpdateTxs(priceFeeds);
|
|
74
|
+
return require_onchain_market_pricefeeds_updates_getRawPriceUpdates.getRawPriceUpdates(updates);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Similar to {@link generatePriceFeedsUpdates}, but returns raw transaction to PriceFeedStore.updatePrices
|
|
78
|
+
* @param priceFeeds
|
|
79
|
+
* @returns
|
|
80
|
+
*/
|
|
81
|
+
async getPriceFeedStoreUpdateTx(priceFeeds) {
|
|
82
|
+
const pfs = this.sdk.addressProvider.getAddress(require_onchain_constants_address_provider.AP_PRICE_FEED_STORE);
|
|
83
|
+
const updates = await this.generatePriceFeedsUpdates(priceFeeds);
|
|
84
|
+
return require_onchain_utils_createRawTx.createRawTx(pfs, {
|
|
85
|
+
abi: (0, viem.parseAbi)(["function updatePrices((address,bytes)[])"]),
|
|
86
|
+
functionName: "updatePrices",
|
|
87
|
+
args: [updates.map((u) => [u.priceFeed, u.data])]
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Similar to {@link generatePriceFeedsUpdateTxs}, but will generate necessary price update transactions for external price feeds (not known to sdk)
|
|
92
|
+
* This does not add feeds to this registry, so they won't be implicitly included in future generatePriceFeedsUpdateTxs calls
|
|
93
|
+
* @param feeds
|
|
94
|
+
* @param block
|
|
95
|
+
* @returns
|
|
96
|
+
*/
|
|
97
|
+
async generateExternalPriceFeedsUpdateTxs(feeds, block) {
|
|
98
|
+
const [priceFeedCompressorAddress] = this.sdk.addressProvider.mustGetLatest(require_onchain_constants_address_provider.AP_PRICE_FEED_COMPRESSOR, require_onchain_constants_versions.VERSION_RANGE_310);
|
|
99
|
+
const blockParam = block ?? { blockNumber: this.sdk.currentBlock };
|
|
100
|
+
const leaves = (await this.client.readContract({
|
|
101
|
+
address: priceFeedCompressorAddress,
|
|
102
|
+
abi: require_abi_compressors_priceFeedCompressor.priceFeedCompressorAbi,
|
|
103
|
+
functionName: "loadPriceFeedTree",
|
|
104
|
+
args: [feeds],
|
|
105
|
+
...blockParam,
|
|
106
|
+
gas: this.sdk.gasLimit
|
|
107
|
+
})).map((node) => this.get(node.baseParams.addr) ?? this.create(node)).filter(require_onchain_market_pricefeeds_updates_isUpdatablePriceFeed.isUpdatablePriceFeed);
|
|
108
|
+
return this.#generateUpdateTxs(leaves, "");
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Similar to {@link generateExternalPriceFeedsUpdateTxs}, but returns raw structures instead of transactions
|
|
112
|
+
* @param feeds
|
|
113
|
+
* @param block
|
|
114
|
+
* @returns
|
|
115
|
+
*/
|
|
116
|
+
async generateExternalPriceFeedsUpdates(feeds, block) {
|
|
117
|
+
const updates = await this.generateExternalPriceFeedsUpdateTxs(feeds, block);
|
|
118
|
+
return require_onchain_market_pricefeeds_updates_getRawPriceUpdates.getRawPriceUpdates(updates);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Loads PARTIAL information about all updatable price feeds from MarketCompressor
|
|
122
|
+
* Discovered price feeds are not saved anywhere in PriceFeedRegistry, and can later be used to load price feed updates
|
|
123
|
+
*/
|
|
124
|
+
async getPartialUpdatablePriceFeeds(configurators) {
|
|
125
|
+
const [priceFeedCompressorAddress] = this.sdk.addressProvider.mustGetLatest(require_onchain_constants_address_provider.AP_PRICE_FEED_COMPRESSOR, require_onchain_constants_versions.VERSION_RANGE_310);
|
|
126
|
+
this.logger?.debug({ configurators }, `calling getUpdatablePriceFeeds in block ${this.sdk.currentBlock}`);
|
|
127
|
+
const result = await this.client.readContract({
|
|
128
|
+
address: priceFeedCompressorAddress,
|
|
129
|
+
abi: require_abi_compressors_priceFeedCompressor.priceFeedCompressorAbi,
|
|
130
|
+
functionName: "getUpdatablePriceFeeds",
|
|
131
|
+
args: [{
|
|
132
|
+
configurators,
|
|
133
|
+
pools: [],
|
|
134
|
+
underlying: require_onchain_constants_addresses.ADDRESS_0X0
|
|
135
|
+
}],
|
|
136
|
+
blockNumber: this.sdk.currentBlock,
|
|
137
|
+
gas: this.sdk.gasLimit
|
|
138
|
+
});
|
|
139
|
+
this.logger?.debug(`loaded ${result.length} partial updatable price feeds in block ${this.sdk.currentBlock}`);
|
|
140
|
+
return result.map((baseParams) => this.create({ baseParams }));
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* @internal
|
|
144
|
+
* Diagnostic snapshot of the most recent price-update round, or
|
|
145
|
+
* `undefined` if no updates have been generated yet.
|
|
146
|
+
**/
|
|
147
|
+
get latestUpdate() {
|
|
148
|
+
return this.#latestUpdate;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* @internal
|
|
152
|
+
* Returns true if any of the updaters are in historical mode
|
|
153
|
+
*/
|
|
154
|
+
get historical() {
|
|
155
|
+
return this.#updaters.some((u) => u.historical);
|
|
156
|
+
}
|
|
157
|
+
async #generateUpdateTxs(updateables, filterRemark) {
|
|
158
|
+
if (updateables.length === 0) return {
|
|
159
|
+
txs: [],
|
|
160
|
+
timestamp: 0
|
|
161
|
+
};
|
|
162
|
+
const txs = [];
|
|
163
|
+
const latestUpdate = {
|
|
164
|
+
updates: [],
|
|
165
|
+
timestamp: Math.floor(Date.now() / 1e3)
|
|
166
|
+
};
|
|
167
|
+
const updates = (await Promise.all(this.#updaters.map((u) => u.getUpdateTxs([...updateables]).catch(() => [])))).flat();
|
|
168
|
+
let maxTimestamp = 0;
|
|
169
|
+
for (const tx of updates) {
|
|
170
|
+
const { data } = tx;
|
|
171
|
+
const { timestamp } = data;
|
|
172
|
+
if (timestamp > maxTimestamp) maxTimestamp = timestamp;
|
|
173
|
+
txs.push(tx);
|
|
174
|
+
latestUpdate.updates.push(data);
|
|
175
|
+
}
|
|
176
|
+
txs.sort((a, b) => a.raw.to.toLowerCase().localeCompare(b.raw.to.toLowerCase()));
|
|
177
|
+
const result = {
|
|
178
|
+
txs,
|
|
179
|
+
timestamp: maxTimestamp
|
|
180
|
+
};
|
|
181
|
+
const tsDelta = BigInt(maxTimestamp) - this.sdk.timestamp;
|
|
182
|
+
this.logger?.debug(`generated ${txs.length}${filterRemark} price feed update transactions, timestamp: ${maxTimestamp} (delta ${tsDelta})`);
|
|
183
|
+
if (txs.length) await this.#hooks.triggerHooks("updatesGenerated", result);
|
|
184
|
+
this.#latestUpdate = latestUpdate;
|
|
185
|
+
return result;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
//#endregion
|
|
189
|
+
exports.UpdatablePriceFeedRegistry = UpdatablePriceFeedRegistry;
|
package/dist/cjs/onchain/market/pricefeeds/{getRawPriceUpdates.js → updates/getRawPriceUpdates.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_abi_iUpdatablePriceFeed = require("
|
|
2
|
+
const require_abi_iUpdatablePriceFeed = require("../../../../abi/iUpdatablePriceFeed.js");
|
|
3
3
|
let viem = require("viem");
|
|
4
|
-
//#region src/onchain/market/pricefeeds/getRawPriceUpdates.ts
|
|
4
|
+
//#region src/onchain/market/pricefeeds/updates/getRawPriceUpdates.ts
|
|
5
5
|
function getRawPriceUpdates(updates) {
|
|
6
6
|
return updates.txs.map((tx) => {
|
|
7
7
|
const data = (0, viem.decodeFunctionData)({
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_onchain_market_pricefeeds_updates_fetchRedstonePayloads = require("./fetchRedstonePayloads.js");
|
|
3
|
+
const require_onchain_market_pricefeeds_updates_getRawPriceUpdates = require("./getRawPriceUpdates.js");
|
|
4
|
+
const require_onchain_market_pricefeeds_updates_isUpdatablePriceFeed = require("./isUpdatablePriceFeed.js");
|
|
3
5
|
const require_onchain_market_pricefeeds_updates_PriceUpdatesCache = require("./PriceUpdatesCache.js");
|
|
4
6
|
const require_onchain_market_pricefeeds_updates_RedstoneUpdater = require("./RedstoneUpdater.js");
|
|
7
|
+
const require_onchain_market_pricefeeds_updates_updatableDependencies = require("./updatableDependencies.js");
|
|
8
|
+
const require_onchain_market_pricefeeds_updates_UpdatablePriceFeedRegistry = require("./UpdatablePriceFeedRegistry.js");
|
|
5
9
|
exports.PriceUpdatesCache = require_onchain_market_pricefeeds_updates_PriceUpdatesCache.PriceUpdatesCache;
|
|
6
10
|
exports.RedstoneOptions = require_onchain_market_pricefeeds_updates_RedstoneUpdater.RedstoneOptions;
|
|
7
11
|
exports.RedstoneUpdater = require_onchain_market_pricefeeds_updates_RedstoneUpdater.RedstoneUpdater;
|
|
12
|
+
exports.UpdatablePriceFeedRegistry = require_onchain_market_pricefeeds_updates_UpdatablePriceFeedRegistry.UpdatablePriceFeedRegistry;
|
|
8
13
|
exports.fetchRedstonePayloads = require_onchain_market_pricefeeds_updates_fetchRedstonePayloads.fetchRedstonePayloads;
|
|
14
|
+
exports.getRawPriceUpdates = require_onchain_market_pricefeeds_updates_getRawPriceUpdates.getRawPriceUpdates;
|
|
15
|
+
exports.isUpdatablePriceFeed = require_onchain_market_pricefeeds_updates_isUpdatablePriceFeed.isUpdatablePriceFeed;
|
|
16
|
+
exports.updatableDependencies = require_onchain_market_pricefeeds_updates_updatableDependencies.updatableDependencies;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
//#region src/onchain/market/pricefeeds/isUpdatablePriceFeed.ts
|
|
2
|
+
//#region src/onchain/market/pricefeeds/updates/isUpdatablePriceFeed.ts
|
|
3
3
|
function isUpdatablePriceFeed(pf) {
|
|
4
4
|
return pf.updatable;
|
|
5
5
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_onchain_market_pricefeeds_updates_isUpdatablePriceFeed = require("./isUpdatablePriceFeed.js");
|
|
3
|
+
//#region src/onchain/market/pricefeeds/updates/updatableDependencies.ts
|
|
4
|
+
/**
|
|
5
|
+
* Collects updatable feeds in this feed's dependency tree, including this
|
|
6
|
+
* feed itself when it is updatable.
|
|
7
|
+
**/
|
|
8
|
+
function updatableDependencies(feed) {
|
|
9
|
+
if (!feed.loaded) return [feed];
|
|
10
|
+
const underlying = feed.underlyingPriceFeeds.flatMap((ref) => updatableDependencies(ref.priceFeed));
|
|
11
|
+
return require_onchain_market_pricefeeds_updates_isUpdatablePriceFeed.isUpdatablePriceFeed(feed) ? [feed, ...underlying] : underlying;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
exports.updatableDependencies = updatableDependencies;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_onchain_utils_createRawTx = require("../../../onchain/utils/createRawTx.js");
|
|
3
|
-
const
|
|
3
|
+
const require_onchain_market_pricefeeds_updates_getRawPriceUpdates = require("../../../onchain/market/pricefeeds/updates/getRawPriceUpdates.js");
|
|
4
4
|
const require_onchain_OnchainSDK = require("../../../onchain/OnchainSDK.js");
|
|
5
5
|
require("../../../onchain/index.js");
|
|
6
6
|
require("../../deployment/addresses.js");
|
|
@@ -31,7 +31,7 @@ async function getPriceUpdateTx({ client, priceFeeds, useMulticall3 = false, gas
|
|
|
31
31
|
args: [multicallCalls]
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
const priceUpdates =
|
|
34
|
+
const priceUpdates = require_onchain_market_pricefeeds_updates_getRawPriceUpdates.getRawPriceUpdates(updateTxs);
|
|
35
35
|
if (priceUpdates.length === 0) return;
|
|
36
36
|
return pfStore.updatePrices(priceUpdates);
|
|
37
37
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_onchain_utils_bytes32ToString = require("../../../onchain/utils/bytes32ToString.js");
|
|
3
3
|
const require_abi_compressors_priceFeedCompressor = require("../../../abi/compressors/priceFeedCompressor.js");
|
|
4
|
-
const
|
|
4
|
+
const require_onchain_market_pricefeeds_feeds_RedstonePriceFeed = require("../../../onchain/market/pricefeeds/feeds/RedstonePriceFeed.js");
|
|
5
5
|
require("../../../onchain/index.js");
|
|
6
6
|
let viem = require("viem");
|
|
7
7
|
//#region src/permissionless/utils/price-update/get-updatable-feeds.ts
|
|
@@ -11,7 +11,7 @@ async function getUpdatablePriceFeeds(args) {
|
|
|
11
11
|
address: pfCompressor,
|
|
12
12
|
abi: require_abi_compressors_priceFeedCompressor.priceFeedCompressorAbi,
|
|
13
13
|
client
|
|
14
|
-
}).read.loadPriceFeedTree([priceFeeds])).filter((data) => require_onchain_utils_bytes32ToString.bytes32ToString(data.baseParams.contractType) === "PRICE_FEED::REDSTONE").map((data) => new
|
|
14
|
+
}).read.loadPriceFeedTree([priceFeeds])).filter((data) => require_onchain_utils_bytes32ToString.bytes32ToString(data.baseParams.contractType) === "PRICE_FEED::REDSTONE").map((data) => new require_onchain_market_pricefeeds_feeds_RedstonePriceFeed.RedstonePriceFeedContract(sdk, data));
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
17
17
|
exports.getUpdatablePriceFeeds = getUpdatablePriceFeeds;
|
|
@@ -187,12 +187,15 @@ async function discoverMidasGateways(sdk) {
|
|
|
187
187
|
return new AddressSet(suites.map((suite) => suite.gateway)).asArray();
|
|
188
188
|
}
|
|
189
189
|
/**
|
|
190
|
-
* mTokens of
|
|
190
|
+
* mTokens of the Midas credit suites of the loaded credit managers.
|
|
191
|
+
*
|
|
192
|
+
* A manager with a gateway adapter contributes that adapter's mToken, so its
|
|
193
|
+
* degen NFT is not consulted. Suites that only have a Midas degen NFT
|
|
194
|
+
* contribute the mToken read from the gateway.
|
|
191
195
|
*/
|
|
192
|
-
function discoverMidasMTokens(sdk) {
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
return mTokens.asArray();
|
|
196
|
+
async function discoverMidasMTokens(sdk) {
|
|
197
|
+
const suites = await discoverMidasCreditSuites(sdk);
|
|
198
|
+
return new AddressSet(suites.map((suite) => suite.mToken)).asArray();
|
|
196
199
|
}
|
|
197
200
|
//#endregion
|
|
198
201
|
export { discoverMidasCreditSuites, discoverMidasGateways, discoverMidasMTokens, unpauseMidasIssuanceVault };
|
|
@@ -13,7 +13,7 @@ import { ChainContractsRegister } from "./base/ChainContractsRegister.js";
|
|
|
13
13
|
import "./base/index.js";
|
|
14
14
|
import { executeDelegatedMulticalls } from "./utils/viem/executeDelegatedMulticalls.js";
|
|
15
15
|
import "./utils/viem/index.js";
|
|
16
|
-
import {
|
|
16
|
+
import { UpdatablePriceFeedRegistry } from "./market/pricefeeds/updates/UpdatablePriceFeedRegistry.js";
|
|
17
17
|
import "./market/pricefeeds/index.js";
|
|
18
18
|
import { MarketRegister } from "./market/MarketRegister.js";
|
|
19
19
|
import { RWARegistry } from "./market/rwa/RWARegistry.js";
|
|
@@ -167,7 +167,7 @@ var OnchainSDK = class extends ChainContractsRegister {
|
|
|
167
167
|
this.#currentBlock = block.number;
|
|
168
168
|
this.#timestamp = block.timestamp;
|
|
169
169
|
if (blockNumber && !redstone?.historicTimestamp && time - Number(block.timestamp) * 1e3 > 6e4) this.logger?.warn("attaching to fixed block number, but redstone historicTimestamp is not set. price updates might fail");
|
|
170
|
-
this.#priceFeeds = new
|
|
170
|
+
this.#priceFeeds = new UpdatablePriceFeedRegistry(this, { redstone });
|
|
171
171
|
this.logger?.debug(`attach block number ${this.currentBlock} timestamp ${this.timestamp}`);
|
|
172
172
|
this.#addressProvider = await createAddressProvider(this, addressProvider);
|
|
173
173
|
this.logger?.debug(`address provider version: ${this.#addressProvider.version}`);
|
|
@@ -262,7 +262,7 @@ var OnchainSDK = class extends ChainContractsRegister {
|
|
|
262
262
|
this.logger?.info({ networkType: this.networkType }, "hydrating sdk state");
|
|
263
263
|
this.#currentBlock = state.currentBlock;
|
|
264
264
|
this.#timestamp = state.timestamp;
|
|
265
|
-
this.#priceFeeds = new
|
|
265
|
+
this.#priceFeeds = new UpdatablePriceFeedRegistry(this, { redstone });
|
|
266
266
|
this.#addressProvider = hydrateAddressProvider(this, state.addressProvider);
|
|
267
267
|
this.logger?.debug(`address provider version: ${this.#addressProvider.version}`);
|
|
268
268
|
this.#marketRegister = new MarketRegister(this, ignoreMarkets);
|
|
@@ -149,29 +149,34 @@ import { estimateRawTxGas, sendRawTx } from "./utils/viem/sendRawTx.js";
|
|
|
149
149
|
import { watchBlocksAsync } from "./utils/viem/watchBlocksAsync.js";
|
|
150
150
|
import "./utils/viem/index.js";
|
|
151
151
|
import { collateralPriceInUnderlying } from "./market/oracle/collateralPriceInUnderlying.js";
|
|
152
|
-
import { isUpdatablePriceFeed } from "./market/pricefeeds/isUpdatablePriceFeed.js";
|
|
153
152
|
import { PriceFeedRef } from "./market/pricefeeds/PriceFeedRef.js";
|
|
154
153
|
import { AbstractPriceFeedContract, PartialPriceFeedInitError } from "./market/pricefeeds/AbstractPriceFeed.js";
|
|
155
154
|
import { AbstractLPPriceFeedContract, isLPPriceFeed } from "./market/pricefeeds/AbstractLPPriceFeed.js";
|
|
156
|
-
import { BalancerStablePriceFeedContract } from "./market/pricefeeds/BalancerStablePriceFeed.js";
|
|
157
|
-
import { BalancerWeightedPriceFeedContract } from "./market/pricefeeds/BalancerWeightedPriceFeed.js";
|
|
158
|
-
import { BoundedPriceFeedContract } from "./market/pricefeeds/BoundedPriceFeed.js";
|
|
159
|
-
import { CompositePriceFeedContract } from "./market/pricefeeds/CompositePriceFeed.js";
|
|
160
|
-
import {
|
|
161
|
-
import {
|
|
162
|
-
import {
|
|
163
|
-
import {
|
|
164
|
-
import {
|
|
165
|
-
import {
|
|
166
|
-
import { MellowLRTPriceFeedContract } from "./market/pricefeeds/MellowLRTPriceFeed.js";
|
|
167
|
-
import { PendleTWAPPTPriceFeed } from "./market/pricefeeds/PendleTWAPPTPriceFeed.js";
|
|
168
|
-
import { PythPriceFeed } from "./market/pricefeeds/PythPriceFeed.js";
|
|
169
|
-
import { RedstonePriceFeedContract } from "./market/pricefeeds/RedstonePriceFeed.js";
|
|
155
|
+
import { BalancerStablePriceFeedContract } from "./market/pricefeeds/feeds/BalancerStablePriceFeed.js";
|
|
156
|
+
import { BalancerWeightedPriceFeedContract } from "./market/pricefeeds/feeds/BalancerWeightedPriceFeed.js";
|
|
157
|
+
import { BoundedPriceFeedContract } from "./market/pricefeeds/feeds/BoundedPriceFeed.js";
|
|
158
|
+
import { CompositePriceFeedContract } from "./market/pricefeeds/feeds/CompositePriceFeed.js";
|
|
159
|
+
import { ConstantPriceFeedContract } from "./market/pricefeeds/feeds/ConstantPriceFeed.js";
|
|
160
|
+
import { CurveCryptoPriceFeedContract } from "./market/pricefeeds/feeds/CurveCryptoPriceFeed.js";
|
|
161
|
+
import { CurveStablePriceFeedContract } from "./market/pricefeeds/feeds/CurveStablePriceFeed.js";
|
|
162
|
+
import { CurveUSDPriceFeedContract } from "./market/pricefeeds/feeds/CurveUSDPriceFeed.js";
|
|
163
|
+
import { Erc4626PriceFeedContract } from "./market/pricefeeds/feeds/Erc4626PriceFeed.js";
|
|
164
|
+
import { ExternalPriceFeedContract } from "./market/pricefeeds/feeds/ExternalPriceFeed.js";
|
|
165
|
+
import { MellowLRTPriceFeedContract } from "./market/pricefeeds/feeds/MellowLRTPriceFeed.js";
|
|
166
|
+
import { PendleTWAPPTPriceFeed } from "./market/pricefeeds/feeds/PendleTWAPPTPriceFeed.js";
|
|
167
|
+
import { PythPriceFeed } from "./market/pricefeeds/feeds/PythPriceFeed.js";
|
|
168
|
+
import { RedstonePriceFeedContract } from "./market/pricefeeds/feeds/RedstonePriceFeed.js";
|
|
169
|
+
import { WstETHPriceFeedContract } from "./market/pricefeeds/feeds/WstETHPriceFeed.js";
|
|
170
|
+
import { YearnPriceFeedContract } from "./market/pricefeeds/feeds/YearnPriceFeed.js";
|
|
171
|
+
import { ZeroPriceFeedContract } from "./market/pricefeeds/feeds/ZeroPriceFeed.js";
|
|
172
|
+
import { PriceFeedRegistry } from "./market/pricefeeds/PriceFeedRegistry.js";
|
|
170
173
|
import { fetchRedstonePayloads } from "./market/pricefeeds/updates/fetchRedstonePayloads.js";
|
|
171
|
-
import {
|
|
172
|
-
import {
|
|
173
|
-
import {
|
|
174
|
-
import {
|
|
174
|
+
import { getRawPriceUpdates } from "./market/pricefeeds/updates/getRawPriceUpdates.js";
|
|
175
|
+
import { isUpdatablePriceFeed } from "./market/pricefeeds/updates/isUpdatablePriceFeed.js";
|
|
176
|
+
import { PriceUpdatesCache } from "./market/pricefeeds/updates/PriceUpdatesCache.js";
|
|
177
|
+
import { RedstoneOptions, RedstoneUpdater } from "./market/pricefeeds/updates/RedstoneUpdater.js";
|
|
178
|
+
import { updatableDependencies } from "./market/pricefeeds/updates/updatableDependencies.js";
|
|
179
|
+
import { UpdatablePriceFeedRegistry } from "./market/pricefeeds/updates/UpdatablePriceFeedRegistry.js";
|
|
175
180
|
import { PriceOracleV310Contract } from "./market/oracle/PriceOracleV310Contract.js";
|
|
176
181
|
import { createPriceOracle } from "./market/oracle/createPriceOracle.js";
|
|
177
182
|
import { GaugeContract } from "./market/pool/GaugeContract.js";
|
|
@@ -301,4 +306,4 @@ import { replayMulticall } from "./preview/preview/replayMulticall.js";
|
|
|
301
306
|
import { previewOperation } from "./preview/preview/previewOperation.js";
|
|
302
307
|
import "./preview/index.js";
|
|
303
308
|
import "./types/index.js";
|
|
304
|
-
export { ADDRESS_0X0, ADDRESS_PROVIDER_V310, AP_ACCOUNT_FACTORY, AP_ACL, AP_BOT_LIST, AP_BYTECODE_REPOSITORY, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_CREDIT_SUITE_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GAUGE_COMPRESSOR, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_PARTIAL_LIQUIDATION_BOT, AP_PERIPHERY_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_FEED_STORE, AP_PRICE_ORACLE, AP_REDEMPTION_LOGGER, AP_REWARDS_COMPRESSOR, AP_ROUTER, AP_TOKEN_COMPRESSOR, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractAdapterContract, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountBotsService, AccountMigratorAdapterContract, AdapterType, AddressMap, AddressProviderV310Contract, AddressSet, AssetsMap, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, BasePlugin, BigIntMath, BotPermissions, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainContractsRegister, ChainNotConfiguredError, CompositePriceFeedContract, Construct, ContractParseError, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountOperationsService, CreditAccountState, CreditAccountsServiceV310, CreditConfiguratorV310Contract, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DUST_THRESHOLD, DaiUsdsAdapterContract, ERC4626AdapterContract, ERC4626ReferralAdapterContract, EXECUTE_BYTES_SELECTOR, Erc4626PriceFeedContract, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, IERC20ZapperContract, IETHZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LidoV1AdapterContract, LinearInterestRateModelContract, LiquidationsService, MAX_INT, MAX_LEVERAGE_BUFFER_BPS, MAX_UINT16, MAX_UINT256, MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_INT96, MIN_SAFE_HEALTH_FACTOR_FORM, MULTICALL_ADDRESS, MarketRegister, MarketSuite, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, MissingSerializedParamsError, MultichainConstruct, MultichainLiquidationsService, MultichainOpportunitiesService, MultichainPositionsService, MultichainSDK, NATIVE_ADDRESS, NON_STRATEGY_PHANTOM_TOKEN_TYPES, NOT_DEPLOYED, NO_VERSION, NetworkType, OnchainSDK, OpportunitiesService, PARTIAL_LIQUIDATION_BUFFER_BPS, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PERCENTAGE_FACTOR_1KK, PERIPHERY_CONTRACTS, PHANTOM_TOKEN_CONTRACT_TYPES, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PRICE_DECIMALS, PRICE_DECIMALS_POW, PartialPriceFeedInitError, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PeripheryCompressorV310Contract, PluginStateVersionError, PoolService, PoolSuite, PoolV310Contract, PositionsService, PriceFeedRef, PriceFeedRegister, PriceOracleV310Contract, PythPriceFeed, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWARegistry, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RedemptionLoggerV310Contract, RedstonePriceFeedContract, RouterV310Contract, SDKConstruct, SECONDS_PER_YEAR, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkRWADataNotLoadedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeDegenNFT, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRedemptionGatewayAdapterContract, SimulateWithPriceUpdatesError, SimulationError, StakingRewardsAdapterContract, TokensMeta, TraderJoePoolVersion, TraderJoeRouterAdapterContract, TypedObjectUtils, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpshiftVaultAdapterContract, VERSION_RANGE_310, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, ZapperContract, ZeroPriceFeedContract, ZodAddress, ZodBigInt, ZodHex, accountSnapshotFromCreditAccountData, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, amountOf, assetsMap, attachOptionsSchema, botPermissionsToString, bpsToRay, buildDelayedStrategyPositionOperationPreview, bytes32ToString, calcBorrowApy, calcBorrowRate, calcDefaultQuota, calcEffectiveBorrowApy, calcHealthFactor, calcLiquidationPrice, calcLiquidationPriceForTarget, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcQuotaUpdate, calcRecommendedQuota, calcTimeToLiquidationMs, calcUtilization, calcUtilizationRaw, chains, checkAccountQuotas, checkBorrowLimit, checkCollateralFunding, checkCollateralised, checkCreditAccountFrozen, checkCreditManagerPaused, checkCreditOperation, checkDebtLimits, checkEmergencyLiquidator, checkForbiddenToken, checkHealthFactors, checkIncreaseDebt, checkIncreaseQuota, checkLeverage, checkLiquidation, checkLiquidationEligibility, checkLiquidationFunding, checkLiquidatorEligible, checkMarket, checkMarketExpired, checkMidasAccountGreenlist, checkObtained, checkOperation, checkPoolFunding, checkPoolLiquidity, checkPoolOperation, checkPoolPaused, checkPoolSunset, checkQuotaCount, checkQuotaLimit, checkRWAOpenRequirements, checkRWAOpening, checkReservePriceLimited, checkSimulation, checkWallet, checkWalletAllowance, checkWalletBalance, childLogger, classifyCloseOrRepay, classifyCurveOperation, classifyInnerOperations, collateralPriceInUnderlying, collectTraces, createAdapter, createAddressProvider, createPriceOracle, createRawTx, createRedemptionLogger, createRouter, createWithdrawalCompressor, createZapper, abi as creditFacadeV310Abi, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, decodeDelayedIntent, detectDelayedClaim, detectDelayedOperation, detectNetwork, dominantCollateral, encodeDelayedIntent, erc4626ReferralAdapterAbi, estimateClaimableAt, estimateRawTxGas, etherscanApiUrl, etherscanUrl, executeDelegatedMulticalls, executeMulticallBatches, expectedBalanceDeltas, fetchCreditAccountSlice, fetchRedstonePayloads, filterDust, filterDustUSD, findCallTo, findCallWithInput, findCuratorMarketConfigurator, findExecuteBytes, fmtBinaryMask, fnSigToName, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAccountTargetCollateral, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getAssetType, getCastTraceArgs, getChain, getCuratorName, getFunctionSignature, getLegacyStrategyTarget, getNetworkType, getRawPriceUpdates, getSimulateWithPriceUpdatesError, getWithdrawalCompressorAddress, halfRAY, hasAdapterDeployParamsAbi, healthFactorBps, hexEq, hydrateAddressProvider, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCreditAccountAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isCloseOrRepay, isDust, isLPPriceFeed, isPhantomToken, isPoolOperation, isPublicNetwork, isRWAFactory, isRWAOperation, isRWAToken, isStrategyCollateral, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, isZeroBalance, iwstETHAbi, iwstEthv1AdapterAbi, json_parse, json_stringify, lidoV1_WETHGatewayAbi, makeReplayState, mellowDvvAdapterAbi, midasGreenlistsAccount, minSeizedAmount, numberWithCommas, onchainSDKOptionsSchema, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parseFacadeOperationCalldata, parseOperationCalldata, parsePoolOperationCalldata, parsePosNegAmount, parseRWAFactoryOperationCalldata, percentFmt, pickStrategyTargetCollateral, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, raise, rayToBps, rayToNumber, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent, resolveProtocolCall, retry, rewardsFromTransfers, roundUpQuota, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, soleNonUnderlyingCollateral, strategyName, swapFromTransfers, toAddress, toBN, toBigInt, toChainIds, toClaimableWithdrawal, toCreditAccountSlice, toNetTransfers, toPendingWithdrawal, toRequestableWithdrawal, toSignificant, toToken, toTokenAmount, toWithdrawalStatus, usdToNumber, watchBlocksAsync };
|
|
309
|
+
export { ADDRESS_0X0, ADDRESS_PROVIDER_V310, AP_ACCOUNT_FACTORY, AP_ACL, AP_BOT_LIST, AP_BYTECODE_REPOSITORY, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_CREDIT_SUITE_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GAUGE_COMPRESSOR, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_PARTIAL_LIQUIDATION_BOT, AP_PERIPHERY_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_FEED_STORE, AP_PRICE_ORACLE, AP_REDEMPTION_LOGGER, AP_REWARDS_COMPRESSOR, AP_ROUTER, AP_TOKEN_COMPRESSOR, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractAdapterContract, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountBotsService, AccountMigratorAdapterContract, AdapterType, AddressMap, AddressProviderV310Contract, AddressSet, AssetsMap, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, BasePlugin, BigIntMath, BotPermissions, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainContractsRegister, ChainNotConfiguredError, CompositePriceFeedContract, ConstantPriceFeedContract, Construct, ContractParseError, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountOperationsService, CreditAccountState, CreditAccountsServiceV310, CreditConfiguratorV310Contract, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DUST_THRESHOLD, DaiUsdsAdapterContract, ERC4626AdapterContract, ERC4626ReferralAdapterContract, EXECUTE_BYTES_SELECTOR, Erc4626PriceFeedContract, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, IERC20ZapperContract, IETHZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LidoV1AdapterContract, LinearInterestRateModelContract, LiquidationsService, MAX_INT, MAX_LEVERAGE_BUFFER_BPS, MAX_UINT16, MAX_UINT256, MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_INT96, MIN_SAFE_HEALTH_FACTOR_FORM, MULTICALL_ADDRESS, MarketRegister, MarketSuite, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, MissingSerializedParamsError, MultichainConstruct, MultichainLiquidationsService, MultichainOpportunitiesService, MultichainPositionsService, MultichainSDK, NATIVE_ADDRESS, NON_STRATEGY_PHANTOM_TOKEN_TYPES, NOT_DEPLOYED, NO_VERSION, NetworkType, OnchainSDK, OpportunitiesService, PARTIAL_LIQUIDATION_BUFFER_BPS, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PERCENTAGE_FACTOR_1KK, PERIPHERY_CONTRACTS, PHANTOM_TOKEN_CONTRACT_TYPES, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PRICE_DECIMALS, PRICE_DECIMALS_POW, PartialPriceFeedInitError, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PeripheryCompressorV310Contract, PluginStateVersionError, PoolService, PoolSuite, PoolV310Contract, PositionsService, PriceFeedRef, PriceFeedRegistry, PriceOracleV310Contract, PriceUpdatesCache, PythPriceFeed, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWARegistry, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RedemptionLoggerV310Contract, RedstoneOptions, RedstonePriceFeedContract, RedstoneUpdater, RouterV310Contract, SDKConstruct, SECONDS_PER_YEAR, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkRWADataNotLoadedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeDegenNFT, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRedemptionGatewayAdapterContract, SimulateWithPriceUpdatesError, SimulationError, StakingRewardsAdapterContract, TokensMeta, TraderJoePoolVersion, TraderJoeRouterAdapterContract, TypedObjectUtils, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, UpshiftVaultAdapterContract, VERSION_RANGE_310, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, ZapperContract, ZeroPriceFeedContract, ZodAddress, ZodBigInt, ZodHex, accountSnapshotFromCreditAccountData, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, amountOf, assetsMap, attachOptionsSchema, botPermissionsToString, bpsToRay, buildDelayedStrategyPositionOperationPreview, bytes32ToString, calcBorrowApy, calcBorrowRate, calcDefaultQuota, calcEffectiveBorrowApy, calcHealthFactor, calcLiquidationPrice, calcLiquidationPriceForTarget, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcQuotaUpdate, calcRecommendedQuota, calcTimeToLiquidationMs, calcUtilization, calcUtilizationRaw, chains, checkAccountQuotas, checkBorrowLimit, checkCollateralFunding, checkCollateralised, checkCreditAccountFrozen, checkCreditManagerPaused, checkCreditOperation, checkDebtLimits, checkEmergencyLiquidator, checkForbiddenToken, checkHealthFactors, checkIncreaseDebt, checkIncreaseQuota, checkLeverage, checkLiquidation, checkLiquidationEligibility, checkLiquidationFunding, checkLiquidatorEligible, checkMarket, checkMarketExpired, checkMidasAccountGreenlist, checkObtained, checkOperation, checkPoolFunding, checkPoolLiquidity, checkPoolOperation, checkPoolPaused, checkPoolSunset, checkQuotaCount, checkQuotaLimit, checkRWAOpenRequirements, checkRWAOpening, checkReservePriceLimited, checkSimulation, checkWallet, checkWalletAllowance, checkWalletBalance, childLogger, classifyCloseOrRepay, classifyCurveOperation, classifyInnerOperations, collateralPriceInUnderlying, collectTraces, createAdapter, createAddressProvider, createPriceOracle, createRawTx, createRedemptionLogger, createRouter, createWithdrawalCompressor, createZapper, abi as creditFacadeV310Abi, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, decodeDelayedIntent, detectDelayedClaim, detectDelayedOperation, detectNetwork, dominantCollateral, encodeDelayedIntent, erc4626ReferralAdapterAbi, estimateClaimableAt, estimateRawTxGas, etherscanApiUrl, etherscanUrl, executeDelegatedMulticalls, executeMulticallBatches, expectedBalanceDeltas, fetchCreditAccountSlice, fetchRedstonePayloads, filterDust, filterDustUSD, findCallTo, findCallWithInput, findCuratorMarketConfigurator, findExecuteBytes, fmtBinaryMask, fnSigToName, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAccountTargetCollateral, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getAssetType, getCastTraceArgs, getChain, getCuratorName, getFunctionSignature, getLegacyStrategyTarget, getNetworkType, getRawPriceUpdates, getSimulateWithPriceUpdatesError, getWithdrawalCompressorAddress, halfRAY, hasAdapterDeployParamsAbi, healthFactorBps, hexEq, hydrateAddressProvider, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCreditAccountAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isCloseOrRepay, isDust, isLPPriceFeed, isPhantomToken, isPoolOperation, isPublicNetwork, isRWAFactory, isRWAOperation, isRWAToken, isStrategyCollateral, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, isZeroBalance, iwstETHAbi, iwstEthv1AdapterAbi, json_parse, json_stringify, lidoV1_WETHGatewayAbi, makeReplayState, mellowDvvAdapterAbi, midasGreenlistsAccount, minSeizedAmount, numberWithCommas, onchainSDKOptionsSchema, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parseFacadeOperationCalldata, parseOperationCalldata, parsePoolOperationCalldata, parsePosNegAmount, parseRWAFactoryOperationCalldata, percentFmt, pickStrategyTargetCollateral, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, raise, rayToBps, rayToNumber, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent, resolveProtocolCall, retry, rewardsFromTransfers, roundUpQuota, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, soleNonUnderlyingCollateral, strategyName, swapFromTransfers, toAddress, toBN, toBigInt, toChainIds, toClaimableWithdrawal, toCreditAccountSlice, toNetTransfers, toPendingWithdrawal, toRequestableWithdrawal, toSignificant, toToken, toTokenAmount, toWithdrawalStatus, updatableDependencies, usdToNumber, watchBlocksAsync };
|
|
@@ -98,29 +98,34 @@ import { CreditSuite } from "./credit/CreditSuite.js";
|
|
|
98
98
|
import { expectedBalanceDeltas } from "./credit/expectedBalanceDeltas.js";
|
|
99
99
|
import "./credit/index.js";
|
|
100
100
|
import { collateralPriceInUnderlying } from "./oracle/collateralPriceInUnderlying.js";
|
|
101
|
-
import { isUpdatablePriceFeed } from "./pricefeeds/isUpdatablePriceFeed.js";
|
|
102
101
|
import { PriceFeedRef } from "./pricefeeds/PriceFeedRef.js";
|
|
103
102
|
import { AbstractPriceFeedContract, PartialPriceFeedInitError } from "./pricefeeds/AbstractPriceFeed.js";
|
|
104
103
|
import { AbstractLPPriceFeedContract, isLPPriceFeed } from "./pricefeeds/AbstractLPPriceFeed.js";
|
|
105
|
-
import { BalancerStablePriceFeedContract } from "./pricefeeds/BalancerStablePriceFeed.js";
|
|
106
|
-
import { BalancerWeightedPriceFeedContract } from "./pricefeeds/BalancerWeightedPriceFeed.js";
|
|
107
|
-
import { BoundedPriceFeedContract } from "./pricefeeds/BoundedPriceFeed.js";
|
|
108
|
-
import { CompositePriceFeedContract } from "./pricefeeds/CompositePriceFeed.js";
|
|
109
|
-
import {
|
|
110
|
-
import {
|
|
111
|
-
import {
|
|
112
|
-
import {
|
|
113
|
-
import {
|
|
114
|
-
import {
|
|
115
|
-
import { MellowLRTPriceFeedContract } from "./pricefeeds/MellowLRTPriceFeed.js";
|
|
116
|
-
import { PendleTWAPPTPriceFeed } from "./pricefeeds/PendleTWAPPTPriceFeed.js";
|
|
117
|
-
import { PythPriceFeed } from "./pricefeeds/PythPriceFeed.js";
|
|
118
|
-
import { RedstonePriceFeedContract } from "./pricefeeds/RedstonePriceFeed.js";
|
|
104
|
+
import { BalancerStablePriceFeedContract } from "./pricefeeds/feeds/BalancerStablePriceFeed.js";
|
|
105
|
+
import { BalancerWeightedPriceFeedContract } from "./pricefeeds/feeds/BalancerWeightedPriceFeed.js";
|
|
106
|
+
import { BoundedPriceFeedContract } from "./pricefeeds/feeds/BoundedPriceFeed.js";
|
|
107
|
+
import { CompositePriceFeedContract } from "./pricefeeds/feeds/CompositePriceFeed.js";
|
|
108
|
+
import { ConstantPriceFeedContract } from "./pricefeeds/feeds/ConstantPriceFeed.js";
|
|
109
|
+
import { CurveCryptoPriceFeedContract } from "./pricefeeds/feeds/CurveCryptoPriceFeed.js";
|
|
110
|
+
import { CurveStablePriceFeedContract } from "./pricefeeds/feeds/CurveStablePriceFeed.js";
|
|
111
|
+
import { CurveUSDPriceFeedContract } from "./pricefeeds/feeds/CurveUSDPriceFeed.js";
|
|
112
|
+
import { Erc4626PriceFeedContract } from "./pricefeeds/feeds/Erc4626PriceFeed.js";
|
|
113
|
+
import { ExternalPriceFeedContract } from "./pricefeeds/feeds/ExternalPriceFeed.js";
|
|
114
|
+
import { MellowLRTPriceFeedContract } from "./pricefeeds/feeds/MellowLRTPriceFeed.js";
|
|
115
|
+
import { PendleTWAPPTPriceFeed } from "./pricefeeds/feeds/PendleTWAPPTPriceFeed.js";
|
|
116
|
+
import { PythPriceFeed } from "./pricefeeds/feeds/PythPriceFeed.js";
|
|
117
|
+
import { RedstonePriceFeedContract } from "./pricefeeds/feeds/RedstonePriceFeed.js";
|
|
118
|
+
import { WstETHPriceFeedContract } from "./pricefeeds/feeds/WstETHPriceFeed.js";
|
|
119
|
+
import { YearnPriceFeedContract } from "./pricefeeds/feeds/YearnPriceFeed.js";
|
|
120
|
+
import { ZeroPriceFeedContract } from "./pricefeeds/feeds/ZeroPriceFeed.js";
|
|
121
|
+
import { PriceFeedRegistry } from "./pricefeeds/PriceFeedRegistry.js";
|
|
119
122
|
import { fetchRedstonePayloads } from "./pricefeeds/updates/fetchRedstonePayloads.js";
|
|
120
|
-
import {
|
|
121
|
-
import {
|
|
122
|
-
import {
|
|
123
|
-
import {
|
|
123
|
+
import { getRawPriceUpdates } from "./pricefeeds/updates/getRawPriceUpdates.js";
|
|
124
|
+
import { isUpdatablePriceFeed } from "./pricefeeds/updates/isUpdatablePriceFeed.js";
|
|
125
|
+
import { PriceUpdatesCache } from "./pricefeeds/updates/PriceUpdatesCache.js";
|
|
126
|
+
import { RedstoneOptions, RedstoneUpdater } from "./pricefeeds/updates/RedstoneUpdater.js";
|
|
127
|
+
import { updatableDependencies } from "./pricefeeds/updates/updatableDependencies.js";
|
|
128
|
+
import { UpdatablePriceFeedRegistry } from "./pricefeeds/updates/UpdatablePriceFeedRegistry.js";
|
|
124
129
|
import "./pricefeeds/index.js";
|
|
125
130
|
import { PriceOracleV310Contract } from "./oracle/PriceOracleV310Contract.js";
|
|
126
131
|
import { createPriceOracle } from "./oracle/createPriceOracle.js";
|
|
@@ -145,4 +150,4 @@ import { RWARegistry, RWA_COMPRESSOR_ADDRESS } from "./rwa/RWARegistry.js";
|
|
|
145
150
|
import { isRWAFactory } from "./rwa/types.js";
|
|
146
151
|
import "./rwa/index.js";
|
|
147
152
|
import "./types.js";
|
|
148
|
-
export { AbstractAdapterContract, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterType, BalancerStablePriceFeedContract, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CamelotV3AdapterContract, CompositePriceFeedContract, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditConfiguratorV310Contract, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DaiUsdsAdapterContract, ERC4626AdapterContract, ERC4626ReferralAdapterContract, Erc4626PriceFeedContract, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, IERC20ZapperContract, IETHZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LidoV1AdapterContract, LinearInterestRateModelContract, MAX_LEVERAGE_BUFFER_BPS, MarketRegister, MarketSuite, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PartialPriceFeedInitError, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolSuite, PoolV310Contract, PriceFeedRef,
|
|
153
|
+
export { AbstractAdapterContract, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterType, BalancerStablePriceFeedContract, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CamelotV3AdapterContract, CompositePriceFeedContract, ConstantPriceFeedContract, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditConfiguratorV310Contract, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DaiUsdsAdapterContract, ERC4626AdapterContract, ERC4626ReferralAdapterContract, Erc4626PriceFeedContract, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, IERC20ZapperContract, IETHZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LidoV1AdapterContract, LinearInterestRateModelContract, MAX_LEVERAGE_BUFFER_BPS, MarketRegister, MarketSuite, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PartialPriceFeedInitError, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolSuite, PoolV310Contract, PriceFeedRef, PriceFeedRegistry, PriceOracleV310Contract, PriceUpdatesCache, PythPriceFeed, RWARegistry, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RedstoneOptions, RedstonePriceFeedContract, RedstoneUpdater, SecuritizeDegenNFT, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, TraderJoePoolVersion, TraderJoeRouterAdapterContract, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, UpshiftVaultAdapterContract, VelodromeV2RouterAdapterContract, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, ZapperContract, ZeroPriceFeedContract, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, classifyCurveOperation, collateralPriceInUnderlying, createAdapter, createPriceOracle, createZapper, abi as creditFacadeV310Abi, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, dominantCollateral, erc4626ReferralAdapterAbi, expectedBalanceDeltas, fetchRedstonePayloads, fnSigToName, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getRawPriceUpdates, hasAdapterDeployParamsAbi, healthFactorBps, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isLPPriceFeed, isRWAFactory, isStrategyCollateral, isUpdatablePriceFeed, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, minSeizedAmount, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, pickStrategyTargetCollateral, rayToBps, rewardsFromTransfers, strategyName, swapFromTransfers, toNetTransfers, updatableDependencies, usdToNumber };
|
|
@@ -16,7 +16,7 @@ import { safeValue } from "../../../model/result.js";
|
|
|
16
16
|
import "../../../model/index.js";
|
|
17
17
|
import { priceFeedCompressorAbi } from "../../../abi/compressors/priceFeedCompressor.js";
|
|
18
18
|
import { PriceFeedRef } from "../pricefeeds/PriceFeedRef.js";
|
|
19
|
-
import { getRawPriceUpdates } from "../pricefeeds/getRawPriceUpdates.js";
|
|
19
|
+
import { getRawPriceUpdates } from "../pricefeeds/updates/getRawPriceUpdates.js";
|
|
20
20
|
import "../pricefeeds/index.js";
|
|
21
21
|
import PriceFeedAnswerMap from "./PriceFeedAnswerMap.js";
|
|
22
22
|
import { isAddressEqual, stringToHex } from "viem";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
2
2
|
import "../../base/index.js";
|
|
3
|
-
import { isUpdatablePriceFeed } from "./isUpdatablePriceFeed.js";
|
|
4
3
|
import { PriceFeedRef } from "./PriceFeedRef.js";
|
|
5
4
|
//#region src/onchain/market/pricefeeds/AbstractPriceFeed.ts
|
|
6
5
|
var PartialPriceFeedInitError = class extends Error {
|
|
@@ -84,10 +83,6 @@ var AbstractPriceFeedContract = class extends BaseContract {
|
|
|
84
83
|
pricefeeds: this.underlyingPriceFeeds.map((f) => f.stateHuman(raw))
|
|
85
84
|
};
|
|
86
85
|
}
|
|
87
|
-
updatableDependencies() {
|
|
88
|
-
const underlying = this.underlyingPriceFeeds.flatMap((f) => f.priceFeed.updatableDependencies());
|
|
89
|
-
return isUpdatablePriceFeed(this) ? [this, ...underlying] : underlying;
|
|
90
|
-
}
|
|
91
86
|
/**
|
|
92
87
|
* {@inheritDoc IPriceFeedContract.describe}
|
|
93
88
|
*/
|