@1delta/margin-fetcher 0.0.36 → 0.0.38
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/lending/aave-v2-type/misc.d.ts +3 -9
- package/dist/lending/aave-v2-type/misc.d.ts.map +1 -1
- package/dist/lending/aave-v2-type/publicCallParse.d.ts +4 -4
- package/dist/lending/aave-v2-type/publicCallParse.d.ts.map +1 -1
- package/dist/lending/aave-v2-type/publicCallParse.js +60 -32
- package/dist/lending/addresses/contracts.d.ts +0 -1
- package/dist/lending/addresses/contracts.d.ts.map +1 -1
- package/dist/lending/addresses/contracts.js +0 -17
- package/dist/lending/addresses/meridian.d.ts +3 -0
- package/dist/lending/addresses/meridian.d.ts.map +1 -1
- package/dist/lending/addresses/meridian.js +4 -1
- package/dist/lending/meta/index.js +1 -1
- package/dist/prices/defillama/index.d.ts.map +1 -1
- package/dist/prices/defillama/index.js +14 -2
- package/dist/prices/main-prices/fetchOracleData.d.ts.map +1 -1
- package/dist/prices/main-prices/fetchOracleData.js +7 -3
- package/dist/utils/constants.d.ts +0 -23
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +4 -23
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -5
- package/dist/yields/index.d.ts.map +1 -1
- package/dist/yields/index.js +17 -1
- package/package.json +2 -2
- package/src/lending/aave-v2-type/publicCallParse.ts +334 -92
- package/src/lending/addresses/contracts.ts +0 -20
- package/src/lending/addresses/meridian.ts +4 -1
- package/src/lending/meta/index.ts +1 -1
- package/src/prices/defillama/index.ts +16 -2
- package/src/prices/main-prices/fetchOracleData.ts +10 -3
- package/src/utils/constants.ts +43 -61
- package/src/utils/index.ts +0 -6
- package/src/yields/index.ts +18 -0
- package/test/flashLiquidity.test.ts +27 -20
- package/test/lenderData.test.ts +7 -4
- package/test/mainPrices.test.ts +5 -11
- package/test/userDataAaveTelos.test.ts +85 -0
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare const AURELIUS_REWARD_ASSETS: {
|
|
2
|
+
chainId: string;
|
|
3
3
|
decimals: number;
|
|
4
4
|
name: string;
|
|
5
5
|
address: string;
|
|
6
6
|
symbol: string;
|
|
7
|
-
}
|
|
8
|
-
chainId: Chain;
|
|
9
|
-
address: string;
|
|
10
|
-
decimals: number;
|
|
11
|
-
symbol: string;
|
|
12
|
-
name: string;
|
|
13
|
-
})[];
|
|
7
|
+
}[];
|
|
14
8
|
//# sourceMappingURL=misc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../src/lending/aave-v2-type/misc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../src/lending/aave-v2-type/misc.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB;;;;;;GASlC,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Lender } from
|
|
2
|
-
import { AaveV2GeneralPublicResponse } from
|
|
3
|
-
import { AdditionalYields } from
|
|
4
|
-
import { GenericTokenList } from
|
|
1
|
+
import { Lender } from '@1delta/lender-registry';
|
|
2
|
+
import { AaveV2GeneralPublicResponse } from './types';
|
|
3
|
+
import { AdditionalYields } from '../../types';
|
|
4
|
+
import { GenericTokenList } from '../types';
|
|
5
5
|
export declare const getAaveV2ReservesDataConverter: (lender: Lender, chainId: string, prices: {
|
|
6
6
|
[asset: string]: number;
|
|
7
7
|
}, additionalYields: AdditionalYields, tokenList?: GenericTokenList) => [(data: any[]) => AaveV2GeneralPublicResponse | undefined, number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publicCallParse.d.ts","sourceRoot":"","sources":["../../../src/lending/aave-v2-type/publicCallParse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"publicCallParse.d.ts","sourceRoot":"","sources":["../../../src/lending/aave-v2-type/publicCallParse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAahD,OAAO,EACL,2BAA2B,EAI5B,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAG3C,eAAO,MAAM,8BAA8B,GACzC,QAAQ,MAAM,EACd,SAAS,MAAM,EACf,QAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACnC,kBAAkB,gBAAgB,EAClC,YAAW,gBAAqB,KAC/B,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,2BAA2B,GAAG,SAAS,EAAE,MAAM,CAqgBnE,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Lender } from
|
|
2
|
-
import { getAaveAssets, LENDER_MODE_NO_MODE, toGenericPriceKey, toOracleKey } from
|
|
3
|
-
import { BPS, convertRateToApr, formatAaveRawApyToApr, parseRawAmount } from
|
|
4
|
-
import { AaveV2TypeGetReserveConfigurationData, AaveV2TypeGetReserveDataIndexes, AaveV2TypeIncentivesControllerPoolInfoIndexes } from
|
|
1
|
+
import { Lender } from '@1delta/lender-registry';
|
|
2
|
+
import { getAaveAssets, LENDER_MODE_NO_MODE, toGenericPriceKey, toOracleKey, } from '../../assets';
|
|
3
|
+
import { BPS, convertRateToApr, formatAaveRawApyToApr, parseRawAmount, } from '../../utils/parsing';
|
|
4
|
+
import { AaveV2TypeGetReserveConfigurationData, AaveV2TypeGetReserveDataIndexes, AaveV2TypeIncentivesControllerPoolInfoIndexes, } from './types';
|
|
5
|
+
import { Chain } from '@1delta/chain-registry';
|
|
5
6
|
export const getAaveV2ReservesDataConverter = (lender, chainId, prices, additionalYields, tokenList = {}) => {
|
|
6
7
|
switch (lender) {
|
|
7
8
|
case Lender.AURELIUS: {
|
|
@@ -26,8 +27,11 @@ export const getAaveV2ReservesDataConverter = (lender, chainId, prices, addition
|
|
|
26
27
|
const totalStableDebt = parseRawAmount(reserveData?.[AaveV2TypeGetReserveDataIndexes.totalStableDebt]?.toString(), decimals);
|
|
27
28
|
const totalVariableDebt = parseRawAmount(reserveData?.[AaveV2TypeGetReserveDataIndexes.totalVariableDebt]?.toString(), decimals);
|
|
28
29
|
const liquidity = parseRawAmount(reserveData?.[AaveV2TypeGetReserveDataIndexes.availableLiquidity]?.toString(), decimals);
|
|
29
|
-
const totalAToken = Number(liquidity) +
|
|
30
|
-
|
|
30
|
+
const totalAToken = Number(liquidity) +
|
|
31
|
+
Number(totalStableDebt) +
|
|
32
|
+
Number(totalVariableDebt);
|
|
33
|
+
const oracleKey = toOracleKey(assetMeta?.assetGroup) ??
|
|
34
|
+
toGenericPriceKey(asset, chainId);
|
|
31
35
|
const price = prices[oracleKey] ?? 1;
|
|
32
36
|
const totalDepositsUSD = totalAToken * price;
|
|
33
37
|
const totalDebtUSD = Number(totalVariableDebt) * price;
|
|
@@ -53,14 +57,24 @@ export const getAaveV2ReservesDataConverter = (lender, chainId, prices, addition
|
|
|
53
57
|
// rewards
|
|
54
58
|
rewards: {
|
|
55
59
|
WMNT: {
|
|
56
|
-
depositRate: convertRateToApr(parseRawAmount(emission0PerSecondCollateral)) /
|
|
57
|
-
|
|
60
|
+
depositRate: (convertRateToApr(parseRawAmount(emission0PerSecondCollateral)) /
|
|
61
|
+
totalDepositsUSD) *
|
|
62
|
+
prices['WMNT'],
|
|
63
|
+
variableBorrowRate: (convertRateToApr(parseRawAmount(emission0PerSecondDebt)) /
|
|
64
|
+
totalDebtUSD) *
|
|
65
|
+
prices['WMNT'],
|
|
58
66
|
stableBorrowRate: 0,
|
|
59
67
|
},
|
|
60
68
|
// oAU allows for a 50% discount to pruchase AU, hence the price is the price of AU divided by 2
|
|
61
69
|
OAU: {
|
|
62
|
-
depositRate: convertRateToApr(parseRawAmount(emission1PerSecondCollateral)) /
|
|
63
|
-
|
|
70
|
+
depositRate: ((convertRateToApr(parseRawAmount(emission1PerSecondCollateral)) /
|
|
71
|
+
totalDepositsUSD) *
|
|
72
|
+
(prices['AU'] ?? 0)) /
|
|
73
|
+
2,
|
|
74
|
+
variableBorrowRate: ((convertRateToApr(parseRawAmount(emission1PerSecondDebt)) /
|
|
75
|
+
totalDebtUSD) *
|
|
76
|
+
(prices['AU'] ?? 0)) /
|
|
77
|
+
2,
|
|
64
78
|
stableBorrowRate: 0,
|
|
65
79
|
},
|
|
66
80
|
},
|
|
@@ -70,9 +84,10 @@ export const getAaveV2ReservesDataConverter = (lender, chainId, prices, addition
|
|
|
70
84
|
category: LENDER_MODE_NO_MODE,
|
|
71
85
|
// collateral factors
|
|
72
86
|
borrowCollateralFactor: Number(configData?.[AaveV2TypeGetReserveConfigurationData.ltv].toString()) / BPS,
|
|
73
|
-
collateralFactor: Number(configData?.[AaveV2TypeGetReserveConfigurationData
|
|
74
|
-
|
|
75
|
-
|
|
87
|
+
collateralFactor: Number(configData?.[AaveV2TypeGetReserveConfigurationData
|
|
88
|
+
.liquidationThreshold].toString()) / BPS,
|
|
89
|
+
borrowFactor: 1,
|
|
90
|
+
},
|
|
76
91
|
},
|
|
77
92
|
liquidationBonus: Number(configData?.[AaveV2TypeGetReserveConfigurationData.liquidationBonus].toString()) / BPS,
|
|
78
93
|
// flags
|
|
@@ -102,22 +117,29 @@ export const getAaveV2ReservesDataConverter = (lender, chainId, prices, addition
|
|
|
102
117
|
const rewardsPerSecond = Number(parseRawAmount(data[expectedNumberOfCalls - 2].toString(), 18));
|
|
103
118
|
const totalAllocPoint = Number(data[expectedNumberOfCalls - 1].toString());
|
|
104
119
|
const resultReserves = {};
|
|
105
|
-
const lendPrice = prices[
|
|
120
|
+
const lendPrice = prices['LEND'];
|
|
106
121
|
for (let i = 0; i < assetsToQuery.length; i++) {
|
|
107
122
|
const asset = assetsToQuery[i];
|
|
108
123
|
const reserveData = data[i * 4];
|
|
109
124
|
const configData = data[i * 4 + 1];
|
|
110
125
|
const collateralRewardIndex = i * 4 + 2;
|
|
111
126
|
const borrowRewardIndex = i * 4 + 3;
|
|
112
|
-
const collateralRewards = Number(data?.[collateralRewardIndex]?.[AaveV2TypeIncentivesControllerPoolInfoIndexes.allocPoint].toString()) /
|
|
113
|
-
|
|
127
|
+
const collateralRewards = (Number(data?.[collateralRewardIndex]?.[AaveV2TypeIncentivesControllerPoolInfoIndexes.allocPoint].toString()) /
|
|
128
|
+
totalAllocPoint) *
|
|
129
|
+
rewardsPerSecond;
|
|
130
|
+
const borrowRewards = (Number(data?.[borrowRewardIndex]?.[AaveV2TypeIncentivesControllerPoolInfoIndexes.allocPoint].toString()) /
|
|
131
|
+
totalAllocPoint) *
|
|
132
|
+
rewardsPerSecond;
|
|
114
133
|
const assetMeta = tokenList[asset];
|
|
115
134
|
const decimals = assetMeta?.decimals ?? 18;
|
|
116
135
|
const totalStableDebt = parseRawAmount(reserveData?.[AaveV2TypeGetReserveDataIndexes.totalStableDebt]?.toString(), decimals);
|
|
117
136
|
const totalVariableDebt = parseRawAmount(reserveData?.[AaveV2TypeGetReserveDataIndexes.totalVariableDebt]?.toString(), decimals);
|
|
118
137
|
const liquidity = parseRawAmount(reserveData?.[AaveV2TypeGetReserveDataIndexes.availableLiquidity]?.toString(), decimals);
|
|
119
|
-
const totalAToken = Number(liquidity) +
|
|
120
|
-
|
|
138
|
+
const totalAToken = Number(liquidity) +
|
|
139
|
+
Number(totalStableDebt) +
|
|
140
|
+
Number(totalVariableDebt);
|
|
141
|
+
const oracleKey = toOracleKey(assetMeta?.assetGroup) ??
|
|
142
|
+
toGenericPriceKey(asset, chainId);
|
|
121
143
|
const price = prices?.[oracleKey] ?? 1;
|
|
122
144
|
const totalDepositsUSD = totalAToken * price;
|
|
123
145
|
const totalDebtUSD = Number(totalVariableDebt) * price;
|
|
@@ -143,7 +165,8 @@ export const getAaveV2ReservesDataConverter = (lender, chainId, prices, addition
|
|
|
143
165
|
// rewards
|
|
144
166
|
rewards: {
|
|
145
167
|
LEND: {
|
|
146
|
-
depositRate: convertRateToApr(collateralRewards / totalDepositsUSD) *
|
|
168
|
+
depositRate: convertRateToApr(collateralRewards / totalDepositsUSD) *
|
|
169
|
+
lendPrice,
|
|
147
170
|
variableBorrowRate: convertRateToApr(totalDebtUSD > 0 ? borrowRewards / totalDebtUSD : 0) * lendPrice,
|
|
148
171
|
stableBorrowRate: 0,
|
|
149
172
|
},
|
|
@@ -154,9 +177,10 @@ export const getAaveV2ReservesDataConverter = (lender, chainId, prices, addition
|
|
|
154
177
|
category: LENDER_MODE_NO_MODE,
|
|
155
178
|
// collateral factors
|
|
156
179
|
borrowCollateralFactor: Number(configData?.[AaveV2TypeGetReserveConfigurationData.ltv].toString()) / BPS,
|
|
157
|
-
collateralFactor: Number(configData?.[AaveV2TypeGetReserveConfigurationData
|
|
158
|
-
|
|
159
|
-
|
|
180
|
+
collateralFactor: Number(configData?.[AaveV2TypeGetReserveConfigurationData
|
|
181
|
+
.liquidationThreshold].toString()) / BPS,
|
|
182
|
+
borrowFactor: 1,
|
|
183
|
+
},
|
|
160
184
|
},
|
|
161
185
|
liquidationBonus: Number(configData?.[AaveV2TypeGetReserveConfigurationData.liquidationBonus].toString()) / BPS,
|
|
162
186
|
// flags
|
|
@@ -195,7 +219,8 @@ export const getAaveV2ReservesDataConverter = (lender, chainId, prices, addition
|
|
|
195
219
|
const totalVariableDebt = parseRawAmount(reserveData?.[AaveV2TypeGetReserveDataIndexes.totalVariableDebt]?.toString(), decimals);
|
|
196
220
|
const liquidity = Number(parseRawAmount(reserveData?.[AaveV2TypeGetReserveDataIndexes.availableLiquidity]?.toString(), decimals));
|
|
197
221
|
const totalAToken = liquidity + Number(totalStableDebt) + Number(totalVariableDebt);
|
|
198
|
-
const oracleKey = toOracleKey(assetMeta?.assetGroup) ??
|
|
222
|
+
const oracleKey = toOracleKey(assetMeta?.assetGroup) ??
|
|
223
|
+
toGenericPriceKey(asset, chainId);
|
|
199
224
|
const price = prices[oracleKey] ?? 1;
|
|
200
225
|
const totalDepositsUSD = Number(totalAToken) * price;
|
|
201
226
|
const totalDebtUSD = Number(totalVariableDebt) * price;
|
|
@@ -219,22 +244,25 @@ export const getAaveV2ReservesDataConverter = (lender, chainId, prices, addition
|
|
|
219
244
|
stableBorrowRate: formatAaveRawApyToApr(reserveData?.[AaveV2TypeGetReserveDataIndexes.stableBorrowRate]?.toString()),
|
|
220
245
|
stakingYield: additionalYields.intrinsicYields[oracleKey] ?? 0,
|
|
221
246
|
// rewards
|
|
222
|
-
rewards: lender === Lender.MERIDIAN
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
247
|
+
rewards: lender === Lender.MERIDIAN && chainId === Chain.TAIKO_ALETHIA
|
|
248
|
+
? {
|
|
249
|
+
TAIKO: {
|
|
250
|
+
depositRate: additionalYields.lenderRewards[Lender.MERIDIAN]?.[asset]?.deposit ?? 0,
|
|
251
|
+
variableBorrowRate: additionalYields.lenderRewards[Lender.MERIDIAN]?.[asset]?.borrow ?? 0,
|
|
252
|
+
stableBorrowRate: 0,
|
|
253
|
+
},
|
|
227
254
|
}
|
|
228
|
-
|
|
255
|
+
: {},
|
|
229
256
|
decimals: Number(configData?.[AaveV2TypeGetReserveConfigurationData.decimals]),
|
|
230
257
|
config: {
|
|
231
258
|
[LENDER_MODE_NO_MODE]: {
|
|
232
259
|
category: LENDER_MODE_NO_MODE,
|
|
233
260
|
// collateral factors
|
|
234
261
|
borrowCollateralFactor: Number(configData?.[AaveV2TypeGetReserveConfigurationData.ltv].toString()) / BPS,
|
|
235
|
-
collateralFactor: Number(configData?.[AaveV2TypeGetReserveConfigurationData
|
|
236
|
-
|
|
237
|
-
|
|
262
|
+
collateralFactor: Number(configData?.[AaveV2TypeGetReserveConfigurationData
|
|
263
|
+
.liquidationThreshold].toString()) / BPS,
|
|
264
|
+
borrowFactor: 1,
|
|
265
|
+
},
|
|
238
266
|
},
|
|
239
267
|
liquidationBonus: Number(configData?.[AaveV2TypeGetReserveConfigurationData.liquidationBonus].toString()) / BPS,
|
|
240
268
|
// flags
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Lender } from "@1delta/lender-registry";
|
|
2
|
-
export declare function getAaveTypeOracleAddress(chainId: string, lender: Lender): any;
|
|
3
2
|
export declare function getAaveTypeIncentivesControllerAddress(chainId: string, lender: Lender): any;
|
|
4
3
|
export declare function getAaveTypeMultiFeeDistribution(chainId: string, lender: Lender): any;
|
|
5
4
|
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/lending/addresses/contracts.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,wBAAgB,
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/lending/addresses/contracts.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,wBAAgB,sCAAsC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,OAgBrF;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,OAM9E"}
|
|
@@ -6,23 +6,6 @@ import { addressesMeridianCore } from "./meridian";
|
|
|
6
6
|
import { addressesTakoTakoCore } from "./takotako";
|
|
7
7
|
import { zeroAddress } from "viem";
|
|
8
8
|
import { Lender } from "@1delta/lender-registry";
|
|
9
|
-
export function getAaveTypeOracleAddress(chainId, lender) {
|
|
10
|
-
switch (lender) {
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
case Lender.AAVE_V2: return addressesAaveV2Core.AaveOracle[chainId];
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
case Lender.AAVE_V3: return addressesAaveCore.AaveOracle[chainId];
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
case Lender.LENDLE: return addressesLendleCore.AaveOracle[chainId];
|
|
17
|
-
// @ts-ignore
|
|
18
|
-
case Lender.AURELIUS: return addressesAureliusCore.AaveOracle[chainId];
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
case Lender.MERIDIAN: return addressesMeridianCore.AaveOracle[chainId];
|
|
21
|
-
// @ts-ignore
|
|
22
|
-
case Lender.TAKOTAKO: return addressesTakoTakoCore.AaveOracle[chainId];
|
|
23
|
-
default: return zeroAddress;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
9
|
export function getAaveTypeIncentivesControllerAddress(chainId, lender) {
|
|
27
10
|
switch (lender) {
|
|
28
11
|
// @ts-ignore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meridian.d.ts","sourceRoot":"","sources":["../../../src/lending/addresses/meridian.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"meridian.d.ts","sourceRoot":"","sources":["../../../src/lending/addresses/meridian.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;CAajC,CAAA"}
|
|
@@ -4,7 +4,10 @@ export const addressesMeridianCore = {
|
|
|
4
4
|
[Chain.TAIKO_ALETHIA]: '0xd79417be2cE02fc22F2E520869b1DfC02a677751',
|
|
5
5
|
},
|
|
6
6
|
IncentivesController: {
|
|
7
|
-
[Chain.TAIKO_ALETHIA]: '0xb3020EbFD800B488B64E92A8717E826cBf0d63E2'
|
|
7
|
+
[Chain.TAIKO_ALETHIA]: '0xb3020EbFD800B488B64E92A8717E826cBf0d63E2',
|
|
8
|
+
[Chain.TELOS_EVM_MAINNET]: '0x406F044A5aBF071db08E4482c3487331Cf284ADc',
|
|
9
|
+
[Chain.FUSE_MAINNET]: '0xd2Fa60C6fab6EdF77E78A0908066d04a5F5EB1E0',
|
|
10
|
+
[Chain.METER_MAINNET]: '0xBAE27c0F27A7bff3f391A19E0dE2d241E2497a09',
|
|
8
11
|
},
|
|
9
12
|
MultiFeeDistribution: {
|
|
10
13
|
[Chain.TAIKO_ALETHIA]: '0xb0e103e2A80489Ba697D882EEd0Ba552389Ca31E'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { initializeChainData, initializeLenderData } from '@1delta/data-sdk';
|
|
2
|
-
const baseUrl = 'https://raw.githubusercontent.com/1delta-DAO/lender-metadata/
|
|
2
|
+
const baseUrl = 'https://raw.githubusercontent.com/1delta-DAO/lender-metadata/main';
|
|
3
3
|
const aavePools = baseUrl + '/config/aave-pools.json';
|
|
4
4
|
const aaveOracles = baseUrl + '/data/aave-oracles.json';
|
|
5
5
|
const morphoOracles = baseUrl + '/data/morpho-oracles.json';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prices/defillama/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prices/defillama/index.ts"],"names":[],"mappings":"AAgSA,wBAAsB,kBAAkB,iBA6CvC;AAED,wBAAsB,sBAAsB,iBAiD3C"}
|
|
@@ -125,6 +125,10 @@ const prefixBera = 'berachain:';
|
|
|
125
125
|
const WBERA = '0x6969696969696969696969696969696969696969';
|
|
126
126
|
const prefixCronos = 'cronos:';
|
|
127
127
|
const WCRO = '0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23';
|
|
128
|
+
const prefixTelos = 'telos:';
|
|
129
|
+
const wtlos = '0xd102ce6a4db07d247fcc28f366a623df0938ca9e';
|
|
130
|
+
const prefixManta = 'manta:';
|
|
131
|
+
const manta = '0x95cef13441be50d20ca4558cc0a27b601ac544e5';
|
|
128
132
|
// const prefixKaia = 'kaia:'
|
|
129
133
|
// const WKAIA = '0x19aac5f612f524b754ca7e7c41cbfa2e981a4432'
|
|
130
134
|
const datasAvalanche = [WAVAX, SAVAX].map((d) => prefixAvalanche + d).join(',');
|
|
@@ -144,7 +148,9 @@ const datasHyperEvm = [WYPE, WSTHYPE, kHYPE]
|
|
|
144
148
|
const datasSolana = [JITOSOL, SOL].map((d) => prefixSolana + d).join(',');
|
|
145
149
|
const datasBera = [WBERA].map((d) => prefixBera + d).join(',');
|
|
146
150
|
const datasXdc = [WXDC].map((d) => prefixXdc + d).join(',');
|
|
147
|
-
const
|
|
151
|
+
const datasCronos = [WCRO].map((d) => prefixCronos + d).join(',');
|
|
152
|
+
const datasManta = [manta].map((d) => prefixManta + d).join(',');
|
|
153
|
+
const datasTelos = [wtlos].map((d) => prefixTelos + d).join(',');
|
|
148
154
|
// const datasKaia = [WKAIA].map((d) => prefixKaia + d).join(',')
|
|
149
155
|
const URL = `https://coins.llama.fi/prices/current/${[
|
|
150
156
|
datasEthereum,
|
|
@@ -162,7 +168,9 @@ const URL = `https://coins.llama.fi/prices/current/${[
|
|
|
162
168
|
datasSolana,
|
|
163
169
|
datasBera,
|
|
164
170
|
datasXdc,
|
|
165
|
-
|
|
171
|
+
datasCronos,
|
|
172
|
+
datasManta,
|
|
173
|
+
datasTelos,
|
|
166
174
|
].join(',')}?searchWidth=4h`;
|
|
167
175
|
const URL_HIST = (ref) => `https://coins.llama.fi/prices/historical/${ref}/${[
|
|
168
176
|
datasEthereum,
|
|
@@ -248,10 +256,12 @@ const SYMBOL_MAP = {
|
|
|
248
256
|
usual: 'Usual::USUAL',
|
|
249
257
|
woeth: 'Wrapped OETH::WOETH',
|
|
250
258
|
jitosol: 'Jito Staked SOL::JitoSOL',
|
|
259
|
+
manta: 'Manta::MANTA',
|
|
251
260
|
sol: 'SOL',
|
|
252
261
|
wcro: 'WCRO',
|
|
253
262
|
wxdc: 'WXDC',
|
|
254
263
|
wbera: 'WBERA',
|
|
264
|
+
wtlos: 'WTLOS',
|
|
255
265
|
};
|
|
256
266
|
export async function fetchDefillamaData() {
|
|
257
267
|
try {
|
|
@@ -271,6 +281,7 @@ export async function fetchDefillamaData() {
|
|
|
271
281
|
prices['CRO'] = prices['WCRO'];
|
|
272
282
|
prices['XDC'] = prices['WXDC'];
|
|
273
283
|
prices['BERA'] = prices['WBERA'];
|
|
284
|
+
prices['TLOS'] = prices['WTLOS'];
|
|
274
285
|
// prices['WKAIA'] = prices['KAIA']
|
|
275
286
|
prices['USDBC'] = prices['USDC'];
|
|
276
287
|
prices['BTCB'] = prices['WBTC'];
|
|
@@ -311,6 +322,7 @@ export async function fetchDefillamaHistData() {
|
|
|
311
322
|
histPrices['BERA'] = histPrices['WBERA'];
|
|
312
323
|
histPrices['CRO'] = histPrices['WCRO'];
|
|
313
324
|
histPrices['XDC'] = histPrices['WXDC'];
|
|
325
|
+
histPrices['TLOS'] = histPrices['WTLOS'];
|
|
314
326
|
// histPrices['WKAIA'] = histPrices['KAIA']
|
|
315
327
|
histPrices['LUSD'] = histPrices['USDT'];
|
|
316
328
|
histPrices['XDAI'] = histPrices['DAI'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchOracleData.d.ts","sourceRoot":"","sources":["../../../src/prices/main-prices/fetchOracleData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetchOracleData.d.ts","sourceRoot":"","sources":["../../../src/prices/main-prices/fetchOracleData.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AASvC,UAAU,UAAU;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CACtB;AAID;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,UAAU,MAAM,EAAE,EAClB,eAAe;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAC5C,QAAO;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAA;CAAO,KACrD,OAAO,CAAC,UAAU,CAqMpB,CAAA;AAuDD,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,UAiBZ"}
|
|
@@ -12,7 +12,7 @@ import { chainlinkOracles, getChainLinkKeys, ChainlinkAggregatorIndexes, } from
|
|
|
12
12
|
import { fetchDefillamaData } from '../defillama';
|
|
13
13
|
import { fetchPendlePrices } from '../pendle';
|
|
14
14
|
import { getAavesForChain } from '../../utils';
|
|
15
|
-
import { formatAavePrice, formatMorphoPrice, parseRawAmount } from '../../utils/parsing';
|
|
15
|
+
import { formatAavePrice, formatMorphoPrice, parseRawAmount, } from '../../utils/parsing';
|
|
16
16
|
import { ProxyOracleAbi } from '../../abis/oracle/ProxyOracle';
|
|
17
17
|
import { multicallRetry } from '@1delta/providers';
|
|
18
18
|
import { UniswapV3Abi } from '../../abis/oracle/UniV3';
|
|
@@ -324,6 +324,8 @@ function lowDecimalOracle(chainId, fork) {
|
|
|
324
324
|
}
|
|
325
325
|
if (chainId === Chain.XDC_NETWORK)
|
|
326
326
|
return true;
|
|
327
|
+
if (chainId === Chain.TELOS_EVM_MAINNET)
|
|
328
|
+
return true;
|
|
327
329
|
// otherwise, it depends on whether it is aave V3
|
|
328
330
|
return AAVE_V2_LENDERS.includes(fork);
|
|
329
331
|
}
|
|
@@ -360,13 +362,15 @@ const parseMorphoResults = (chainId, data, queries, donePrices = {}, list = {})
|
|
|
360
362
|
const collateralPrice = donePrices[oracleIdCollateral] ?? prices[oracleIdCollateral];
|
|
361
363
|
const priceDebtToCollateral = formatMorphoPrice(d.toString(), loanAssetDecimals, collateralAssetDecimals);
|
|
362
364
|
if (debtPrice) {
|
|
363
|
-
if (!prices[oracleIdCollateral])
|
|
365
|
+
if (!prices[oracleIdCollateral]) {
|
|
364
366
|
prices[oracleIdCollateral] = priceDebtToCollateral * debtPrice;
|
|
367
|
+
}
|
|
365
368
|
}
|
|
366
369
|
else {
|
|
367
370
|
if (collateralPrice) {
|
|
368
|
-
if (!prices[oracleId])
|
|
371
|
+
if (!prices[oracleId]) {
|
|
369
372
|
prices[oracleId] = collateralPrice / priceDebtToCollateral;
|
|
373
|
+
}
|
|
370
374
|
}
|
|
371
375
|
}
|
|
372
376
|
});
|
|
@@ -4,27 +4,4 @@
|
|
|
4
4
|
export declare const MULTICALL_ADDRESS: {
|
|
5
5
|
[c: string]: string;
|
|
6
6
|
};
|
|
7
|
-
/**
|
|
8
|
-
* 1Delta Composer Addresses
|
|
9
|
-
*/
|
|
10
|
-
export declare const COMPOSERS: {
|
|
11
|
-
"42161": string;
|
|
12
|
-
"10": string;
|
|
13
|
-
"137": string;
|
|
14
|
-
"8453": string;
|
|
15
|
-
"146": string;
|
|
16
|
-
"43111": string;
|
|
17
|
-
"167000": string;
|
|
18
|
-
"1088": string;
|
|
19
|
-
"100": string;
|
|
20
|
-
"43114": string;
|
|
21
|
-
"34443": string;
|
|
22
|
-
"534352": string;
|
|
23
|
-
"1116": string;
|
|
24
|
-
"250": string;
|
|
25
|
-
"56": string;
|
|
26
|
-
"5000": string;
|
|
27
|
-
"59144": string;
|
|
28
|
-
"81457": string;
|
|
29
|
-
};
|
|
30
7
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAwCA;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAsCpD,CAAA"}
|
package/dist/utils/constants.js
CHANGED
|
@@ -32,6 +32,8 @@ const REDSTONE_MULTICALL_ADDRESS = '0xd57B52452a0FDfE3ff8e0A40Bd10D00D0bfe0723';
|
|
|
32
32
|
const MANTA_MULTICALL_ADDRESS = '0x52dFC0D9960F11A9Ca9FF616e791B91188446a60';
|
|
33
33
|
const ZORA_MULTICALL_ADDRESS = '0xA51c76bEE6746cB487a7e9312E43e2b8f4A37C15';
|
|
34
34
|
const CORE_MULTICALL_ADDRESS = '0xFe9F82D820757787895Da00B1dBD35c3B8b04894';
|
|
35
|
+
const MORPH_MULTICALL_ADDRESS = '0xAcD82113982479B25E7c1D09858F0130921Dbbca';
|
|
36
|
+
const TELOS_MULTICALL_ADDRESS = '0x5d6b0f5335ec95cD2aB7E52f2A0750dd86502435';
|
|
35
37
|
/**
|
|
36
38
|
* Uniswap Interface Multicall
|
|
37
39
|
*/
|
|
@@ -70,28 +72,7 @@ export const MULTICALL_ADDRESS = {
|
|
|
70
72
|
[Chain.BOB]: BOB_MULTICALL_ADDRESS,
|
|
71
73
|
[Chain.ZERO_NETWORK]: ZERO_MULTICALL_ADDRESS,
|
|
72
74
|
[Chain.SAGA]: SAGA_MULTICALL_ADDRESS,
|
|
75
|
+
[Chain.MORPH]: MORPH_MULTICALL_ADDRESS,
|
|
76
|
+
[Chain.TELOS_EVM_MAINNET]: TELOS_MULTICALL_ADDRESS,
|
|
73
77
|
[Chain.WORLD_CHAIN]: WORLDCHAIN_MULTICALL_ADDRESS,
|
|
74
78
|
};
|
|
75
|
-
/**
|
|
76
|
-
* 1Delta Composer Addresses
|
|
77
|
-
*/
|
|
78
|
-
export const COMPOSERS = {
|
|
79
|
-
[Chain.ARBITRUM_ONE]: "0x05f3f58716a88A52493Be45aA0871c55b3748f18",
|
|
80
|
-
[Chain.OP_MAINNET]: "0xCDef0A216fcEF809258aA4f341dB1A5aB296ea72",
|
|
81
|
-
[Chain.POLYGON_MAINNET]: "0xFd245e732b40b6BF2038e42b476bD06580585326",
|
|
82
|
-
[Chain.BASE]: "0xB7ea94340e65CC68d1274aE483dfBE593fD6f21e",
|
|
83
|
-
[Chain.SONIC_MAINNET]: "0x8E24CfC19c6C00c524353CB8816f5f1c2F33c201",
|
|
84
|
-
[Chain.HEMI_NETWORK]: "0x79f4061BF049c5c6CAC6bfe2415c2460815F4ac7",
|
|
85
|
-
[Chain.TAIKO_ALETHIA]: "0x594cE4B82A81930cC637f1A59afdFb0D70054232",
|
|
86
|
-
[Chain.METIS_ANDROMEDA_MAINNET]: "0xCe434378adacC51d54312c872113D687Ac19B516",
|
|
87
|
-
[Chain.GNOSIS]: "0xcb6eb8df68153cebf60e1872273ef52075a5c297",
|
|
88
|
-
[Chain.AVALANCHE_C_CHAIN]: '0x8E24CfC19c6C00c524353CB8816f5f1c2F33c201',
|
|
89
|
-
[Chain.MODE]: '0x8E24CfC19c6C00c524353CB8816f5f1c2F33c201',
|
|
90
|
-
[Chain.SCROLL]: '0x8E24CfC19c6C00c524353CB8816f5f1c2F33c201',
|
|
91
|
-
[Chain.CORE_BLOCKCHAIN_MAINNET]: "0x816EBC5cb8A5651C902Cb06659907A93E574Db0B",
|
|
92
|
-
[Chain.FANTOM_OPERA]: "0x816EBC5cb8A5651C902Cb06659907A93E574Db0B",
|
|
93
|
-
[Chain.BNB_SMART_CHAIN_MAINNET]: "0x816EBC5cb8A5651C902Cb06659907A93E574Db0B",
|
|
94
|
-
[Chain.MANTLE]: "0x5c019a146758287c614fe654caec1ba1caf05f4e",
|
|
95
|
-
[Chain.LINEA]: "0x816EBC5cb8A5651C902Cb06659907A93E574Db0B",
|
|
96
|
-
[Chain.BLAST]: "0x816EBC5cb8A5651C902Cb06659907A93E574Db0B",
|
|
97
|
-
};
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ export declare const filterLendersByProtocol: (allLenders: string[], protocolLis
|
|
|
15
15
|
export declare const getAavesForChain: () => {
|
|
16
16
|
[c: string]: string[];
|
|
17
17
|
};
|
|
18
|
-
export declare const getComposerAddress: (chainId: string) => string;
|
|
19
18
|
export declare const getLenderAssets: (chainId: string | number | undefined, lendingProtocol?: Lender) => string[];
|
|
20
19
|
export declare function isMultiMarket(lender: string): boolean;
|
|
21
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EAEP,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EAEP,MAAM,yBAAyB,CAAA;AAahC,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,WAE1C;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,WAE9C;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,yBAEpC;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,WAE1C;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,WAE1C;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,WAE1C;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,yBAEpC;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,WAE3C;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,WAExC;AAED,eAAO,MAAM,kBAAkB,GAAI,GAAG,MAAM,aA0B3C,CAAA;AAED,sCAAsC;AACtC,eAAO,MAAM,uBAAuB,GAClC,YAAY,MAAM,EAAE,EACpB,eAAe,MAAM,EAAE,KACtB,MAAM,EAaR,CAAA;AAED,mCAAmC;AACnC,eAAO,MAAM,gBAAgB;;CAS5B,CAAA;AAED,eAAO,MAAM,eAAe,GAC1B,SAAS,MAAM,GAAG,MAAM,GAAG,SAAS,EACpC,wBAAgC,KAC/B,MAAM,EAOR,CAAA;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,WAE3C"}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { AAVE_V2_LENDERS, AAVE_V3_LENDERS, Lender, AAVE_V32_LENDERS, } from '@1delta/lender-registry';
|
|
2
2
|
import { uniq } from 'lodash';
|
|
3
|
-
import { COMPOSERS } from './constants';
|
|
4
|
-
import { zeroAddress } from 'viem';
|
|
5
3
|
import { aavePools, aaveReserves, compoundV3Pools, compoundV3Reserves, initConfig, morphoPools, } from '@1delta/data-sdk';
|
|
6
4
|
const COMPOUND_V3_KEY = 'COMPOUND_V3';
|
|
7
5
|
export function isCompoundV3(lender) {
|
|
@@ -79,9 +77,6 @@ export const getAavesForChain = () => {
|
|
|
79
77
|
});
|
|
80
78
|
return lenders;
|
|
81
79
|
};
|
|
82
|
-
export const getComposerAddress = (chainId) => {
|
|
83
|
-
return COMPOSERS[chainId] ?? zeroAddress;
|
|
84
|
-
};
|
|
85
80
|
export const getLenderAssets = (chainId, lendingProtocol = Lender.AAVE_V3) => {
|
|
86
81
|
if (!chainId)
|
|
87
82
|
return [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/yields/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/yields/index.ts"],"names":[],"mappings":"AAqGA,UAAU,iBAAiB;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,qBAAqB,EAAE,GAAG,CAAA;IAC1B,oBAAoB,EAAE,GAAG,CAAA;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACrC,eAAe,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;KAAE,CAAA;IACxD,aAAa,EAAE;QACb,CAAC,OAAO,EAAE,MAAM,GAAG;YACjB,CAAC,MAAM,EAAE,MAAM,GAAG;gBAAE,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAAA;aAAE,CAAA;SACzD,CAAA;KACF,CAAA;CACF;AAcD,eAAO,MAAM,kBAAkB,uCA+c9B,CAAA"}
|
package/dist/yields/index.js
CHANGED
|
@@ -30,6 +30,7 @@ const ethZero = 'ETH0::ETH0';
|
|
|
30
30
|
const usdThree = 'Web 3 Dollar::USD3';
|
|
31
31
|
const jitoSol = 'Jito Staked SOL::JitoSOL';
|
|
32
32
|
const thBill = 'Theo Short Duration US Treasury Fund::THBILL';
|
|
33
|
+
const ssuperusd = 'SuperReturn sSuperUSD::SSUPERUSD';
|
|
33
34
|
const FeedData = {
|
|
34
35
|
WSTETH: 'https://eth-api.lido.fi/v1/protocol/steth/apr/sma',
|
|
35
36
|
STMATIC: 'https://polygon.lido.fi/api/stats',
|
|
@@ -63,6 +64,7 @@ const FeedData = {
|
|
|
63
64
|
JITOSOL: 'https://www.jito.network/api/getJitoPoolStats/',
|
|
64
65
|
THBILL: 'https://thbill-api.theo.xyz/snapshots',
|
|
65
66
|
YEARN_KATANA: 'https://katana-apr-service.vercel.app/api/vaults',
|
|
67
|
+
SSUPERUSD: 'https://www.superreturn.ai/api/trpc/cmc.getUSDCPrice,rewardBackend.getYield,rewardBackend.getTvlChange?batch=1&input=%7B%220%22%3A%7B%22json%22%3Anull%2C%22meta%22%3A%7B%22values%22%3A%5B%22undefined%22%5D%7D%7D%2C%221%22%3A%7B%22json%22%3Anull%2C%22meta%22%3A%7B%22values%22%3A%5B%22undefined%22%5D%7D%7D%2C%222%22%3A%7B%22json%22%3Anull%2C%22meta%22%3A%7B%22values%22%3A%5B%22undefined%22%5D%7D%7D%7D',
|
|
66
68
|
};
|
|
67
69
|
const LenderAPIs = {
|
|
68
70
|
MERIDIAN: 'https://omnidex.bmaa3ajd1gjri.eu-west-2.cs.amazonlightsail.com/lending_yields',
|
|
@@ -145,6 +147,18 @@ export const fetchGeneralYields = async () => {
|
|
|
145
147
|
return 0;
|
|
146
148
|
}
|
|
147
149
|
});
|
|
150
|
+
const ssuperusdPromise = safeFetch('SSUPERUSD', async () => {
|
|
151
|
+
try {
|
|
152
|
+
const res = await fetch(FeedData.SSUPERUSD, {
|
|
153
|
+
method: 'GET',
|
|
154
|
+
headers: { Accept: 'application/json', 'User-Agent': '1delta/yields' },
|
|
155
|
+
}).then((r) => r.json());
|
|
156
|
+
return apyToAprPercent(res?.[1]?.result.data.json ?? 0);
|
|
157
|
+
}
|
|
158
|
+
catch (e) {
|
|
159
|
+
return 0;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
148
162
|
const rsethPromise = safeFetch('RSETH', async () => {
|
|
149
163
|
const res = await fetch(FeedData.RSETH).then((r) => r.json());
|
|
150
164
|
return apyToAprPercent(res.totalAPY);
|
|
@@ -380,7 +394,7 @@ export const fetchGeneralYields = async () => {
|
|
|
380
394
|
},
|
|
381
395
|
})));
|
|
382
396
|
});
|
|
383
|
-
const [wstethData, ezethData, rethData, weethData, stmaticData, methData, maticXdata, susdeData, meridianData, savaxData, cbethData, rsethData, trumaticData, rtokensData, hypeData, osEthData, ethXData, pufEthData, angleData, susdsData, srUsdData, yusdData, rlpData, wstusrData, csusdlData, sdeusdData, rswethData, ynethxData, ethZeroData, usdZeroPlusData, jitoSolData, thBillData, yearnKatanaData,] = await Promise.all([
|
|
397
|
+
const [wstethData, ezethData, rethData, weethData, stmaticData, methData, maticXdata, susdeData, meridianData, savaxData, cbethData, rsethData, trumaticData, rtokensData, hypeData, osEthData, ethXData, pufEthData, angleData, susdsData, srUsdData, yusdData, rlpData, wstusrData, csusdlData, sdeusdData, rswethData, ynethxData, ethZeroData, usdZeroPlusData, jitoSolData, thBillData, yearnKatanaData, ssuperusdData,] = await Promise.all([
|
|
384
398
|
wstethPromise,
|
|
385
399
|
ezethPromise,
|
|
386
400
|
rethPromise,
|
|
@@ -414,6 +428,7 @@ export const fetchGeneralYields = async () => {
|
|
|
414
428
|
jitoSolPromise,
|
|
415
429
|
thbillPromise,
|
|
416
430
|
yearnKatanaPromise,
|
|
431
|
+
ssuperusdPromise,
|
|
417
432
|
]);
|
|
418
433
|
const data = {
|
|
419
434
|
intrinsicYields: {
|
|
@@ -448,6 +463,7 @@ export const fetchGeneralYields = async () => {
|
|
|
448
463
|
[pufEth]: pufEthData,
|
|
449
464
|
[jitoSol]: jitoSolData,
|
|
450
465
|
[thBill]: thBillData,
|
|
466
|
+
[ssuperusd]: ssuperusdData,
|
|
451
467
|
...rtokensData,
|
|
452
468
|
...hypeData,
|
|
453
469
|
...angleData,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1delta/margin-fetcher",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@types/async-retry": "^1.4.9",
|
|
18
18
|
"async-retry": "^1.3.3",
|
|
19
19
|
"typescript": "^5.9.2",
|
|
20
|
-
"@1delta/providers": "0.0.
|
|
20
|
+
"@1delta/providers": "0.0.14"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "tsc",
|