@defisaver/positions-sdk 2.1.113 → 2.1.114-aave-v4-hub-1-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/markets/aaveV4/index.d.ts +4 -0
- package/cjs/markets/aaveV4/index.js +22 -1
- package/cjs/moneymarket/moneymarketCommonService.js +1 -1
- package/cjs/staking/staking.js +3 -1
- package/cjs/types/aaveV4.d.ts +4 -2
- package/cjs/types/aaveV4.js +2 -0
- package/esm/markets/aaveV4/index.d.ts +4 -0
- package/esm/markets/aaveV4/index.js +19 -0
- package/esm/moneymarket/moneymarketCommonService.js +1 -1
- package/esm/staking/staking.js +3 -1
- package/esm/types/aaveV4.d.ts +4 -2
- package/esm/types/aaveV4.js +2 -0
- package/package.json +2 -2
- package/src/markets/aaveV4/index.ts +21 -0
- package/src/moneymarket/moneymarketCommonService.ts +1 -1
- package/src/staking/staking.ts +2 -1
- package/src/types/aaveV4.ts +2 -0
|
@@ -2,10 +2,12 @@ import { AaveV4HubInfo, AaveV4HubsType, AaveV4SpokeInfo, AaveV4SpokesType, Netwo
|
|
|
2
2
|
export declare const AAVE_V4_CORE_HUB: (networkId: NetworkNumber) => AaveV4HubInfo;
|
|
3
3
|
export declare const AAVE_V4_PLUS_HUB: (networkId: NetworkNumber) => AaveV4HubInfo;
|
|
4
4
|
export declare const AAVE_V4_PRIME_HUB: (networkId: NetworkNumber) => AaveV4HubInfo;
|
|
5
|
+
export declare const AAVE_V4_PAXOS_HUB: (networkId: NetworkNumber) => AaveV4HubInfo;
|
|
5
6
|
export declare const AaveV4Hubs: (networkId: NetworkNumber) => {
|
|
6
7
|
readonly aave_v4_core_hub: AaveV4HubInfo;
|
|
7
8
|
readonly aave_v4_plus_hub: AaveV4HubInfo;
|
|
8
9
|
readonly aave_v4_prime_hub: AaveV4HubInfo;
|
|
10
|
+
readonly aave_v4_paxos_hub: AaveV4HubInfo;
|
|
9
11
|
};
|
|
10
12
|
export declare const getAaveV4HubTypeInfo: (type: AaveV4HubsType, network?: NetworkNumber) => AaveV4HubInfo;
|
|
11
13
|
export declare const getAaveV4HubByAddress: (networkId: NetworkNumber, address: string) => AaveV4HubInfo | undefined;
|
|
@@ -19,6 +21,7 @@ export declare const AAVE_V4_KELP_SPOKE: (networkId: NetworkNumber) => AaveV4Spo
|
|
|
19
21
|
export declare const AAVE_V4_LIDO_SPOKE: (networkId: NetworkNumber) => AaveV4SpokeInfo;
|
|
20
22
|
export declare const AAVE_V4_LOMBARD_BTC_SPOKE: (networkId: NetworkNumber) => AaveV4SpokeInfo;
|
|
21
23
|
export declare const AAVE_V4_MAIN_SPOKE: (networkId: NetworkNumber) => AaveV4SpokeInfo;
|
|
24
|
+
export declare const AAVE_V4_USDG_PENDLE_SPOKE: (networkId: NetworkNumber) => AaveV4SpokeInfo;
|
|
22
25
|
export declare const AaveV4Spokes: (networkId: NetworkNumber) => {
|
|
23
26
|
readonly aave_v4_bluechip_spoke: AaveV4SpokeInfo;
|
|
24
27
|
readonly aave_v4_ethena_correlated_spoke: AaveV4SpokeInfo;
|
|
@@ -30,6 +33,7 @@ export declare const AaveV4Spokes: (networkId: NetworkNumber) => {
|
|
|
30
33
|
readonly aave_v4_lido_spoke: AaveV4SpokeInfo;
|
|
31
34
|
readonly aave_v4_lombard_btc_spoke: AaveV4SpokeInfo;
|
|
32
35
|
readonly aave_v4_main_spoke: AaveV4SpokeInfo;
|
|
36
|
+
readonly aave_v4_usdg_pendle_spoke: AaveV4SpokeInfo;
|
|
33
37
|
};
|
|
34
38
|
export declare const getAaveV4SpokeTypeInfo: (type: AaveV4SpokesType, network?: NetworkNumber) => AaveV4SpokeInfo;
|
|
35
39
|
export declare const findAaveV4SpokeByAddress: (networkId: NetworkNumber, address: string) => AaveV4SpokeInfo | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findAaveV4SpokeByAddress = exports.getAaveV4SpokeTypeInfo = exports.AaveV4Spokes = exports.AAVE_V4_MAIN_SPOKE = exports.AAVE_V4_LOMBARD_BTC_SPOKE = exports.AAVE_V4_LIDO_SPOKE = exports.AAVE_V4_KELP_SPOKE = exports.AAVE_V4_GOLD_SPOKE = exports.AAVE_V4_FOREX_SPOKE = exports.AAVE_V4_ETHERFI_SPOKE = exports.AAVE_V4_ETHENA_ECOSYSTEM_SPOKE = exports.AAVE_V4_ETHENA_CORRELATED_SPOKE = exports.AAVE_V4_BLUECHIP_SPOKE = exports.getAaveV4HubByAddress = exports.getAaveV4HubTypeInfo = exports.AaveV4Hubs = exports.AAVE_V4_PRIME_HUB = exports.AAVE_V4_PLUS_HUB = exports.AAVE_V4_CORE_HUB = void 0;
|
|
3
|
+
exports.findAaveV4SpokeByAddress = exports.getAaveV4SpokeTypeInfo = exports.AaveV4Spokes = exports.AAVE_V4_USDG_PENDLE_SPOKE = exports.AAVE_V4_MAIN_SPOKE = exports.AAVE_V4_LOMBARD_BTC_SPOKE = exports.AAVE_V4_LIDO_SPOKE = exports.AAVE_V4_KELP_SPOKE = exports.AAVE_V4_GOLD_SPOKE = exports.AAVE_V4_FOREX_SPOKE = exports.AAVE_V4_ETHERFI_SPOKE = exports.AAVE_V4_ETHENA_ECOSYSTEM_SPOKE = exports.AAVE_V4_ETHENA_CORRELATED_SPOKE = exports.AAVE_V4_BLUECHIP_SPOKE = exports.getAaveV4HubByAddress = exports.getAaveV4HubTypeInfo = exports.AaveV4Hubs = exports.AAVE_V4_PAXOS_HUB = exports.AAVE_V4_PRIME_HUB = exports.AAVE_V4_PLUS_HUB = exports.AAVE_V4_CORE_HUB = void 0;
|
|
4
4
|
const types_1 = require("../../types");
|
|
5
5
|
// HUBS
|
|
6
6
|
const AAVE_V4_CORE_HUB = (networkId) => ({
|
|
@@ -24,10 +24,18 @@ const AAVE_V4_PRIME_HUB = (networkId) => ({
|
|
|
24
24
|
address: '0x943827DCA022D0F354a8a8c332dA1e5Eb9f9F931',
|
|
25
25
|
});
|
|
26
26
|
exports.AAVE_V4_PRIME_HUB = AAVE_V4_PRIME_HUB;
|
|
27
|
+
const AAVE_V4_PAXOS_HUB = (networkId) => ({
|
|
28
|
+
chainIds: [types_1.NetworkNumber.Eth],
|
|
29
|
+
label: 'Paxos Hub',
|
|
30
|
+
value: types_1.AaveV4HubsType.AaveV4PaxosHub,
|
|
31
|
+
address: '0x62d63197660c080236193CA60b70E49A08E90368',
|
|
32
|
+
});
|
|
33
|
+
exports.AAVE_V4_PAXOS_HUB = AAVE_V4_PAXOS_HUB;
|
|
27
34
|
const AaveV4Hubs = (networkId) => ({
|
|
28
35
|
[types_1.AaveV4HubsType.AaveV4CoreHub]: (0, exports.AAVE_V4_CORE_HUB)(networkId),
|
|
29
36
|
[types_1.AaveV4HubsType.AaveV4PlusHub]: (0, exports.AAVE_V4_PLUS_HUB)(networkId),
|
|
30
37
|
[types_1.AaveV4HubsType.AaveV4PrimeHub]: (0, exports.AAVE_V4_PRIME_HUB)(networkId),
|
|
38
|
+
[types_1.AaveV4HubsType.AaveV4PaxosHub]: (0, exports.AAVE_V4_PAXOS_HUB)(networkId),
|
|
31
39
|
});
|
|
32
40
|
exports.AaveV4Hubs = AaveV4Hubs;
|
|
33
41
|
const getAaveV4HubTypeInfo = (type, network) => (Object.assign({}, (0, exports.AaveV4Hubs)(network !== null && network !== void 0 ? network : types_1.NetworkNumber.Eth))[type]);
|
|
@@ -165,6 +173,18 @@ const AAVE_V4_MAIN_SPOKE = (networkId) => ({
|
|
|
165
173
|
],
|
|
166
174
|
});
|
|
167
175
|
exports.AAVE_V4_MAIN_SPOKE = AAVE_V4_MAIN_SPOKE;
|
|
176
|
+
const AAVE_V4_USDG_PENDLE_SPOKE = (networkId) => ({
|
|
177
|
+
chainIds: [types_1.NetworkNumber.Eth],
|
|
178
|
+
label: 'USDG Pendle',
|
|
179
|
+
value: types_1.AaveV4SpokesType.AaveV4USDGPendleSpoke,
|
|
180
|
+
url: 'usdg-pendle',
|
|
181
|
+
address: '0x956d8e0A89cfa3744428C4641b5a53B56167a7f9',
|
|
182
|
+
hubs: [
|
|
183
|
+
(0, exports.AAVE_V4_PAXOS_HUB)(types_1.NetworkNumber.Eth).address,
|
|
184
|
+
(0, exports.AAVE_V4_CORE_HUB)(types_1.NetworkNumber.Eth).address,
|
|
185
|
+
],
|
|
186
|
+
});
|
|
187
|
+
exports.AAVE_V4_USDG_PENDLE_SPOKE = AAVE_V4_USDG_PENDLE_SPOKE;
|
|
168
188
|
const AaveV4Spokes = (networkId) => ({
|
|
169
189
|
[types_1.AaveV4SpokesType.AaveV4BluechipSpoke]: (0, exports.AAVE_V4_BLUECHIP_SPOKE)(networkId),
|
|
170
190
|
[types_1.AaveV4SpokesType.AaveV4EthenaCorrelatedSpoke]: (0, exports.AAVE_V4_ETHENA_CORRELATED_SPOKE)(networkId),
|
|
@@ -176,6 +196,7 @@ const AaveV4Spokes = (networkId) => ({
|
|
|
176
196
|
[types_1.AaveV4SpokesType.AaveV4LidoSpoke]: (0, exports.AAVE_V4_LIDO_SPOKE)(networkId),
|
|
177
197
|
[types_1.AaveV4SpokesType.AaveV4LombardBtcSpoke]: (0, exports.AAVE_V4_LOMBARD_BTC_SPOKE)(networkId),
|
|
178
198
|
[types_1.AaveV4SpokesType.AaveV4MainSpoke]: (0, exports.AAVE_V4_MAIN_SPOKE)(networkId),
|
|
199
|
+
[types_1.AaveV4SpokesType.AaveV4USDGPendleSpoke]: (0, exports.AAVE_V4_USDG_PENDLE_SPOKE)(networkId),
|
|
179
200
|
});
|
|
180
201
|
exports.AaveV4Spokes = AaveV4Spokes;
|
|
181
202
|
const getAaveV4SpokeTypeInfo = (type, network) => (Object.assign({}, (0, exports.AaveV4Spokes)(network !== null && network !== void 0 ? network : types_1.NetworkNumber.Eth))[type]);
|
|
@@ -33,7 +33,7 @@ exports.STABLE_ASSETS = [
|
|
|
33
33
|
'USDe', 'sUSDe', 'USDS', 'sUSDS', 'USR', 'EURC', 'BOLD', 'BOLD Legacy', 'RLUSD', 'PT sUSDe July', 'PT eUSDe May',
|
|
34
34
|
'USDtb', 'eUSDe', 'PT USDe July', 'PT eUSDe Aug', 'PT sUSDe Sep', 'PT USDe Sep', 'PT sUSDe Nov', 'PT USDe Nov', 'PT sUSDe Jan', 'PT USDe Jan',
|
|
35
35
|
'PT sUSDe Feb', 'PT USDe Feb', 'PT sUSDe Apr', 'PT USDe Apr', 'PT sUSDe May', 'PT USDe May', 'PT srUSDe Apr', 'frxUSD', 'PT sUSDe June',
|
|
36
|
-
'PT USDe June', 'PT srUSDe Jun', 'PT USDG May', 'PT sUSDS Nov',
|
|
36
|
+
'PT USDe June', 'PT srUSDe Jun', 'PT USDG May', 'PT sUSDS Nov', 'PT USDG Sep',
|
|
37
37
|
];
|
|
38
38
|
const isLeveragedPos = (usedAssets, dustLimit = 5) => {
|
|
39
39
|
let borrowUnstable = 0;
|
package/cjs/staking/staking.js
CHANGED
|
@@ -73,7 +73,7 @@ exports.STAKING_ASSETS = [
|
|
|
73
73
|
'ezETH', 'ETHx', 'rsETH', 'pufETH', 'wrsETH', 'wsuperOETHb', 'sUSDS', 'tETH', 'PT sUSDe Sep', 'PT USDe Sep',
|
|
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
|
-
'PT sUSDe June', 'PT USDe June', 'PT srUSDe Jun', 'PT USDG May', 'PT sUSDS Nov',
|
|
76
|
+
'PT sUSDe June', 'PT USDe June', 'PT srUSDe Jun', 'PT USDG May', 'PT sUSDS Nov', 'PT USDG Sep',
|
|
77
77
|
];
|
|
78
78
|
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
79
|
try {
|
|
@@ -155,6 +155,8 @@ exports.getStakingApy = (0, memoizee_1.default)((asset_1, ...args_1) => __awaite
|
|
|
155
155
|
return yield getApyFromDfsApi('PT USDe June', network);
|
|
156
156
|
if (asset === 'PT USDG May')
|
|
157
157
|
return yield getApyFromDfsApi('PT USDG May', network);
|
|
158
|
+
if (asset === 'PT USDG Sep')
|
|
159
|
+
return yield getApyFromDfsApi('PT USDG Sep', network);
|
|
158
160
|
if (asset === 'PT sUSDS Nov')
|
|
159
161
|
return yield getApyFromDfsApi('PT sUSDS Nov', network);
|
|
160
162
|
if (asset === 'GHO')
|
package/cjs/types/aaveV4.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import { EthAddress, IncentiveData, LeverageType, NetworkNumber } from './common
|
|
|
2
2
|
export declare enum AaveV4HubsType {
|
|
3
3
|
AaveV4CoreHub = "aave_v4_core_hub",
|
|
4
4
|
AaveV4PlusHub = "aave_v4_plus_hub",
|
|
5
|
-
AaveV4PrimeHub = "aave_v4_prime_hub"
|
|
5
|
+
AaveV4PrimeHub = "aave_v4_prime_hub",
|
|
6
|
+
AaveV4PaxosHub = "aave_v4_paxos_hub"
|
|
6
7
|
}
|
|
7
8
|
export declare enum AaveV4SpokesType {
|
|
8
9
|
AaveV4BluechipSpoke = "aave_v4_bluechip_spoke",
|
|
@@ -14,7 +15,8 @@ export declare enum AaveV4SpokesType {
|
|
|
14
15
|
AaveV4KelpSpoke = "aave_v4_kelp_spoke",
|
|
15
16
|
AaveV4LidoSpoke = "aave_v4_lido_spoke",
|
|
16
17
|
AaveV4LombardBtcSpoke = "aave_v4_lombard_btc_spoke",
|
|
17
|
-
AaveV4MainSpoke = "aave_v4_main_spoke"
|
|
18
|
+
AaveV4MainSpoke = "aave_v4_main_spoke",
|
|
19
|
+
AaveV4USDGPendleSpoke = "aave_v4_usdg_pendle_spoke"
|
|
18
20
|
}
|
|
19
21
|
export interface AaveV4HubInfo {
|
|
20
22
|
chainIds: NetworkNumber[];
|
package/cjs/types/aaveV4.js
CHANGED
|
@@ -6,6 +6,7 @@ var AaveV4HubsType;
|
|
|
6
6
|
AaveV4HubsType["AaveV4CoreHub"] = "aave_v4_core_hub";
|
|
7
7
|
AaveV4HubsType["AaveV4PlusHub"] = "aave_v4_plus_hub";
|
|
8
8
|
AaveV4HubsType["AaveV4PrimeHub"] = "aave_v4_prime_hub";
|
|
9
|
+
AaveV4HubsType["AaveV4PaxosHub"] = "aave_v4_paxos_hub";
|
|
9
10
|
})(AaveV4HubsType || (exports.AaveV4HubsType = AaveV4HubsType = {}));
|
|
10
11
|
var AaveV4SpokesType;
|
|
11
12
|
(function (AaveV4SpokesType) {
|
|
@@ -19,4 +20,5 @@ var AaveV4SpokesType;
|
|
|
19
20
|
AaveV4SpokesType["AaveV4LidoSpoke"] = "aave_v4_lido_spoke";
|
|
20
21
|
AaveV4SpokesType["AaveV4LombardBtcSpoke"] = "aave_v4_lombard_btc_spoke";
|
|
21
22
|
AaveV4SpokesType["AaveV4MainSpoke"] = "aave_v4_main_spoke";
|
|
23
|
+
AaveV4SpokesType["AaveV4USDGPendleSpoke"] = "aave_v4_usdg_pendle_spoke";
|
|
22
24
|
})(AaveV4SpokesType || (exports.AaveV4SpokesType = AaveV4SpokesType = {}));
|
|
@@ -2,10 +2,12 @@ import { AaveV4HubInfo, AaveV4HubsType, AaveV4SpokeInfo, AaveV4SpokesType, Netwo
|
|
|
2
2
|
export declare const AAVE_V4_CORE_HUB: (networkId: NetworkNumber) => AaveV4HubInfo;
|
|
3
3
|
export declare const AAVE_V4_PLUS_HUB: (networkId: NetworkNumber) => AaveV4HubInfo;
|
|
4
4
|
export declare const AAVE_V4_PRIME_HUB: (networkId: NetworkNumber) => AaveV4HubInfo;
|
|
5
|
+
export declare const AAVE_V4_PAXOS_HUB: (networkId: NetworkNumber) => AaveV4HubInfo;
|
|
5
6
|
export declare const AaveV4Hubs: (networkId: NetworkNumber) => {
|
|
6
7
|
readonly aave_v4_core_hub: AaveV4HubInfo;
|
|
7
8
|
readonly aave_v4_plus_hub: AaveV4HubInfo;
|
|
8
9
|
readonly aave_v4_prime_hub: AaveV4HubInfo;
|
|
10
|
+
readonly aave_v4_paxos_hub: AaveV4HubInfo;
|
|
9
11
|
};
|
|
10
12
|
export declare const getAaveV4HubTypeInfo: (type: AaveV4HubsType, network?: NetworkNumber) => AaveV4HubInfo;
|
|
11
13
|
export declare const getAaveV4HubByAddress: (networkId: NetworkNumber, address: string) => AaveV4HubInfo | undefined;
|
|
@@ -19,6 +21,7 @@ export declare const AAVE_V4_KELP_SPOKE: (networkId: NetworkNumber) => AaveV4Spo
|
|
|
19
21
|
export declare const AAVE_V4_LIDO_SPOKE: (networkId: NetworkNumber) => AaveV4SpokeInfo;
|
|
20
22
|
export declare const AAVE_V4_LOMBARD_BTC_SPOKE: (networkId: NetworkNumber) => AaveV4SpokeInfo;
|
|
21
23
|
export declare const AAVE_V4_MAIN_SPOKE: (networkId: NetworkNumber) => AaveV4SpokeInfo;
|
|
24
|
+
export declare const AAVE_V4_USDG_PENDLE_SPOKE: (networkId: NetworkNumber) => AaveV4SpokeInfo;
|
|
22
25
|
export declare const AaveV4Spokes: (networkId: NetworkNumber) => {
|
|
23
26
|
readonly aave_v4_bluechip_spoke: AaveV4SpokeInfo;
|
|
24
27
|
readonly aave_v4_ethena_correlated_spoke: AaveV4SpokeInfo;
|
|
@@ -30,6 +33,7 @@ export declare const AaveV4Spokes: (networkId: NetworkNumber) => {
|
|
|
30
33
|
readonly aave_v4_lido_spoke: AaveV4SpokeInfo;
|
|
31
34
|
readonly aave_v4_lombard_btc_spoke: AaveV4SpokeInfo;
|
|
32
35
|
readonly aave_v4_main_spoke: AaveV4SpokeInfo;
|
|
36
|
+
readonly aave_v4_usdg_pendle_spoke: AaveV4SpokeInfo;
|
|
33
37
|
};
|
|
34
38
|
export declare const getAaveV4SpokeTypeInfo: (type: AaveV4SpokesType, network?: NetworkNumber) => AaveV4SpokeInfo;
|
|
35
39
|
export declare const findAaveV4SpokeByAddress: (networkId: NetworkNumber, address: string) => AaveV4SpokeInfo | undefined;
|
|
@@ -18,10 +18,17 @@ export const AAVE_V4_PRIME_HUB = (networkId) => ({
|
|
|
18
18
|
value: AaveV4HubsType.AaveV4PrimeHub,
|
|
19
19
|
address: '0x943827DCA022D0F354a8a8c332dA1e5Eb9f9F931',
|
|
20
20
|
});
|
|
21
|
+
export const AAVE_V4_PAXOS_HUB = (networkId) => ({
|
|
22
|
+
chainIds: [NetworkNumber.Eth],
|
|
23
|
+
label: 'Paxos Hub',
|
|
24
|
+
value: AaveV4HubsType.AaveV4PaxosHub,
|
|
25
|
+
address: '0x62d63197660c080236193CA60b70E49A08E90368',
|
|
26
|
+
});
|
|
21
27
|
export const AaveV4Hubs = (networkId) => ({
|
|
22
28
|
[AaveV4HubsType.AaveV4CoreHub]: AAVE_V4_CORE_HUB(networkId),
|
|
23
29
|
[AaveV4HubsType.AaveV4PlusHub]: AAVE_V4_PLUS_HUB(networkId),
|
|
24
30
|
[AaveV4HubsType.AaveV4PrimeHub]: AAVE_V4_PRIME_HUB(networkId),
|
|
31
|
+
[AaveV4HubsType.AaveV4PaxosHub]: AAVE_V4_PAXOS_HUB(networkId),
|
|
25
32
|
});
|
|
26
33
|
export const getAaveV4HubTypeInfo = (type, network) => (Object.assign({}, AaveV4Hubs(network !== null && network !== void 0 ? network : NetworkNumber.Eth))[type]);
|
|
27
34
|
export const getAaveV4HubByAddress = (networkId, address) => Object.values(AaveV4Hubs(networkId)).find(hub => hub.address.toLowerCase() === address.toLowerCase());
|
|
@@ -146,6 +153,17 @@ export const AAVE_V4_MAIN_SPOKE = (networkId) => ({
|
|
|
146
153
|
AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
|
|
147
154
|
],
|
|
148
155
|
});
|
|
156
|
+
export const AAVE_V4_USDG_PENDLE_SPOKE = (networkId) => ({
|
|
157
|
+
chainIds: [NetworkNumber.Eth],
|
|
158
|
+
label: 'USDG Pendle',
|
|
159
|
+
value: AaveV4SpokesType.AaveV4USDGPendleSpoke,
|
|
160
|
+
url: 'usdg-pendle',
|
|
161
|
+
address: '0x956d8e0A89cfa3744428C4641b5a53B56167a7f9',
|
|
162
|
+
hubs: [
|
|
163
|
+
AAVE_V4_PAXOS_HUB(NetworkNumber.Eth).address,
|
|
164
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
165
|
+
],
|
|
166
|
+
});
|
|
149
167
|
export const AaveV4Spokes = (networkId) => ({
|
|
150
168
|
[AaveV4SpokesType.AaveV4BluechipSpoke]: AAVE_V4_BLUECHIP_SPOKE(networkId),
|
|
151
169
|
[AaveV4SpokesType.AaveV4EthenaCorrelatedSpoke]: AAVE_V4_ETHENA_CORRELATED_SPOKE(networkId),
|
|
@@ -157,6 +175,7 @@ export const AaveV4Spokes = (networkId) => ({
|
|
|
157
175
|
[AaveV4SpokesType.AaveV4LidoSpoke]: AAVE_V4_LIDO_SPOKE(networkId),
|
|
158
176
|
[AaveV4SpokesType.AaveV4LombardBtcSpoke]: AAVE_V4_LOMBARD_BTC_SPOKE(networkId),
|
|
159
177
|
[AaveV4SpokesType.AaveV4MainSpoke]: AAVE_V4_MAIN_SPOKE(networkId),
|
|
178
|
+
[AaveV4SpokesType.AaveV4USDGPendleSpoke]: AAVE_V4_USDG_PENDLE_SPOKE(networkId),
|
|
160
179
|
});
|
|
161
180
|
export const getAaveV4SpokeTypeInfo = (type, network) => (Object.assign({}, AaveV4Spokes(network !== null && network !== void 0 ? network : NetworkNumber.Eth))[type]);
|
|
162
181
|
export const findAaveV4SpokeByAddress = (networkId, address) => Object.values(AaveV4Spokes(networkId)).find(spoke => spoke.address.toLowerCase() === address.toLowerCase());
|
|
@@ -22,7 +22,7 @@ export const STABLE_ASSETS = [
|
|
|
22
22
|
'USDe', 'sUSDe', 'USDS', 'sUSDS', 'USR', 'EURC', 'BOLD', 'BOLD Legacy', 'RLUSD', 'PT sUSDe July', 'PT eUSDe May',
|
|
23
23
|
'USDtb', 'eUSDe', 'PT USDe July', 'PT eUSDe Aug', 'PT sUSDe Sep', 'PT USDe Sep', 'PT sUSDe Nov', 'PT USDe Nov', 'PT sUSDe Jan', 'PT USDe Jan',
|
|
24
24
|
'PT sUSDe Feb', 'PT USDe Feb', 'PT sUSDe Apr', 'PT USDe Apr', 'PT sUSDe May', 'PT USDe May', 'PT srUSDe Apr', 'frxUSD', 'PT sUSDe June',
|
|
25
|
-
'PT USDe June', 'PT srUSDe Jun', 'PT USDG May', 'PT sUSDS Nov',
|
|
25
|
+
'PT USDe June', 'PT srUSDe Jun', 'PT USDG May', 'PT sUSDS Nov', 'PT USDG Sep',
|
|
26
26
|
];
|
|
27
27
|
export const isLeveragedPos = (usedAssets, dustLimit = 5) => {
|
|
28
28
|
let borrowUnstable = 0;
|
package/esm/staking/staking.js
CHANGED
|
@@ -67,7 +67,7 @@ export const STAKING_ASSETS = [
|
|
|
67
67
|
'ezETH', 'ETHx', 'rsETH', 'pufETH', 'wrsETH', 'wsuperOETHb', 'sUSDS', 'tETH', 'PT sUSDe Sep', 'PT USDe Sep',
|
|
68
68
|
'PT sUSDe Nov', 'PT USDe Nov', 'PT USDe Jan', 'PT sUSDe Jan', 'wrsETH', 'wstETH', 'syrupUSDT', 'syrupUSDC', 'wstUSR',
|
|
69
69
|
'PT sUSDe Feb', 'PT USDe Feb', 'PT sUSDe Apr', 'PT USDe Apr', 'PT sUSDe May', 'PT USDe May', 'PT srUSDe Apr', 'GHO',
|
|
70
|
-
'PT sUSDe June', 'PT USDe June', 'PT srUSDe Jun', 'PT USDG May', 'PT sUSDS Nov',
|
|
70
|
+
'PT sUSDe June', 'PT USDe June', 'PT srUSDe Jun', 'PT USDG May', 'PT sUSDS Nov', 'PT USDG Sep',
|
|
71
71
|
];
|
|
72
72
|
export const getStakingApy = memoize((asset_1, ...args_1) => __awaiter(void 0, [asset_1, ...args_1], void 0, function* (asset, network = NetworkNumber.Eth) {
|
|
73
73
|
try {
|
|
@@ -149,6 +149,8 @@ export const getStakingApy = memoize((asset_1, ...args_1) => __awaiter(void 0, [
|
|
|
149
149
|
return yield getApyFromDfsApi('PT USDe June', network);
|
|
150
150
|
if (asset === 'PT USDG May')
|
|
151
151
|
return yield getApyFromDfsApi('PT USDG May', network);
|
|
152
|
+
if (asset === 'PT USDG Sep')
|
|
153
|
+
return yield getApyFromDfsApi('PT USDG Sep', network);
|
|
152
154
|
if (asset === 'PT sUSDS Nov')
|
|
153
155
|
return yield getApyFromDfsApi('PT sUSDS Nov', network);
|
|
154
156
|
if (asset === 'GHO')
|
package/esm/types/aaveV4.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import { EthAddress, IncentiveData, LeverageType, NetworkNumber } from './common
|
|
|
2
2
|
export declare enum AaveV4HubsType {
|
|
3
3
|
AaveV4CoreHub = "aave_v4_core_hub",
|
|
4
4
|
AaveV4PlusHub = "aave_v4_plus_hub",
|
|
5
|
-
AaveV4PrimeHub = "aave_v4_prime_hub"
|
|
5
|
+
AaveV4PrimeHub = "aave_v4_prime_hub",
|
|
6
|
+
AaveV4PaxosHub = "aave_v4_paxos_hub"
|
|
6
7
|
}
|
|
7
8
|
export declare enum AaveV4SpokesType {
|
|
8
9
|
AaveV4BluechipSpoke = "aave_v4_bluechip_spoke",
|
|
@@ -14,7 +15,8 @@ export declare enum AaveV4SpokesType {
|
|
|
14
15
|
AaveV4KelpSpoke = "aave_v4_kelp_spoke",
|
|
15
16
|
AaveV4LidoSpoke = "aave_v4_lido_spoke",
|
|
16
17
|
AaveV4LombardBtcSpoke = "aave_v4_lombard_btc_spoke",
|
|
17
|
-
AaveV4MainSpoke = "aave_v4_main_spoke"
|
|
18
|
+
AaveV4MainSpoke = "aave_v4_main_spoke",
|
|
19
|
+
AaveV4USDGPendleSpoke = "aave_v4_usdg_pendle_spoke"
|
|
18
20
|
}
|
|
19
21
|
export interface AaveV4HubInfo {
|
|
20
22
|
chainIds: NetworkNumber[];
|
package/esm/types/aaveV4.js
CHANGED
|
@@ -3,6 +3,7 @@ export var AaveV4HubsType;
|
|
|
3
3
|
AaveV4HubsType["AaveV4CoreHub"] = "aave_v4_core_hub";
|
|
4
4
|
AaveV4HubsType["AaveV4PlusHub"] = "aave_v4_plus_hub";
|
|
5
5
|
AaveV4HubsType["AaveV4PrimeHub"] = "aave_v4_prime_hub";
|
|
6
|
+
AaveV4HubsType["AaveV4PaxosHub"] = "aave_v4_paxos_hub";
|
|
6
7
|
})(AaveV4HubsType || (AaveV4HubsType = {}));
|
|
7
8
|
export var AaveV4SpokesType;
|
|
8
9
|
(function (AaveV4SpokesType) {
|
|
@@ -16,4 +17,5 @@ export var AaveV4SpokesType;
|
|
|
16
17
|
AaveV4SpokesType["AaveV4LidoSpoke"] = "aave_v4_lido_spoke";
|
|
17
18
|
AaveV4SpokesType["AaveV4LombardBtcSpoke"] = "aave_v4_lombard_btc_spoke";
|
|
18
19
|
AaveV4SpokesType["AaveV4MainSpoke"] = "aave_v4_main_spoke";
|
|
20
|
+
AaveV4SpokesType["AaveV4USDGPendleSpoke"] = "aave_v4_usdg_pendle_spoke";
|
|
19
21
|
})(AaveV4SpokesType || (AaveV4SpokesType = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defisaver/positions-sdk",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.114-aave-v4-hub-1-dev",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"author": "",
|
|
22
22
|
"license": "ISC",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@defisaver/tokens": "^1.7.
|
|
24
|
+
"@defisaver/tokens": "^1.7.39",
|
|
25
25
|
"@types/lodash": "^4.17.15",
|
|
26
26
|
"@types/memoizee": "^0.4.12",
|
|
27
27
|
"decimal.js": "^10.6.0",
|
|
@@ -29,10 +29,18 @@ export const AAVE_V4_PRIME_HUB = (networkId: NetworkNumber): AaveV4HubInfo => ({
|
|
|
29
29
|
address: '0x943827DCA022D0F354a8a8c332dA1e5Eb9f9F931',
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
+
export const AAVE_V4_PAXOS_HUB = (networkId: NetworkNumber): AaveV4HubInfo => ({
|
|
33
|
+
chainIds: [NetworkNumber.Eth],
|
|
34
|
+
label: 'Paxos Hub',
|
|
35
|
+
value: AaveV4HubsType.AaveV4PaxosHub,
|
|
36
|
+
address: '0x62d63197660c080236193CA60b70E49A08E90368',
|
|
37
|
+
});
|
|
38
|
+
|
|
32
39
|
export const AaveV4Hubs = (networkId: NetworkNumber) => ({
|
|
33
40
|
[AaveV4HubsType.AaveV4CoreHub]: AAVE_V4_CORE_HUB(networkId),
|
|
34
41
|
[AaveV4HubsType.AaveV4PlusHub]: AAVE_V4_PLUS_HUB(networkId),
|
|
35
42
|
[AaveV4HubsType.AaveV4PrimeHub]: AAVE_V4_PRIME_HUB(networkId),
|
|
43
|
+
[AaveV4HubsType.AaveV4PaxosHub]: AAVE_V4_PAXOS_HUB(networkId),
|
|
36
44
|
}) as const;
|
|
37
45
|
|
|
38
46
|
export const getAaveV4HubTypeInfo = (type: AaveV4HubsType, network?: NetworkNumber) => ({ ...AaveV4Hubs(network ?? NetworkNumber.Eth) }[type]);
|
|
@@ -173,6 +181,18 @@ export const AAVE_V4_MAIN_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo =>
|
|
|
173
181
|
],
|
|
174
182
|
});
|
|
175
183
|
|
|
184
|
+
export const AAVE_V4_USDG_PENDLE_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
|
|
185
|
+
chainIds: [NetworkNumber.Eth],
|
|
186
|
+
label: 'USDG Pendle',
|
|
187
|
+
value: AaveV4SpokesType.AaveV4USDGPendleSpoke,
|
|
188
|
+
url: 'usdg-pendle',
|
|
189
|
+
address: '0x956d8e0A89cfa3744428C4641b5a53B56167a7f9',
|
|
190
|
+
hubs: [
|
|
191
|
+
AAVE_V4_PAXOS_HUB(NetworkNumber.Eth).address,
|
|
192
|
+
AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
|
|
193
|
+
],
|
|
194
|
+
});
|
|
195
|
+
|
|
176
196
|
export const AaveV4Spokes = (networkId: NetworkNumber) => ({
|
|
177
197
|
[AaveV4SpokesType.AaveV4BluechipSpoke]: AAVE_V4_BLUECHIP_SPOKE(networkId),
|
|
178
198
|
[AaveV4SpokesType.AaveV4EthenaCorrelatedSpoke]: AAVE_V4_ETHENA_CORRELATED_SPOKE(networkId),
|
|
@@ -184,6 +204,7 @@ export const AaveV4Spokes = (networkId: NetworkNumber) => ({
|
|
|
184
204
|
[AaveV4SpokesType.AaveV4LidoSpoke]: AAVE_V4_LIDO_SPOKE(networkId),
|
|
185
205
|
[AaveV4SpokesType.AaveV4LombardBtcSpoke]: AAVE_V4_LOMBARD_BTC_SPOKE(networkId),
|
|
186
206
|
[AaveV4SpokesType.AaveV4MainSpoke]: AAVE_V4_MAIN_SPOKE(networkId),
|
|
207
|
+
[AaveV4SpokesType.AaveV4USDGPendleSpoke]: AAVE_V4_USDG_PENDLE_SPOKE(networkId),
|
|
187
208
|
}) as const;
|
|
188
209
|
|
|
189
210
|
export const getAaveV4SpokeTypeInfo = (type: AaveV4SpokesType, network?: NetworkNumber) => ({ ...AaveV4Spokes(network ?? NetworkNumber.Eth) }[type]);
|
|
@@ -25,7 +25,7 @@ export const STABLE_ASSETS = [
|
|
|
25
25
|
'USDe', 'sUSDe', 'USDS', 'sUSDS', 'USR', 'EURC', 'BOLD', 'BOLD Legacy', 'RLUSD', 'PT sUSDe July', 'PT eUSDe May',
|
|
26
26
|
'USDtb', 'eUSDe', 'PT USDe July', 'PT eUSDe Aug', 'PT sUSDe Sep', 'PT USDe Sep', 'PT sUSDe Nov', 'PT USDe Nov', 'PT sUSDe Jan', 'PT USDe Jan',
|
|
27
27
|
'PT sUSDe Feb', 'PT USDe Feb', 'PT sUSDe Apr', 'PT USDe Apr', 'PT sUSDe May', 'PT USDe May', 'PT srUSDe Apr', 'frxUSD', 'PT sUSDe June',
|
|
28
|
-
'PT USDe June', 'PT srUSDe Jun', 'PT USDG May', 'PT sUSDS Nov',
|
|
28
|
+
'PT USDe June', 'PT srUSDe Jun', 'PT USDG May', 'PT sUSDS Nov', 'PT USDG Sep',
|
|
29
29
|
];
|
|
30
30
|
|
|
31
31
|
export const isLeveragedPos = (usedAssets: MMUsedAssets, dustLimit = 5) => {
|
package/src/staking/staking.ts
CHANGED
|
@@ -65,7 +65,7 @@ export const STAKING_ASSETS = [
|
|
|
65
65
|
'ezETH', 'ETHx', 'rsETH', 'pufETH', 'wrsETH', 'wsuperOETHb', 'sUSDS', 'tETH', 'PT sUSDe Sep', 'PT USDe Sep',
|
|
66
66
|
'PT sUSDe Nov', 'PT USDe Nov', 'PT USDe Jan', 'PT sUSDe Jan', 'wrsETH', 'wstETH', 'syrupUSDT', 'syrupUSDC', 'wstUSR',
|
|
67
67
|
'PT sUSDe Feb', 'PT USDe Feb', 'PT sUSDe Apr', 'PT USDe Apr', 'PT sUSDe May', 'PT USDe May', 'PT srUSDe Apr', 'GHO',
|
|
68
|
-
'PT sUSDe June', 'PT USDe June', 'PT srUSDe Jun', 'PT USDG May', 'PT sUSDS Nov',
|
|
68
|
+
'PT sUSDe June', 'PT USDe June', 'PT srUSDe Jun', 'PT USDG May', 'PT sUSDS Nov', 'PT USDG Sep',
|
|
69
69
|
];
|
|
70
70
|
|
|
71
71
|
export const getStakingApy = memoize(async (asset: string, network: number = NetworkNumber.Eth) => {
|
|
@@ -109,6 +109,7 @@ export const getStakingApy = memoize(async (asset: string, network: number = Net
|
|
|
109
109
|
if (asset === 'PT sUSDe June') return await getApyFromDfsApi('PT sUSDe June', network);
|
|
110
110
|
if (asset === 'PT USDe June') return await getApyFromDfsApi('PT USDe June', network);
|
|
111
111
|
if (asset === 'PT USDG May') return await getApyFromDfsApi('PT USDG May', network);
|
|
112
|
+
if (asset === 'PT USDG Sep') return await getApyFromDfsApi('PT USDG Sep', network);
|
|
112
113
|
if (asset === 'PT sUSDS Nov') return await getApyFromDfsApi('PT sUSDS Nov', network);
|
|
113
114
|
if (asset === 'GHO') return await getApyFromDfsApi('GHO', network);
|
|
114
115
|
} catch (e) {
|
package/src/types/aaveV4.ts
CHANGED
|
@@ -6,6 +6,7 @@ export enum AaveV4HubsType {
|
|
|
6
6
|
AaveV4CoreHub = 'aave_v4_core_hub',
|
|
7
7
|
AaveV4PlusHub = 'aave_v4_plus_hub',
|
|
8
8
|
AaveV4PrimeHub = 'aave_v4_prime_hub',
|
|
9
|
+
AaveV4PaxosHub = 'aave_v4_paxos_hub',
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export enum AaveV4SpokesType {
|
|
@@ -19,6 +20,7 @@ export enum AaveV4SpokesType {
|
|
|
19
20
|
AaveV4LidoSpoke = 'aave_v4_lido_spoke',
|
|
20
21
|
AaveV4LombardBtcSpoke = 'aave_v4_lombard_btc_spoke',
|
|
21
22
|
AaveV4MainSpoke = 'aave_v4_main_spoke',
|
|
23
|
+
AaveV4USDGPendleSpoke = 'aave_v4_usdg_pendle_spoke',
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
export interface AaveV4HubInfo {
|