@defisaver/positions-sdk 2.1.127-midnight-1-dev → 2.1.127-midnight-2-dev
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/cjs/aaveV3/index.js +7 -1
- package/cjs/aaveV4/lend.js +3 -3
- package/cjs/claiming/index.d.ts +2 -1
- package/cjs/claiming/index.js +3 -1
- package/cjs/claiming/uniswap.d.ts +5 -0
- package/cjs/claiming/uniswap.js +75 -0
- package/cjs/config/contracts.d.ts +22 -0
- package/cjs/config/contracts.js +9 -1
- package/cjs/contracts.d.ts +35 -0
- package/cjs/contracts.js +2 -1
- package/cjs/curveUsd/index.js +1 -1
- package/cjs/helpers/morphoBlueHelpers/index.js +1 -0
- package/cjs/helpers/morphoMidnightHelpers/index.d.ts +33 -5
- package/cjs/helpers/morphoMidnightHelpers/index.js +66 -13
- package/cjs/llamaLend/index.js +1 -1
- package/cjs/markets/aaveV4/index.d.ts +2 -0
- package/cjs/markets/aaveV4/index.js +14 -1
- package/cjs/morphoBlue/index.d.ts +8 -6
- package/cjs/morphoBlue/index.js +69 -40
- package/cjs/portfolio/index.js +31 -2
- package/cjs/savings/summerVaults/options.js +10 -10
- package/cjs/staking/staking.js +3 -0
- package/cjs/types/aaveV4.d.ts +2 -1
- package/cjs/types/aaveV4.js +1 -0
- package/cjs/types/claiming.d.ts +10 -0
- package/cjs/types/claiming.js +2 -0
- package/cjs/types/morphoBlue.d.ts +9 -0
- package/esm/aaveV3/index.js +7 -1
- package/esm/aaveV4/lend.js +3 -3
- package/esm/claiming/index.d.ts +2 -1
- package/esm/claiming/index.js +2 -1
- package/esm/claiming/uniswap.d.ts +5 -0
- package/esm/claiming/uniswap.js +67 -0
- package/esm/config/contracts.d.ts +22 -0
- package/esm/config/contracts.js +8 -0
- package/esm/contracts.d.ts +35 -0
- package/esm/contracts.js +1 -0
- package/esm/curveUsd/index.js +1 -1
- package/esm/helpers/morphoBlueHelpers/index.js +1 -0
- package/esm/helpers/morphoMidnightHelpers/index.d.ts +33 -5
- package/esm/helpers/morphoMidnightHelpers/index.js +63 -12
- package/esm/llamaLend/index.js +1 -1
- package/esm/markets/aaveV4/index.d.ts +2 -0
- package/esm/markets/aaveV4/index.js +12 -0
- package/esm/morphoBlue/index.d.ts +8 -6
- package/esm/morphoBlue/index.js +62 -39
- package/esm/portfolio/index.js +32 -3
- package/esm/savings/summerVaults/options.js +10 -10
- package/esm/staking/staking.js +3 -0
- package/esm/types/aaveV4.d.ts +2 -1
- package/esm/types/aaveV4.js +1 -0
- package/esm/types/claiming.d.ts +10 -0
- package/esm/types/claiming.js +2 -0
- package/esm/types/morphoBlue.d.ts +9 -0
- package/package.json +2 -2
- package/src/aaveV3/index.ts +13 -1
- package/src/aaveV4/lend.ts +3 -3
- package/src/claiming/index.ts +2 -0
- package/src/claiming/uniswap.ts +70 -0
- package/src/config/contracts.ts +9 -0
- package/src/contracts.ts +2 -0
- package/src/curveUsd/index.ts +1 -1
- package/src/helpers/morphoBlueHelpers/index.ts +1 -0
- package/src/helpers/morphoMidnightHelpers/index.ts +87 -14
- package/src/llamaLend/index.ts +1 -1
- package/src/markets/aaveV4/index.ts +13 -0
- package/src/morphoBlue/index.ts +101 -44
- package/src/portfolio/index.ts +32 -3
- package/src/savings/summerVaults/options.ts +10 -10
- package/src/staking/staking.ts +2 -0
- package/src/types/aaveV4.ts +1 -0
- package/src/types/claiming.ts +11 -0
- package/src/types/morphoBlue.ts +11 -0
package/cjs/morphoBlue/index.js
CHANGED
|
@@ -12,9 +12,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getMorphoBlueAccountBalances = exports._getMorphoBlueAccountBalances = void 0;
|
|
15
|
+
exports.getMorphoBlueAccountBalances = exports._getMorphoBlueAccountBalances = exports.getMorphoEarnDataWithMarketInfo = exports.getMorphoBluePositionDataWithMarketInfo = exports.addMorphoBlueRewardsToMarketInfo = void 0;
|
|
16
16
|
exports._getMorphoBlueMarketData = _getMorphoBlueMarketData;
|
|
17
|
+
exports._getMorphoBluePortfolioMarketData = _getMorphoBluePortfolioMarketData;
|
|
17
18
|
exports.getMorphoBlueMarketData = getMorphoBlueMarketData;
|
|
19
|
+
exports.getMorphoBluePortfolioMarketData = getMorphoBluePortfolioMarketData;
|
|
20
|
+
exports.getMorphoBlueMarketRewards = getMorphoBlueMarketRewards;
|
|
18
21
|
exports._getMorphoBlueAccountData = _getMorphoBlueAccountData;
|
|
19
22
|
exports.getMorphoBlueAccountData = getMorphoBlueAccountData;
|
|
20
23
|
exports.getMorphoEarn = getMorphoEarn;
|
|
@@ -29,7 +32,21 @@ const morphoBlueHelpers_1 = require("../helpers/morphoBlueHelpers");
|
|
|
29
32
|
const priceService_1 = require("../services/priceService");
|
|
30
33
|
const viem_1 = require("../services/viem");
|
|
31
34
|
const HARDCODED_USD_STABLE_PRICE = '100000000'; // $1 with 8 decimals
|
|
32
|
-
|
|
35
|
+
const getMorphoRewardIncentives = (apy) => [{
|
|
36
|
+
token: 'MORPHO',
|
|
37
|
+
apy,
|
|
38
|
+
incentiveKind: common_1.IncentiveKind.Reward,
|
|
39
|
+
description: 'Eligible for protocol-level MORPHO incentives.',
|
|
40
|
+
}];
|
|
41
|
+
const addMorphoBlueRewardsToMarketInfo = (marketInfo, rewards) => (Object.assign(Object.assign({}, marketInfo), { assetsData: Object.assign(Object.assign({}, marketInfo.assetsData), { [marketInfo.loanToken]: Object.assign(Object.assign({}, marketInfo.assetsData[marketInfo.loanToken]), { supplyIncentives: [
|
|
42
|
+
...marketInfo.assetsData[marketInfo.loanToken].supplyIncentives.filter(({ token }) => token !== 'MORPHO'),
|
|
43
|
+
...getMorphoRewardIncentives(rewards.supplyApy),
|
|
44
|
+
], borrowIncentives: [
|
|
45
|
+
...marketInfo.assetsData[marketInfo.loanToken].borrowIncentives.filter(({ token }) => token !== 'MORPHO'),
|
|
46
|
+
...getMorphoRewardIncentives(rewards.borrowApy),
|
|
47
|
+
] }) }) }));
|
|
48
|
+
exports.addMorphoBlueRewardsToMarketInfo = addMorphoBlueRewardsToMarketInfo;
|
|
49
|
+
function getMorphoBlueMarketDataInternal(provider, network, selectedMarket) {
|
|
33
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
51
|
const { loanToken, collateralToken, oracle, irm, lltv, oracleType, } = selectedMarket;
|
|
35
52
|
const lltvInWei = new decimal_js_1.default(lltv).mul(constants_1.WAD).toString();
|
|
@@ -61,16 +78,6 @@ function _getMorphoBlueMarketData(provider, network, selectedMarket) {
|
|
|
61
78
|
marketInfo = _marketInfo;
|
|
62
79
|
loanTokenPrice = loanTokenPriceRound[1].toString();
|
|
63
80
|
}
|
|
64
|
-
let morphoSupplyApy = '0';
|
|
65
|
-
let morphoBorrowApy = '0';
|
|
66
|
-
try {
|
|
67
|
-
const { supplyApy: _morphoSupplyApy, borrowApy: _morphoBorrowApy } = yield (0, morphoBlueHelpers_1.getRewardsForMarket)(selectedMarket.marketId, network);
|
|
68
|
-
morphoSupplyApy = _morphoSupplyApy;
|
|
69
|
-
morphoBorrowApy = _morphoBorrowApy;
|
|
70
|
-
}
|
|
71
|
-
catch (e) {
|
|
72
|
-
console.error(e);
|
|
73
|
-
}
|
|
74
81
|
const supplyRate = (0, morphoBlueHelpers_1.getSupplyRate)(marketInfo.totalSupplyAssets.toString(), marketInfo.totalBorrowAssets.toString(), marketInfo.borrowRate.toString(), marketInfo.fee.toString());
|
|
75
82
|
const compoundedBorrowRate = (0, morphoBlueHelpers_1.getBorrowRate)(marketInfo.borrowRate.toString(), marketInfo.totalBorrowShares.toString());
|
|
76
83
|
const utillization = new decimal_js_1.default(marketInfo.totalBorrowAssets.toString()).div(marketInfo.totalSupplyAssets.toString()).mul(100).toString();
|
|
@@ -89,18 +96,8 @@ function _getMorphoBlueMarketData(provider, network, selectedMarket) {
|
|
|
89
96
|
totalBorrow: new decimal_js_1.default(marketInfo.totalBorrowAssets.toString()).div(scale).toString(),
|
|
90
97
|
canBeSupplied: true,
|
|
91
98
|
canBeBorrowed: true,
|
|
92
|
-
supplyIncentives: [
|
|
93
|
-
|
|
94
|
-
apy: morphoSupplyApy,
|
|
95
|
-
incentiveKind: common_1.IncentiveKind.Reward,
|
|
96
|
-
description: 'Eligible for protocol-level MORPHO incentives.',
|
|
97
|
-
}],
|
|
98
|
-
borrowIncentives: [{
|
|
99
|
-
token: 'MORPHO',
|
|
100
|
-
apy: morphoBorrowApy,
|
|
101
|
-
incentiveKind: common_1.IncentiveKind.Reward,
|
|
102
|
-
description: 'Eligible for protocol-level MORPHO incentives.',
|
|
103
|
-
}],
|
|
99
|
+
supplyIncentives: [],
|
|
100
|
+
borrowIncentives: [],
|
|
104
101
|
};
|
|
105
102
|
assetsData[(0, utils_1.wethToEth)(collateralTokenInfo.symbol)] = {
|
|
106
103
|
symbol: (0, utils_1.wethToEth)(collateralTokenInfo.symbol),
|
|
@@ -135,11 +132,56 @@ function _getMorphoBlueMarketData(provider, network, selectedMarket) {
|
|
|
135
132
|
};
|
|
136
133
|
});
|
|
137
134
|
}
|
|
135
|
+
function _getMorphoBlueMarketData(provider, network, selectedMarket) {
|
|
136
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
+
const marketInfo = yield getMorphoBlueMarketDataInternal(provider, network, selectedMarket);
|
|
138
|
+
try {
|
|
139
|
+
const rewards = yield (0, morphoBlueHelpers_1.getRewardsForMarket)(selectedMarket.marketId, network);
|
|
140
|
+
return (0, exports.addMorphoBlueRewardsToMarketInfo)(marketInfo, rewards);
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
console.error(error);
|
|
144
|
+
return (0, exports.addMorphoBlueRewardsToMarketInfo)(marketInfo, { supplyApy: '0', borrowApy: '0' });
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function _getMorphoBluePortfolioMarketData(provider, network, selectedMarket) {
|
|
149
|
+
return getMorphoBlueMarketDataInternal(provider, network, selectedMarket);
|
|
150
|
+
}
|
|
138
151
|
function getMorphoBlueMarketData(provider, network, selectedMarket) {
|
|
139
152
|
return __awaiter(this, void 0, void 0, function* () {
|
|
140
153
|
return _getMorphoBlueMarketData((0, viem_1.getViemProvider)(provider, network), network, selectedMarket);
|
|
141
154
|
});
|
|
142
155
|
}
|
|
156
|
+
function getMorphoBluePortfolioMarketData(provider, network, selectedMarket) {
|
|
157
|
+
return _getMorphoBluePortfolioMarketData((0, viem_1.getViemProvider)(provider, network), network, selectedMarket);
|
|
158
|
+
}
|
|
159
|
+
const getMorphoBluePositionDataWithMarketInfo = (data, marketInfo) => (Object.assign(Object.assign({}, data), (0, morphoBlueHelpers_1.getMorphoBlueAggregatedPositionData)({
|
|
160
|
+
usedAssets: data.usedAssets,
|
|
161
|
+
assetsData: marketInfo.assetsData,
|
|
162
|
+
marketInfo,
|
|
163
|
+
})));
|
|
164
|
+
exports.getMorphoBluePositionDataWithMarketInfo = getMorphoBluePositionDataWithMarketInfo;
|
|
165
|
+
const getMorphoEarnDataWithMarketInfo = (data, marketInfo) => {
|
|
166
|
+
const loanTokenInfo = marketInfo.assetsData[marketInfo.loanToken];
|
|
167
|
+
const usedAssets = {
|
|
168
|
+
[marketInfo.loanToken]: {
|
|
169
|
+
symbol: loanTokenInfo.symbol,
|
|
170
|
+
supplied: data.amount,
|
|
171
|
+
borrowed: '0',
|
|
172
|
+
isSupplied: new decimal_js_1.default(data.amount).gt(0),
|
|
173
|
+
isBorrowed: false,
|
|
174
|
+
collateral: false,
|
|
175
|
+
suppliedUsd: data.amountUsd,
|
|
176
|
+
borrowedUsd: '0',
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
return Object.assign(Object.assign({}, data), { apy: (0, staking_1.calculateNetApy)({ usedAssets, assetsData: marketInfo.assetsData }).netApy });
|
|
180
|
+
};
|
|
181
|
+
exports.getMorphoEarnDataWithMarketInfo = getMorphoEarnDataWithMarketInfo;
|
|
182
|
+
function getMorphoBlueMarketRewards(network, selectedMarket) {
|
|
183
|
+
return (0, morphoBlueHelpers_1.getRewardsForMarket)(selectedMarket.marketId, network);
|
|
184
|
+
}
|
|
143
185
|
const _getMorphoBlueAccountBalances = (provider, network, block, addressMapping, address, selectedMarket) => __awaiter(void 0, void 0, void 0, function* () {
|
|
144
186
|
let balances = {
|
|
145
187
|
collateral: {},
|
|
@@ -229,23 +271,10 @@ function getMorphoEarn(provider, network, account, selectedMarket, marketInfo) {
|
|
|
229
271
|
const loanTokenInfo = marketInfo.assetsData[marketInfo.loanToken];
|
|
230
272
|
const loanTokenSupplied = (0, tokens_1.assetAmountInEth)(loanInfo.suppliedInAssets.toString(), marketInfo.loanToken);
|
|
231
273
|
const loanTokenSuppliedUsd = new decimal_js_1.default(loanTokenSupplied).mul(loanTokenInfo.price).toString();
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
symbol: loanTokenInfo.symbol,
|
|
235
|
-
supplied: loanTokenSupplied,
|
|
236
|
-
borrowed: '0',
|
|
237
|
-
isSupplied: new decimal_js_1.default(loanInfo.suppliedInAssets.toString()).gt(0),
|
|
238
|
-
isBorrowed: false,
|
|
239
|
-
collateral: false,
|
|
240
|
-
suppliedUsd: loanTokenSuppliedUsd,
|
|
241
|
-
borrowedUsd: '0',
|
|
242
|
-
},
|
|
243
|
-
};
|
|
244
|
-
const { netApy } = (0, staking_1.calculateNetApy)({ usedAssets, assetsData: marketInfo.assetsData });
|
|
245
|
-
return {
|
|
246
|
-
apy: netApy,
|
|
274
|
+
return (0, exports.getMorphoEarnDataWithMarketInfo)({
|
|
275
|
+
apy: '0',
|
|
247
276
|
amount: loanTokenSupplied,
|
|
248
277
|
amountUsd: loanTokenSuppliedUsd,
|
|
249
|
-
};
|
|
278
|
+
}, marketInfo);
|
|
250
279
|
});
|
|
251
280
|
}
|
package/cjs/portfolio/index.js
CHANGED
|
@@ -55,6 +55,7 @@ const spark_2 = require("../claiming/spark");
|
|
|
55
55
|
const king_1 = require("../claiming/king");
|
|
56
56
|
const ethena_1 = require("../claiming/ethena");
|
|
57
57
|
const aaveV4_1 = require("../aaveV4");
|
|
58
|
+
const uniswap_1 = require("../claiming/uniswap");
|
|
58
59
|
function getPortfolioData(provider_1, network_1, defaultProvider_1, addresses_1) {
|
|
59
60
|
return __awaiter(this, arguments, void 0, function* (provider, network, defaultProvider, addresses, isSim = false) {
|
|
60
61
|
const isMainnet = network === common_1.NetworkNumber.Eth;
|
|
@@ -72,7 +73,7 @@ function getPortfolioData(provider_1, network_1, defaultProvider_1, addresses_1)
|
|
|
72
73
|
const liquityV2Markets = [common_1.NetworkNumber.Eth].includes(network) ? Object.values((0, markets_1.LiquityV2Markets)(network)) : [];
|
|
73
74
|
const liquityV2MarketsStaking = [common_1.NetworkNumber.Eth].includes(network) ? Object.values((0, markets_1.LiquityV2Markets)(network)).filter(market => !market.isLegacy) : [];
|
|
74
75
|
const aaveV4Spokes = Object.values((0, markets_1.AaveV4Spokes)(network)).filter((market) => market.chainIds.includes(network));
|
|
75
|
-
const args = [network, { batch: { multicall: { batchSize: isSim ?
|
|
76
|
+
const args = [network, { batch: { multicall: { batchSize: isSim ? 2000 : 2500000 } } }];
|
|
76
77
|
const client = (0, viem_1.getViemProvider)(provider, ...args);
|
|
77
78
|
const defaultClient = (0, viem_1.getViemProvider)(defaultProvider, ...args);
|
|
78
79
|
const morphoMarketsData = {};
|
|
@@ -157,7 +158,7 @@ function getPortfolioData(provider_1, network_1, defaultProvider_1, addresses_1)
|
|
|
157
158
|
yield Promise.allSettled([
|
|
158
159
|
// === MARKET DATA (needs to be fetched first) ===
|
|
159
160
|
...morphoMarkets.map((market) => __awaiter(this, void 0, void 0, function* () {
|
|
160
|
-
const marketData = yield (0, morphoBlue_1.
|
|
161
|
+
const marketData = yield (0, morphoBlue_1._getMorphoBluePortfolioMarketData)(client, network, market);
|
|
161
162
|
morphoMarketsData[market.value] = marketData;
|
|
162
163
|
})),
|
|
163
164
|
...morphoMidnightMarkets.map((market) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -319,6 +320,34 @@ function getPortfolioData(provider_1, network_1, defaultProvider_1, addresses_1)
|
|
|
319
320
|
}
|
|
320
321
|
}
|
|
321
322
|
}))(),
|
|
323
|
+
// Batch UNI rewards
|
|
324
|
+
(() => __awaiter(this, void 0, void 0, function* () {
|
|
325
|
+
try {
|
|
326
|
+
if (!isMainnet) {
|
|
327
|
+
for (const address of addresses) {
|
|
328
|
+
rewardsData[address.toLowerCase()].uniswap = { error: '', data: [] };
|
|
329
|
+
}
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
const uniswapRewards = yield (0, uniswap_1.getUniswapRewards)(client, network, addresses);
|
|
333
|
+
for (const address of addresses) {
|
|
334
|
+
const lowerAddress = address.toLowerCase();
|
|
335
|
+
rewardsData[lowerAddress].uniswap = {
|
|
336
|
+
error: '',
|
|
337
|
+
data: uniswapRewards[lowerAddress] || [],
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
catch (error) {
|
|
342
|
+
console.error('Error fetching Uniswap rewards data in batch:', error);
|
|
343
|
+
for (const address of addresses) {
|
|
344
|
+
rewardsData[address.toLowerCase()].uniswap = {
|
|
345
|
+
error: 'Error fetching Uniswap rewards data in batch',
|
|
346
|
+
data: null,
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}))(),
|
|
322
351
|
...sparkMarkets.map((market) => addresses.map((address) => __awaiter(this, void 0, void 0, function* () {
|
|
323
352
|
try {
|
|
324
353
|
if (!isMainnet) {
|
|
@@ -10,7 +10,7 @@ exports.SUMMER_VAULT_USDC_MAINNET_LR = {
|
|
|
10
10
|
asset: 'USDC',
|
|
11
11
|
network: common_1.NetworkNumber.Eth,
|
|
12
12
|
deploymentBlock: 21795049,
|
|
13
|
-
isLegacy:
|
|
13
|
+
isLegacy: true,
|
|
14
14
|
};
|
|
15
15
|
exports.SUMMER_VAULT_USDC_MAINNET_HR = {
|
|
16
16
|
type: types_1.SummerVaultType.SummerVaultUSDCMainnetHR,
|
|
@@ -19,7 +19,7 @@ exports.SUMMER_VAULT_USDC_MAINNET_HR = {
|
|
|
19
19
|
asset: 'USDC',
|
|
20
20
|
network: common_1.NetworkNumber.Eth,
|
|
21
21
|
deploymentBlock: 22488041,
|
|
22
|
-
isLegacy:
|
|
22
|
+
isLegacy: true,
|
|
23
23
|
};
|
|
24
24
|
exports.SUMMER_VAULT_USDT_MAINNET_LR = {
|
|
25
25
|
type: types_1.SummerVaultType.SummerVaultUSDTMainnetLR,
|
|
@@ -28,7 +28,7 @@ exports.SUMMER_VAULT_USDT_MAINNET_LR = {
|
|
|
28
28
|
asset: 'USDT',
|
|
29
29
|
network: common_1.NetworkNumber.Eth,
|
|
30
30
|
deploymentBlock: 21795276,
|
|
31
|
-
isLegacy:
|
|
31
|
+
isLegacy: true,
|
|
32
32
|
};
|
|
33
33
|
exports.SUMMER_VAULT_ETH_MAINNET_LR = {
|
|
34
34
|
type: types_1.SummerVaultType.SummerVaultETHMainnetLR,
|
|
@@ -37,7 +37,7 @@ exports.SUMMER_VAULT_ETH_MAINNET_LR = {
|
|
|
37
37
|
asset: 'WETH',
|
|
38
38
|
network: common_1.NetworkNumber.Eth,
|
|
39
39
|
deploymentBlock: 21795390,
|
|
40
|
-
isLegacy:
|
|
40
|
+
isLegacy: true,
|
|
41
41
|
};
|
|
42
42
|
exports.SUMMER_VAULT_ETH_MAINNET_HR = {
|
|
43
43
|
type: types_1.SummerVaultType.SummerVaultETHMainnetHR,
|
|
@@ -46,7 +46,7 @@ exports.SUMMER_VAULT_ETH_MAINNET_HR = {
|
|
|
46
46
|
asset: 'WETH',
|
|
47
47
|
network: common_1.NetworkNumber.Eth,
|
|
48
48
|
deploymentBlock: 22291252,
|
|
49
|
-
isLegacy:
|
|
49
|
+
isLegacy: true,
|
|
50
50
|
};
|
|
51
51
|
exports.SUMMER_VAULT_USDC_ARBITRUM_LR = {
|
|
52
52
|
type: types_1.SummerVaultType.SummerVaultUSDCArbitrumLR,
|
|
@@ -55,7 +55,7 @@ exports.SUMMER_VAULT_USDC_ARBITRUM_LR = {
|
|
|
55
55
|
asset: 'USDC',
|
|
56
56
|
network: common_1.NetworkNumber.Arb,
|
|
57
57
|
deploymentBlock: 404339289,
|
|
58
|
-
isLegacy:
|
|
58
|
+
isLegacy: true,
|
|
59
59
|
};
|
|
60
60
|
exports.SUMMER_VAULT_USDT_ARBITRUM_LR = {
|
|
61
61
|
type: types_1.SummerVaultType.SummerVaultUSDTArbitrumLR,
|
|
@@ -64,7 +64,7 @@ exports.SUMMER_VAULT_USDT_ARBITRUM_LR = {
|
|
|
64
64
|
asset: 'USDT',
|
|
65
65
|
network: common_1.NetworkNumber.Arb,
|
|
66
66
|
deploymentBlock: 303594065,
|
|
67
|
-
isLegacy:
|
|
67
|
+
isLegacy: true,
|
|
68
68
|
};
|
|
69
69
|
exports.SUMMER_VAULT_USDC_BASE_LR = {
|
|
70
70
|
type: types_1.SummerVaultType.SummerVaultUSDCBaseLR,
|
|
@@ -73,7 +73,7 @@ exports.SUMMER_VAULT_USDC_BASE_LR = {
|
|
|
73
73
|
asset: 'USDC',
|
|
74
74
|
network: common_1.NetworkNumber.Base,
|
|
75
75
|
deploymentBlock: 303594065,
|
|
76
|
-
isLegacy:
|
|
76
|
+
isLegacy: true,
|
|
77
77
|
};
|
|
78
78
|
exports.SUMMER_VAULT_EURC_BASE_LR = {
|
|
79
79
|
type: types_1.SummerVaultType.SummerVaultEURCBaseLR,
|
|
@@ -82,7 +82,7 @@ exports.SUMMER_VAULT_EURC_BASE_LR = {
|
|
|
82
82
|
asset: 'EURC',
|
|
83
83
|
network: common_1.NetworkNumber.Base,
|
|
84
84
|
deploymentBlock: 27544064,
|
|
85
|
-
isLegacy:
|
|
85
|
+
isLegacy: true,
|
|
86
86
|
};
|
|
87
87
|
exports.SUMMER_VAULT_ETH_BASE_LR = {
|
|
88
88
|
type: types_1.SummerVaultType.SummerVaultETHBaseLR,
|
|
@@ -91,7 +91,7 @@ exports.SUMMER_VAULT_ETH_BASE_LR = {
|
|
|
91
91
|
asset: 'WETH',
|
|
92
92
|
network: common_1.NetworkNumber.Base,
|
|
93
93
|
deploymentBlock: 29066887,
|
|
94
|
-
isLegacy:
|
|
94
|
+
isLegacy: true,
|
|
95
95
|
};
|
|
96
96
|
exports.SUMMER_VAULTS = {
|
|
97
97
|
[types_1.SummerVaultType.SummerVaultUSDCMainnetLR]: exports.SUMMER_VAULT_USDC_MAINNET_LR,
|
package/cjs/staking/staking.js
CHANGED
|
@@ -74,6 +74,7 @@ exports.STAKING_ASSETS = [
|
|
|
74
74
|
'PT sUSDe Nov', 'PT USDe Nov', 'PT USDe Jan', 'PT sUSDe Jan', 'wrsETH', 'wstETH', 'syrupUSDT', 'syrupUSDC', 'wstUSR',
|
|
75
75
|
'PT sUSDe Feb', 'PT USDe Feb', 'PT sUSDe Apr', 'PT USDe Apr', 'PT sUSDe May', 'PT USDe May', 'PT srUSDe Apr', 'GHO',
|
|
76
76
|
'PT sUSDe June', 'PT USDe June', 'PT srUSDe Jun', 'PT srUSDe Oct', 'PT USDG May', 'PT sUSDS Nov', 'PT sUSDe Oct', 'PT USDG Sep',
|
|
77
|
+
'syrupUSDG',
|
|
77
78
|
];
|
|
78
79
|
exports.getStakingApy = (0, memoizee_1.default)((asset_1, ...args_1) => __awaiter(void 0, [asset_1, ...args_1], void 0, function* (asset, network = common_1.NetworkNumber.Eth) {
|
|
79
80
|
try {
|
|
@@ -131,6 +132,8 @@ exports.getStakingApy = (0, memoizee_1.default)((asset_1, ...args_1) => __awaite
|
|
|
131
132
|
return yield getApyFromDfsApi('syrupUSDT');
|
|
132
133
|
if (asset === 'syrupUSDC')
|
|
133
134
|
return yield getApyFromDfsApi('syrupUSDC');
|
|
135
|
+
if (asset === 'syrupUSDG')
|
|
136
|
+
return yield getApyFromDfsApi('syrupUSDG');
|
|
134
137
|
if (asset === 'wstUSR')
|
|
135
138
|
return yield getApyFromDfsApi('wstUSR');
|
|
136
139
|
if (asset === 'PT sUSDe Feb')
|
package/cjs/types/aaveV4.d.ts
CHANGED
|
@@ -16,7 +16,8 @@ export declare enum AaveV4SpokesType {
|
|
|
16
16
|
AaveV4LidoSpoke = "aave_v4_lido_spoke",
|
|
17
17
|
AaveV4LombardBtcSpoke = "aave_v4_lombard_btc_spoke",
|
|
18
18
|
AaveV4MainSpoke = "aave_v4_main_spoke",
|
|
19
|
-
AaveV4USDGPendleSpoke = "aave_v4_usdg_pendle_spoke"
|
|
19
|
+
AaveV4USDGPendleSpoke = "aave_v4_usdg_pendle_spoke",
|
|
20
|
+
AaveV4USDGMapleSpoke = "aave_v4_usdg_maple_spoke"
|
|
20
21
|
}
|
|
21
22
|
export interface AaveV4HubInfo {
|
|
22
23
|
chainIds: NetworkNumber[];
|
package/cjs/types/aaveV4.js
CHANGED
|
@@ -21,4 +21,5 @@ var AaveV4SpokesType;
|
|
|
21
21
|
AaveV4SpokesType["AaveV4LombardBtcSpoke"] = "aave_v4_lombard_btc_spoke";
|
|
22
22
|
AaveV4SpokesType["AaveV4MainSpoke"] = "aave_v4_main_spoke";
|
|
23
23
|
AaveV4SpokesType["AaveV4USDGPendleSpoke"] = "aave_v4_usdg_pendle_spoke";
|
|
24
|
+
AaveV4SpokesType["AaveV4USDGMapleSpoke"] = "aave_v4_usdg_maple_spoke";
|
|
24
25
|
})(AaveV4SpokesType || (exports.AaveV4SpokesType = AaveV4SpokesType = {}));
|
package/cjs/types/claiming.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export declare enum ClaimType {
|
|
|
14
14
|
SPARK_AIRDROP = "SPARK_AIRDROP",
|
|
15
15
|
/** Spark Airdrop */
|
|
16
16
|
SPARK_WST_ETH_REWARDS = "SPARK_WST_ETH_REWARDS",// TODO: This will be removed once we fully refactor spark rewards
|
|
17
|
+
/** UNI Airdrop */
|
|
18
|
+
UNI_REWARDS = "UNI_REWARDS",
|
|
17
19
|
ETHENA_AIRDROP = "ETHENA_AIRDROP"
|
|
18
20
|
}
|
|
19
21
|
type _ClaimableTokenPartial = {
|
|
@@ -81,5 +83,13 @@ export type SparkWstEthRewardsClaimableToken = _ClaimableTokenPartial & {
|
|
|
81
83
|
export type EthenaAirdropClaimableToken = _ClaimableTokenPartial & {
|
|
82
84
|
claimType: ClaimType.ETHENA_AIRDROP;
|
|
83
85
|
};
|
|
86
|
+
export type UniswapAirdropClaimableToken = _ClaimableTokenPartial & {
|
|
87
|
+
claimType: ClaimType.UNI_REWARDS;
|
|
88
|
+
additionalClaimFields: {
|
|
89
|
+
index: number;
|
|
90
|
+
isClaimed: boolean;
|
|
91
|
+
proof: string[];
|
|
92
|
+
};
|
|
93
|
+
};
|
|
84
94
|
export type ClaimableToken = AaveRewardsClaimableToken | AaveMeritRewardsClaimableToken | CompoundV3CompClaimableToken | SparkRewardsClaimableToken | KingRewardsClaimableToken | SparkAirdropClaimableToken | SparkWstEthRewardsClaimableToken | EthenaAirdropClaimableToken;
|
|
85
95
|
export {};
|
package/cjs/types/claiming.js
CHANGED
|
@@ -17,6 +17,8 @@ var ClaimType;
|
|
|
17
17
|
ClaimType["SPARK_AIRDROP"] = "SPARK_AIRDROP";
|
|
18
18
|
/** Spark Airdrop */
|
|
19
19
|
ClaimType["SPARK_WST_ETH_REWARDS"] = "SPARK_WST_ETH_REWARDS";
|
|
20
|
+
/** UNI Airdrop */
|
|
21
|
+
ClaimType["UNI_REWARDS"] = "UNI_REWARDS";
|
|
20
22
|
ClaimType["ETHENA_AIRDROP"] = "ETHENA_AIRDROP";
|
|
21
23
|
})(ClaimType || (exports.ClaimType = ClaimType = {}));
|
|
22
24
|
var SparkAirdropType;
|
|
@@ -212,6 +212,15 @@ export interface MorphoBluePositionData {
|
|
|
212
212
|
borrowShares: string;
|
|
213
213
|
exposure: string;
|
|
214
214
|
}
|
|
215
|
+
export interface MorphoBlueEarnData {
|
|
216
|
+
apy: string;
|
|
217
|
+
amount: string;
|
|
218
|
+
amountUsd: string;
|
|
219
|
+
}
|
|
220
|
+
export interface MorphoBlueMarketRewards {
|
|
221
|
+
supplyApy: string;
|
|
222
|
+
borrowApy: string;
|
|
223
|
+
}
|
|
215
224
|
export interface MorphoBlueVault {
|
|
216
225
|
address: string;
|
|
217
226
|
}
|
package/esm/aaveV3/index.js
CHANGED
|
@@ -53,9 +53,15 @@ export function _getAaveV3MarketData(provider_1, network_1, market_1) {
|
|
|
53
53
|
const aaveIncentivesContract = AaveIncentiveDataProviderV3ContractViem(provider, network);
|
|
54
54
|
const marketAddress = market.providerAddress;
|
|
55
55
|
const networksWithIncentives = [NetworkNumber.Eth, NetworkNumber.Arb, NetworkNumber.Opt, NetworkNumber.Linea, NetworkNumber.Plasma];
|
|
56
|
+
// Limit each view call to 10 tokens, run chunks concurrently, then combine their results into loanInfo.
|
|
57
|
+
const addressesPerRequest = 10;
|
|
58
|
+
const addressChunks = _addresses.length > addressesPerRequest
|
|
59
|
+
? Array.from({ length: Math.ceil(_addresses.length / addressesPerRequest) }, (_, index) => _addresses.slice(index * addressesPerRequest, (index + 1) * addressesPerRequest))
|
|
60
|
+
: [_addresses];
|
|
61
|
+
const loanInfoPromise = Promise.all(addressChunks.map((addresses) => loanInfoContract.read.getFullTokensInfo([marketAddress, addresses], setViemBlockNumber(blockNumber)))).then((loanInfoChunks) => loanInfoChunks.flat());
|
|
56
62
|
// eslint-disable-next-line prefer-const
|
|
57
63
|
let [loanInfo, eModesInfo, rewardInfo, merkleRewardsMap, meritRewardsMap] = yield Promise.all([
|
|
58
|
-
|
|
64
|
+
loanInfoPromise,
|
|
59
65
|
loanInfoContract.read.getAllEmodes([marketAddress], setViemBlockNumber(blockNumber)),
|
|
60
66
|
networksWithIncentives.includes(network) ? aaveIncentivesContract.read.getReservesIncentivesData([marketAddress], setViemBlockNumber(blockNumber)) : null,
|
|
61
67
|
getMerkleCampaigns(network),
|
package/esm/aaveV4/lend.js
CHANGED
|
@@ -30,9 +30,9 @@ export const AAVE_V4_TOKENIZED_SPOKES = {
|
|
|
30
30
|
GHO_PRIME: '0x900fD46d565d1ac8995928c0179052ec02a6D0E1',
|
|
31
31
|
USDC_PRIME: '0x486415fb1F8b062c89ED548f871cf64304AACb31',
|
|
32
32
|
USDT_PRIME: '0x46c588DD8453aC259c1f6a54b4C9A93C2aC3762D',
|
|
33
|
-
USDC_PAXOS: '
|
|
34
|
-
USDT_PAXOS: '
|
|
35
|
-
PT_USDG_Sep_PAXOS: '
|
|
33
|
+
USDC_PAXOS: '0xaed7c529bD2878170B61C758DfAa215AC7a4FD07',
|
|
34
|
+
USDT_PAXOS: '0xa0e97e45C2f89003730E467Bd484fA3eEcE5B4Cf',
|
|
35
|
+
PT_USDG_Sep_PAXOS: '0x7Df10B4A01350D2A1d95cFbE7c9207d7210A2663',
|
|
36
36
|
};
|
|
37
37
|
export const AAVE_V4_TOKENIZED_SPOKE_ADDRESSES = {
|
|
38
38
|
[NetworkNumber.Eth]: Object.values(AAVE_V4_TOKENIZED_SPOKES),
|
package/esm/claiming/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ import * as aaveV3Claim from './aaveV3';
|
|
|
2
2
|
import * as compV3Claim from './compV3';
|
|
3
3
|
import * as kingV3Claim from './king';
|
|
4
4
|
import * as sparkClaim from './spark';
|
|
5
|
-
|
|
5
|
+
import * as uniswapClaim from './uniswap';
|
|
6
|
+
export { aaveV3Claim, compV3Claim, kingV3Claim, sparkClaim, uniswapClaim, };
|
package/esm/claiming/index.js
CHANGED
|
@@ -2,4 +2,5 @@ import * as aaveV3Claim from './aaveV3';
|
|
|
2
2
|
import * as compV3Claim from './compV3';
|
|
3
3
|
import * as kingV3Claim from './king';
|
|
4
4
|
import * as sparkClaim from './spark';
|
|
5
|
-
|
|
5
|
+
import * as uniswapClaim from './uniswap';
|
|
6
|
+
export { aaveV3Claim, compV3Claim, kingV3Claim, sparkClaim, uniswapClaim, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Client } from 'viem';
|
|
2
|
+
import { EthAddress, NetworkNumber } from '../types';
|
|
3
|
+
import { UniswapAirdropClaimableToken } from '../types/claiming';
|
|
4
|
+
export declare const fetchUniswapRewardsData: (walletAddress: EthAddress) => Promise<any>;
|
|
5
|
+
export declare const getUniswapRewards: (provider: Client, network: NetworkNumber, walletAddresses: EthAddress[]) => Promise<Record<string, UniswapAirdropClaimableToken[]>>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import Dec from 'decimal.js';
|
|
11
|
+
import { assetAmountInEth } from '@defisaver/tokens';
|
|
12
|
+
import { UniswapTokenDistributorViem } from '../contracts';
|
|
13
|
+
import { ClaimType } from '../types/claiming';
|
|
14
|
+
const EMPTY_DATA = (walletAddress) => ({
|
|
15
|
+
address: walletAddress, index: 0, amount: '0x0', proof: [],
|
|
16
|
+
});
|
|
17
|
+
export const fetchUniswapRewardsData = (walletAddress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
try {
|
|
19
|
+
const res = yield fetch(`https://fe.defisaver.com/api/rewards/uniswap?user=${walletAddress}`, { signal: AbortSignal.timeout(5000) });
|
|
20
|
+
if (!res.ok)
|
|
21
|
+
throw new Error(yield res.text());
|
|
22
|
+
const data = yield res.json();
|
|
23
|
+
if (data.data.error)
|
|
24
|
+
return EMPTY_DATA(walletAddress);
|
|
25
|
+
return data.data;
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
return EMPTY_DATA(walletAddress);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export const getUniswapRewards = (provider, network, walletAddresses) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
+
// Fetch all API data in parallel (these are external API calls, can't be batched with multicall)
|
|
33
|
+
const apiDataPromises = walletAddresses.map(address => fetchUniswapRewardsData(address));
|
|
34
|
+
const apiDataArray = yield Promise.all(apiDataPromises);
|
|
35
|
+
// Batch all contract calls using multicall
|
|
36
|
+
const contract = UniswapTokenDistributorViem(provider, network);
|
|
37
|
+
const cumulativePromises = apiDataArray.map(data => (data.index ? contract.read.isClaimed([data.index]) : Promise.resolve(false)));
|
|
38
|
+
const cumulativeResults = yield Promise.all(cumulativePromises);
|
|
39
|
+
// Process results
|
|
40
|
+
const results = {};
|
|
41
|
+
for (let i = 0; i < walletAddresses.length; i++) {
|
|
42
|
+
const walletAddress = walletAddresses[i];
|
|
43
|
+
const data = apiDataArray[i];
|
|
44
|
+
const cumulative = cumulativeResults[i];
|
|
45
|
+
const amountToClaim = new Dec(data.amount);
|
|
46
|
+
if (amountToClaim.lessThanOrEqualTo('0') || cumulative) {
|
|
47
|
+
results[walletAddress.toLowerCase()] = [];
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
results[walletAddress.toLowerCase()] = [{
|
|
51
|
+
symbol: 'UNI',
|
|
52
|
+
underlyingSymbol: 'UNI',
|
|
53
|
+
label: 'Uniswap Airdrop',
|
|
54
|
+
tokenAddress: '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984',
|
|
55
|
+
amount: assetAmountInEth(amountToClaim.toString(), 'UNI'),
|
|
56
|
+
walletAddress,
|
|
57
|
+
claimType: ClaimType.UNI_REWARDS,
|
|
58
|
+
additionalClaimFields: {
|
|
59
|
+
index: data.index,
|
|
60
|
+
isClaimed: cumulative,
|
|
61
|
+
proof: data.proof,
|
|
62
|
+
},
|
|
63
|
+
}];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return results;
|
|
67
|
+
});
|
|
@@ -99340,3 +99340,25 @@ export declare const AaveV4View: {
|
|
|
99340
99340
|
};
|
|
99341
99341
|
};
|
|
99342
99342
|
};
|
|
99343
|
+
export declare const UniswapTokenDistributor: {
|
|
99344
|
+
readonly abi: readonly [{
|
|
99345
|
+
readonly inputs: readonly [{
|
|
99346
|
+
readonly internalType: "uint256";
|
|
99347
|
+
readonly name: "index";
|
|
99348
|
+
readonly type: "uint256";
|
|
99349
|
+
}];
|
|
99350
|
+
readonly name: "isClaimed";
|
|
99351
|
+
readonly outputs: readonly [{
|
|
99352
|
+
readonly internalType: "bool";
|
|
99353
|
+
readonly name: "";
|
|
99354
|
+
readonly type: "bool";
|
|
99355
|
+
}];
|
|
99356
|
+
readonly stateMutability: "view";
|
|
99357
|
+
readonly type: "function";
|
|
99358
|
+
}];
|
|
99359
|
+
readonly networks: {
|
|
99360
|
+
readonly "1": {
|
|
99361
|
+
readonly address: "0x090D4613473dEE047c3f2706764f49E0821D256e";
|
|
99362
|
+
};
|
|
99363
|
+
};
|
|
99364
|
+
};
|
package/esm/config/contracts.js
CHANGED
|
@@ -1358,3 +1358,11 @@ export const AaveV4View = {
|
|
|
1358
1358
|
}
|
|
1359
1359
|
}
|
|
1360
1360
|
};
|
|
1361
|
+
export const UniswapTokenDistributor = {
|
|
1362
|
+
"abi": [{ "inputs": [{ "internalType": "uint256", "name": "index", "type": "uint256" }], "name": "isClaimed", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }],
|
|
1363
|
+
"networks": {
|
|
1364
|
+
"1": {
|
|
1365
|
+
"address": "0x090D4613473dEE047c3f2706764f49E0821D256e",
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
};
|
package/esm/contracts.d.ts
CHANGED
|
@@ -619752,3 +619752,38 @@ export declare const AaveV4ViewContractViem: (client: Client, network: NetworkNu
|
|
|
619752
619752
|
readonly type: "function";
|
|
619753
619753
|
}];
|
|
619754
619754
|
};
|
|
619755
|
+
export declare const UniswapTokenDistributorViem: (client: Client, network: NetworkNumber, block?: Blockish) => {
|
|
619756
|
+
read: {
|
|
619757
|
+
isClaimed: (args: readonly [bigint], options?: import("viem").Prettify<import("viem").UnionOmit<import("viem").ReadContractParameters<readonly [{
|
|
619758
|
+
readonly inputs: readonly [{
|
|
619759
|
+
readonly internalType: "uint256";
|
|
619760
|
+
readonly name: "index";
|
|
619761
|
+
readonly type: "uint256";
|
|
619762
|
+
}];
|
|
619763
|
+
readonly name: "isClaimed";
|
|
619764
|
+
readonly outputs: readonly [{
|
|
619765
|
+
readonly internalType: "bool";
|
|
619766
|
+
readonly name: "";
|
|
619767
|
+
readonly type: "bool";
|
|
619768
|
+
}];
|
|
619769
|
+
readonly stateMutability: "view";
|
|
619770
|
+
readonly type: "function";
|
|
619771
|
+
}], "isClaimed", readonly [bigint]>, "address" | "args" | "abi" | "functionName">> | undefined) => Promise<boolean>;
|
|
619772
|
+
};
|
|
619773
|
+
address: `0x${string}`;
|
|
619774
|
+
abi: readonly [{
|
|
619775
|
+
readonly inputs: readonly [{
|
|
619776
|
+
readonly internalType: "uint256";
|
|
619777
|
+
readonly name: "index";
|
|
619778
|
+
readonly type: "uint256";
|
|
619779
|
+
}];
|
|
619780
|
+
readonly name: "isClaimed";
|
|
619781
|
+
readonly outputs: readonly [{
|
|
619782
|
+
readonly internalType: "bool";
|
|
619783
|
+
readonly name: "";
|
|
619784
|
+
readonly type: "bool";
|
|
619785
|
+
}];
|
|
619786
|
+
readonly stateMutability: "view";
|
|
619787
|
+
readonly type: "function";
|
|
619788
|
+
}];
|
|
619789
|
+
};
|
package/esm/contracts.js
CHANGED
|
@@ -142,3 +142,4 @@ export const YearnViewContractViem = createViemContractFromConfigFunc('YearnView
|
|
|
142
142
|
export const MakerDsrContractViem = createViemContractFromConfigFunc('MakerDsr');
|
|
143
143
|
export const SkySavingsContractView = createViemContractFromConfigFunc('SkySavings');
|
|
144
144
|
export const AaveV4ViewContractViem = createViemContractFromConfigFunc('AaveV4View');
|
|
145
|
+
export const UniswapTokenDistributorViem = createViemContractFromConfigFunc('UniswapTokenDistributor');
|
package/esm/curveUsd/index.js
CHANGED
|
@@ -24,7 +24,7 @@ const getAndFormatBands = (provider, network, selectedMarket, _minBand, _maxBand
|
|
|
24
24
|
// getBandsData uses a lot of gas to get all of the bands at once, so we use pagination and fetch 200 bands at a time
|
|
25
25
|
let i = minBand;
|
|
26
26
|
while (i < maxBand) {
|
|
27
|
-
i +=
|
|
27
|
+
i += 20;
|
|
28
28
|
if (i > maxBand) {
|
|
29
29
|
pivots.push(maxBand);
|
|
30
30
|
}
|
|
@@ -348,6 +348,7 @@ export const getRewardsForMarket = (marketId_1, ...args_1) => __awaiter(void 0,
|
|
|
348
348
|
query: REWARDS_QUERY,
|
|
349
349
|
variables: { marketId, chainId: network },
|
|
350
350
|
}),
|
|
351
|
+
signal: AbortSignal.timeout(LONGER_TIMEOUT),
|
|
351
352
|
});
|
|
352
353
|
const data = yield response.json();
|
|
353
354
|
const marketData = (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.marketById;
|