@defisaver/positions-sdk 2.1.71 → 2.1.72-aave-v4-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/aaveV4/index.d.ts +7 -0
- package/cjs/aaveV4/index.js +174 -0
- package/cjs/config/contracts.d.ts +1551 -0
- package/cjs/config/contracts.js +9 -0
- package/cjs/contracts.d.ts +32741 -0
- package/cjs/contracts.js +2 -1
- package/cjs/helpers/aaveV4Helpers/index.d.ts +13 -0
- package/cjs/helpers/aaveV4Helpers/index.js +117 -0
- package/cjs/helpers/index.d.ts +1 -0
- package/cjs/helpers/index.js +2 -1
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +3 -1
- package/cjs/markets/aave/marketAssets.js +1 -1
- package/cjs/markets/aaveV4/index.d.ts +28 -0
- package/cjs/markets/aaveV4/index.js +140 -0
- package/cjs/markets/index.d.ts +1 -0
- package/cjs/markets/index.js +3 -1
- package/cjs/portfolio/index.js +20 -0
- package/cjs/staking/eligibility.d.ts +6 -0
- package/cjs/staking/eligibility.js +37 -19
- package/cjs/staking/staking.js +4 -2
- package/cjs/types/aaveV4.d.ts +145 -0
- package/cjs/types/aaveV4.js +19 -0
- package/cjs/types/common.d.ts +2 -1
- package/cjs/types/common.js +1 -0
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/index.js +1 -0
- package/cjs/types/portfolio.d.ts +4 -0
- package/esm/aaveV4/index.d.ts +7 -0
- package/esm/aaveV4/index.js +165 -0
- package/esm/config/contracts.d.ts +1551 -0
- package/esm/config/contracts.js +8 -0
- package/esm/contracts.d.ts +32741 -0
- package/esm/contracts.js +1 -0
- package/esm/helpers/aaveV4Helpers/index.d.ts +13 -0
- package/esm/helpers/aaveV4Helpers/index.js +108 -0
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.js +1 -0
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/markets/aave/marketAssets.js +1 -1
- package/esm/markets/aaveV4/index.d.ts +28 -0
- package/esm/markets/aaveV4/index.js +122 -0
- package/esm/markets/index.d.ts +1 -0
- package/esm/markets/index.js +1 -0
- package/esm/portfolio/index.js +21 -1
- package/esm/staking/eligibility.d.ts +6 -0
- package/esm/staking/eligibility.js +35 -18
- package/esm/staking/staking.js +4 -2
- package/esm/types/aaveV4.d.ts +145 -0
- package/esm/types/aaveV4.js +16 -0
- package/esm/types/common.d.ts +2 -1
- package/esm/types/common.js +1 -0
- package/esm/types/index.d.ts +1 -0
- package/esm/types/index.js +1 -0
- package/esm/types/portfolio.d.ts +4 -0
- package/package.json +2 -2
- package/src/aaveV4/index.ts +176 -0
- package/src/config/contracts.ts +9 -1
- package/src/contracts.ts +3 -1
- package/src/helpers/aaveV4Helpers/index.ts +128 -0
- package/src/helpers/index.ts +1 -0
- package/src/index.ts +2 -0
- package/src/markets/aave/marketAssets.ts +1 -1
- package/src/markets/aaveV4/index.ts +149 -0
- package/src/markets/index.ts +6 -1
- package/src/portfolio/index.ts +20 -0
- package/src/staking/eligibility.ts +67 -15
- package/src/staking/staking.ts +3 -2
- package/src/types/aaveV4.ts +161 -0
- package/src/types/common.ts +1 -0
- package/src/types/index.ts +2 -1
- package/src/types/portfolio.ts +4 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EthAddress, IncentiveData, LeverageType, NetworkNumber,
|
|
3
|
+
} from './common';
|
|
4
|
+
|
|
5
|
+
export enum AaveV4HubsType {
|
|
6
|
+
AaveV4CoreHub = 'aave_v4_core_hub',
|
|
7
|
+
AaveV4PlusHub = 'aave_v4_plus_hub',
|
|
8
|
+
AaveV4PrimeHub = 'aave_v4_prime_hub',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export enum AaveV4SpokesType {
|
|
12
|
+
AaveV4BluechipSpoke = 'aave_v4_bluechip_spoke',
|
|
13
|
+
AaveV4EthenaSpoke = 'aave_v4_ethena_spoke',
|
|
14
|
+
AaveV4EtherfiSpoke = 'aave_v4_etherfi_spoke',
|
|
15
|
+
AaveV4GoldSpoke = 'aave_v4_gold_spoke',
|
|
16
|
+
AaveV4KelpSpoke = 'aave_v4_kelp_spoke',
|
|
17
|
+
AaveV4LidoSpoke = 'aave_v4_lido_spoke',
|
|
18
|
+
AaveV4MainSpoke = 'aave_v4_main_spoke',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface AaveV4HubInfo {
|
|
22
|
+
chainIds: NetworkNumber[],
|
|
23
|
+
label: string,
|
|
24
|
+
value: AaveV4HubsType,
|
|
25
|
+
address: EthAddress,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface AaveV4HubAssetOnChainData {
|
|
29
|
+
assetId: number,
|
|
30
|
+
drawnRate: bigint,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface AaveV4HubOnChainData {
|
|
34
|
+
assets: Record<number, AaveV4HubAssetOnChainData>,
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface AaveV4SpokeInfo {
|
|
38
|
+
chainIds: NetworkNumber[],
|
|
39
|
+
label: string,
|
|
40
|
+
value: AaveV4SpokesType,
|
|
41
|
+
url: string,
|
|
42
|
+
address: EthAddress,
|
|
43
|
+
hubs: EthAddress[],
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface AaveV4SpokeData {
|
|
47
|
+
assetsData: AaveV4AssetsData,
|
|
48
|
+
oracle: EthAddress,
|
|
49
|
+
oracleDecimals: number,
|
|
50
|
+
address: EthAddress,
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface AaveV4ReserveAssetOnChain {
|
|
54
|
+
underlying: EthAddress,
|
|
55
|
+
hub: EthAddress,
|
|
56
|
+
assetId: number,
|
|
57
|
+
decimals: number,
|
|
58
|
+
paused: boolean,
|
|
59
|
+
frozen: boolean,
|
|
60
|
+
borrowable: boolean,
|
|
61
|
+
collateralRisk: number,
|
|
62
|
+
collateralFactor: number,
|
|
63
|
+
maxLiquidationBonus: number,
|
|
64
|
+
liquidationFee: number,
|
|
65
|
+
price: bigint,
|
|
66
|
+
totalSupplied: bigint,
|
|
67
|
+
totalDrawn: bigint,
|
|
68
|
+
totalPremium: bigint,
|
|
69
|
+
totalDebt: bigint,
|
|
70
|
+
supplyCap: bigint,
|
|
71
|
+
borrowCap: bigint,
|
|
72
|
+
deficitRay: bigint,
|
|
73
|
+
spokeActive: boolean,
|
|
74
|
+
spokeHalted: boolean
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface AaveV4ReserveAssetData {
|
|
78
|
+
symbol: string,
|
|
79
|
+
underlying: EthAddress,
|
|
80
|
+
hub: EthAddress,
|
|
81
|
+
hubName: string,
|
|
82
|
+
assetId: number,
|
|
83
|
+
reserveId: number,
|
|
84
|
+
paused: boolean,
|
|
85
|
+
frozen: boolean,
|
|
86
|
+
borrowable: boolean,
|
|
87
|
+
collateralRisk: number,
|
|
88
|
+
collateralFactor: number,
|
|
89
|
+
liquidationFee: number,
|
|
90
|
+
price: string,
|
|
91
|
+
totalSupplied: string,
|
|
92
|
+
totalDrawn: string,
|
|
93
|
+
totalPremium: string,
|
|
94
|
+
totalDebt: string,
|
|
95
|
+
supplyCap: string,
|
|
96
|
+
borrowCap: string,
|
|
97
|
+
spokeActive: boolean,
|
|
98
|
+
spokeHalted: boolean,
|
|
99
|
+
drawnRate: string,
|
|
100
|
+
supplyRate: string,
|
|
101
|
+
supplyIncentives: IncentiveData[];
|
|
102
|
+
borrowIncentives: IncentiveData[];
|
|
103
|
+
canBeBorrowed: boolean;
|
|
104
|
+
canBeSupplied: boolean;
|
|
105
|
+
canBeWithdrawn: boolean;
|
|
106
|
+
canBePayBacked: boolean;
|
|
107
|
+
utilization: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export type AaveV4AssetsData = Record<string, AaveV4ReserveAssetData>;
|
|
111
|
+
|
|
112
|
+
export interface AaveV4UsedReserveAsset {
|
|
113
|
+
symbol: string,
|
|
114
|
+
hubName: string,
|
|
115
|
+
assetId: number,
|
|
116
|
+
reserveId: number,
|
|
117
|
+
supplied: string,
|
|
118
|
+
suppliedUsd: string,
|
|
119
|
+
drawn: string,
|
|
120
|
+
drawnUsd: string,
|
|
121
|
+
premium: string,
|
|
122
|
+
premiumUsd: string,
|
|
123
|
+
borrowed: string,
|
|
124
|
+
borrowedUsd: string,
|
|
125
|
+
isSupplied: boolean,
|
|
126
|
+
isBorrowed: boolean,
|
|
127
|
+
collateral: boolean,
|
|
128
|
+
collateralFactor: number,
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface AaveV4AggregatedPositionData {
|
|
132
|
+
suppliedUsd: string,
|
|
133
|
+
suppliedCollateralUsd: string,
|
|
134
|
+
borrowLimitUsd: string,
|
|
135
|
+
liquidationLimitUsd: string,
|
|
136
|
+
borrowedUsd: string,
|
|
137
|
+
drawnUsd: string,
|
|
138
|
+
premiumUsd: string,
|
|
139
|
+
leftToBorrowUsd: string,
|
|
140
|
+
ratio: string,
|
|
141
|
+
collRatio: string,
|
|
142
|
+
liqRatio: string,
|
|
143
|
+
liqPercent: string,
|
|
144
|
+
leveragedType: LeverageType,
|
|
145
|
+
leveragedAsset: string,
|
|
146
|
+
liquidationPrice: string,
|
|
147
|
+
minCollRatio: string,
|
|
148
|
+
collLiquidationRatio: string,
|
|
149
|
+
minHealthRatio: string,
|
|
150
|
+
netApy: string,
|
|
151
|
+
incentiveUsd: string,
|
|
152
|
+
totalInterestUsd: string,
|
|
153
|
+
currentVolatilePairRatio?: string,
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export type AaveV4UsedReserveAssets = Record<string, AaveV4UsedReserveAsset>;
|
|
157
|
+
|
|
158
|
+
export interface AaveV4AccountData extends AaveV4AggregatedPositionData {
|
|
159
|
+
usedAssets: AaveV4UsedReserveAssets,
|
|
160
|
+
healthFactor: string,
|
|
161
|
+
}
|
package/src/types/common.ts
CHANGED
|
@@ -8,6 +8,7 @@ export enum IncentiveEligibilityId {
|
|
|
8
8
|
AaveV3ArbitrumEthSupply = '0x5d16261c6715a653248269861bbacf68a9774cde',
|
|
9
9
|
AaveV3ArbitrumETHLSBorrow = '0x0c84331e39d6658Cd6e6b9ba04736cC4c4734351',
|
|
10
10
|
AaveV3EthenaLiquidLeveragePlasma = '0xeefac321069fbecc9d6b2aed2948f6d5503d8633BORROW_BL',
|
|
11
|
+
AaveV3EthenaLiquidLeveragePlasmaGHO = 'replace_when_known',
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export enum LeverageType {
|
package/src/types/index.ts
CHANGED
package/src/types/portfolio.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AaveV2PositionData, AaveV3PositionData, AaveVersions } from './aave';
|
|
2
|
+
import { AaveV4AccountData, AaveV4SpokesType } from './aaveV4';
|
|
2
3
|
import { EthAddress } from './common';
|
|
3
4
|
import { CompoundV2PositionData, CompoundV3PositionData, CompoundVersions } from './compound';
|
|
4
5
|
import { CrvUSDUserData, CrvUSDVersions } from './curveUsd';
|
|
@@ -54,6 +55,9 @@ export interface PortfolioPositionsDataForAddress {
|
|
|
54
55
|
[key: string]: FluidVaultData;
|
|
55
56
|
};
|
|
56
57
|
};
|
|
58
|
+
aaveV4: {
|
|
59
|
+
[key in AaveV4SpokesType]?: PortfolioProtocolData<AaveV4AccountData>;
|
|
60
|
+
};
|
|
57
61
|
}
|
|
58
62
|
|
|
59
63
|
export interface PortfolioPositionsData {
|