@defisaver/positions-sdk 2.1.78-aave-v4-dev → 2.1.79

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.
Files changed (65) hide show
  1. package/cjs/claiming/spark.js +1 -1
  2. package/cjs/config/contracts.d.ts +0 -1551
  3. package/cjs/config/contracts.js +0 -9
  4. package/cjs/contracts.d.ts +0 -32741
  5. package/cjs/contracts.js +1 -2
  6. package/cjs/helpers/index.d.ts +0 -1
  7. package/cjs/helpers/index.js +1 -2
  8. package/cjs/index.d.ts +1 -2
  9. package/cjs/index.js +1 -3
  10. package/cjs/markets/index.d.ts +0 -1
  11. package/cjs/markets/index.js +1 -3
  12. package/cjs/portfolio/index.js +0 -20
  13. package/cjs/types/index.d.ts +0 -1
  14. package/cjs/types/index.js +0 -1
  15. package/cjs/types/portfolio.d.ts +0 -4
  16. package/esm/claiming/spark.js +1 -1
  17. package/esm/config/contracts.d.ts +0 -1551
  18. package/esm/config/contracts.js +0 -8
  19. package/esm/contracts.d.ts +0 -32741
  20. package/esm/contracts.js +0 -1
  21. package/esm/helpers/index.d.ts +0 -1
  22. package/esm/helpers/index.js +0 -1
  23. package/esm/index.d.ts +1 -2
  24. package/esm/index.js +1 -2
  25. package/esm/markets/index.d.ts +0 -1
  26. package/esm/markets/index.js +0 -1
  27. package/esm/portfolio/index.js +1 -21
  28. package/esm/types/index.d.ts +0 -1
  29. package/esm/types/index.js +0 -1
  30. package/esm/types/portfolio.d.ts +0 -4
  31. package/package.json +2 -2
  32. package/src/claiming/spark.ts +1 -1
  33. package/src/config/contracts.ts +0 -8
  34. package/src/contracts.ts +0 -2
  35. package/src/helpers/index.ts +0 -1
  36. package/src/index.ts +0 -2
  37. package/src/markets/index.ts +1 -6
  38. package/src/portfolio/index.ts +0 -20
  39. package/src/types/index.ts +1 -2
  40. package/src/types/portfolio.ts +0 -4
  41. package/cjs/aaveV4/index.d.ts +0 -7
  42. package/cjs/aaveV4/index.js +0 -298
  43. package/cjs/aaveV4/lend.d.ts +0 -45
  44. package/cjs/aaveV4/lend.js +0 -141
  45. package/cjs/helpers/aaveV4Helpers/index.d.ts +0 -12
  46. package/cjs/helpers/aaveV4Helpers/index.js +0 -117
  47. package/cjs/markets/aaveV4/index.d.ts +0 -28
  48. package/cjs/markets/aaveV4/index.js +0 -140
  49. package/cjs/types/aaveV4.d.ts +0 -153
  50. package/cjs/types/aaveV4.js +0 -19
  51. package/esm/aaveV4/index.d.ts +0 -7
  52. package/esm/aaveV4/index.js +0 -255
  53. package/esm/aaveV4/lend.d.ts +0 -45
  54. package/esm/aaveV4/lend.js +0 -134
  55. package/esm/helpers/aaveV4Helpers/index.d.ts +0 -12
  56. package/esm/helpers/aaveV4Helpers/index.js +0 -108
  57. package/esm/markets/aaveV4/index.d.ts +0 -28
  58. package/esm/markets/aaveV4/index.js +0 -122
  59. package/esm/types/aaveV4.d.ts +0 -153
  60. package/esm/types/aaveV4.js +0 -16
  61. package/src/aaveV4/index.ts +0 -291
  62. package/src/aaveV4/lend.ts +0 -180
  63. package/src/helpers/aaveV4Helpers/index.ts +0 -133
  64. package/src/markets/aaveV4/index.ts +0 -149
  65. package/src/types/aaveV4.ts +0 -169
@@ -1,149 +0,0 @@
1
- import {
2
- AaveV4HubInfo,
3
- AaveV4HubsType,
4
- AaveV4SpokeInfo,
5
- AaveV4SpokesType,
6
- NetworkNumber,
7
- } from '../../types';
8
-
9
- // HUBS
10
-
11
- export const AAVE_V4_CORE_HUB = (networkId: NetworkNumber): AaveV4HubInfo => ({
12
- chainIds: [NetworkNumber.Eth],
13
- label: 'Core Hub',
14
- value: AaveV4HubsType.AaveV4CoreHub,
15
- address: '0x3Ed2C9829FBCab6015E331a0352F8ae148217D70',
16
- });
17
-
18
- export const AAVE_V4_PLUS_HUB = (networkId: NetworkNumber): AaveV4HubInfo => ({
19
- chainIds: [NetworkNumber.Eth],
20
- label: 'Plus Hub',
21
- value: AaveV4HubsType.AaveV4PlusHub,
22
- address: '0xcb8C80026248f92c6DE735264c23c8e22922C562',
23
- });
24
-
25
- export const AAVE_V4_PRIME_HUB = (networkId: NetworkNumber): AaveV4HubInfo => ({
26
- chainIds: [NetworkNumber.Eth],
27
- label: 'Prime Hub',
28
- value: AaveV4HubsType.AaveV4PrimeHub,
29
- address: '0xea40581231Ca775e6A3d7c129cF231D292B85f20',
30
- });
31
-
32
- export const AaveV4Hubs = (networkId: NetworkNumber) => ({
33
- [AaveV4HubsType.AaveV4CoreHub]: AAVE_V4_CORE_HUB(networkId),
34
- [AaveV4HubsType.AaveV4PlusHub]: AAVE_V4_PLUS_HUB(networkId),
35
- [AaveV4HubsType.AaveV4PrimeHub]: AAVE_V4_PRIME_HUB(networkId),
36
- }) as const;
37
-
38
- export const getAaveV4HubTypeInfo = (type: AaveV4HubsType, network?: NetworkNumber) => ({ ...AaveV4Hubs(network ?? NetworkNumber.Eth) }[type]);
39
-
40
- export const getAaveV4HubByAddress = (networkId: NetworkNumber, address: string): AaveV4HubInfo | undefined => Object.values(AaveV4Hubs(networkId)).find(
41
- hub => hub.address.toLowerCase() === address.toLowerCase(),
42
- );
43
-
44
- // SPOKES
45
-
46
- export const AAVE_V4_BLUECHIP_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
47
- chainIds: [NetworkNumber.Eth],
48
- label: 'Bluechip Spoke',
49
- value: AaveV4SpokesType.AaveV4BluechipSpoke,
50
- url: 'bluechip',
51
- address: '0x637F9E189332a2821e5B046E2d7EEFae2405d6c5',
52
- hubs: [
53
- AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
54
- AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
55
- AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
56
- ],
57
- });
58
-
59
- export const AAVE_V4_ETHENA_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
60
- chainIds: [NetworkNumber.Eth],
61
- label: 'Ethena Spoke',
62
- value: AaveV4SpokesType.AaveV4EthenaSpoke,
63
- url: 'ethena',
64
- address: '0xf3b207c235f6154120F41eB63D5ACCBAfD4086D1',
65
- hubs: [
66
- AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
67
- AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
68
- AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
69
- ],
70
- });
71
-
72
- export const AAVE_V4_ETHERFI_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
73
- chainIds: [NetworkNumber.Eth],
74
- label: 'Etherfi Spoke',
75
- value: AaveV4SpokesType.AaveV4EtherfiSpoke,
76
- url: 'etherfi',
77
- address: '0x4054a9EbfcdB692599a8dF61eb0b3484F2d279D4',
78
- hubs: [
79
- AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
80
- AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
81
- AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
82
- ],
83
- });
84
-
85
- export const AAVE_V4_GOLD_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
86
- chainIds: [NetworkNumber.Eth],
87
- label: 'Gold Spoke',
88
- value: AaveV4SpokesType.AaveV4GoldSpoke,
89
- url: 'gold',
90
- address: '0x0DC7ccE912Afab8B49031A0A95DB74531741C2c4',
91
- hubs: [
92
- AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
93
- AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
94
- AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
95
- ],
96
- });
97
-
98
- export const AAVE_V4_KELP_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
99
- chainIds: [NetworkNumber.Eth],
100
- label: 'Kelp Spoke',
101
- value: AaveV4SpokesType.AaveV4KelpSpoke,
102
- url: 'kelp',
103
- address: '0x8aC76d950a3D03F9E1d857b5AAFFdA3f86C1e9AA',
104
- hubs: [
105
- AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
106
- AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
107
- AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
108
- ],
109
- });
110
-
111
- export const AAVE_V4_LIDO_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
112
- chainIds: [NetworkNumber.Eth],
113
- label: 'Lido Spoke',
114
- value: AaveV4SpokesType.AaveV4LidoSpoke,
115
- url: 'lido',
116
- address: '0x4D4a7b3Ce709b4362D7095a4A0105bDFDb5dA2a7',
117
- hubs: [
118
- AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
119
- AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
120
- AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
121
- ],
122
- });
123
-
124
- export const AAVE_V4_MAIN_SPOKE = (networkId: NetworkNumber): AaveV4SpokeInfo => ({
125
- chainIds: [NetworkNumber.Eth],
126
- label: 'Main Spoke',
127
- value: AaveV4SpokesType.AaveV4MainSpoke,
128
- url: 'main',
129
- address: '0x46539e9123A18c427e6b4DFF114c28CF405Cb023',
130
- hubs: [
131
- AAVE_V4_CORE_HUB(NetworkNumber.Eth).address,
132
- AAVE_V4_PLUS_HUB(NetworkNumber.Eth).address,
133
- AAVE_V4_PRIME_HUB(NetworkNumber.Eth).address,
134
- ],
135
- });
136
-
137
- export const AaveV4Spokes = (networkId: NetworkNumber) => ({
138
- [AaveV4SpokesType.AaveV4BluechipSpoke]: AAVE_V4_BLUECHIP_SPOKE(networkId),
139
- [AaveV4SpokesType.AaveV4EthenaSpoke]: AAVE_V4_ETHENA_SPOKE(networkId),
140
- [AaveV4SpokesType.AaveV4EtherfiSpoke]: AAVE_V4_ETHERFI_SPOKE(networkId),
141
- [AaveV4SpokesType.AaveV4GoldSpoke]: AAVE_V4_GOLD_SPOKE(networkId),
142
- [AaveV4SpokesType.AaveV4KelpSpoke]: AAVE_V4_KELP_SPOKE(networkId),
143
- [AaveV4SpokesType.AaveV4LidoSpoke]: AAVE_V4_LIDO_SPOKE(networkId),
144
- [AaveV4SpokesType.AaveV4MainSpoke]: AAVE_V4_MAIN_SPOKE(networkId),
145
- }) as const;
146
-
147
- export const getAaveV4SpokeTypeInfo = (type: AaveV4SpokesType, network?: NetworkNumber) => ({ ...AaveV4Spokes(network ?? NetworkNumber.Eth) }[type]);
148
-
149
-
@@ -1,169 +0,0 @@
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
- liquidity: bigint,
32
- liquidityFee: number,
33
- swept: bigint,
34
- totalDrawn: bigint,
35
- totalDrawnShares: bigint,
36
- totalPremiumShares: bigint,
37
- }
38
-
39
- export interface AaveV4HubOnChainData {
40
- assets: Record<number, AaveV4HubAssetOnChainData>,
41
- }
42
-
43
- export interface AaveV4SpokeInfo {
44
- chainIds: NetworkNumber[],
45
- label: string,
46
- value: AaveV4SpokesType,
47
- url: string,
48
- address: EthAddress,
49
- hubs: EthAddress[],
50
- }
51
-
52
- export interface AaveV4SpokeData {
53
- assetsData: AaveV4AssetsData,
54
- oracle: EthAddress,
55
- oracleDecimals: number,
56
- address: EthAddress,
57
- }
58
-
59
- export interface AaveV4ReserveAssetOnChain {
60
- underlying: EthAddress,
61
- hub: EthAddress,
62
- assetId: number,
63
- decimals: number,
64
- paused: boolean,
65
- frozen: boolean,
66
- borrowable: boolean,
67
- collateralRisk: number,
68
- collateralFactor: number,
69
- maxLiquidationBonus: number,
70
- liquidationFee: number,
71
- price: bigint,
72
- totalSupplied: bigint,
73
- totalDrawn: bigint,
74
- totalPremium: bigint,
75
- totalDebt: bigint,
76
- supplyCap: bigint,
77
- borrowCap: bigint,
78
- deficitRay: bigint,
79
- spokeActive: boolean,
80
- spokeHalted: boolean
81
- }
82
-
83
- export interface AaveV4ReserveAssetData {
84
- symbol: string,
85
- underlying: EthAddress,
86
- hub: EthAddress,
87
- hubName: string,
88
- assetId: number,
89
- reserveId: number,
90
- paused: boolean,
91
- frozen: boolean,
92
- borrowable: boolean,
93
- collateralRisk: number,
94
- collateralFactor: number,
95
- liquidationFee: number,
96
- price: string,
97
- totalSupplied: string,
98
- totalDrawn: string,
99
- totalPremium: string,
100
- totalDebt: string,
101
- supplyCap: string,
102
- borrowCap: string,
103
- spokeActive: boolean,
104
- spokeHalted: boolean,
105
- drawnRate: string,
106
- supplyRate: string,
107
- borrowRate: string,
108
- supplyIncentives: IncentiveData[];
109
- borrowIncentives: IncentiveData[];
110
- canBeBorrowed: boolean;
111
- canBeSupplied: boolean;
112
- canBeWithdrawn: boolean;
113
- canBePayBacked: boolean;
114
- utilization: string;
115
- }
116
-
117
- export type AaveV4AssetsData = Record<string, AaveV4ReserveAssetData>;
118
-
119
- export interface AaveV4UsedReserveAsset {
120
- symbol: string,
121
- hubName: string,
122
- assetId: number,
123
- reserveId: number,
124
- supplied: string,
125
- suppliedUsd: string,
126
- drawn: string,
127
- drawnUsd: string,
128
- premium: string,
129
- premiumUsd: string,
130
- borrowed: string,
131
- borrowedUsd: string,
132
- isSupplied: boolean,
133
- isBorrowed: boolean,
134
- collateral: boolean,
135
- collateralFactor: number,
136
- }
137
-
138
- export interface AaveV4AggregatedPositionData {
139
- suppliedUsd: string,
140
- suppliedCollateralUsd: string,
141
- borrowLimitUsd: string,
142
- liquidationLimitUsd: string,
143
- borrowedUsd: string,
144
- drawnUsd: string,
145
- premiumUsd: string,
146
- leftToBorrowUsd: string,
147
- ratio: string,
148
- collRatio: string,
149
- liqRatio: string,
150
- liqPercent: string,
151
- leveragedType: LeverageType,
152
- leveragedAsset: string,
153
- liquidationPrice: string,
154
- minCollRatio: string,
155
- collLiquidationRatio: string,
156
- minHealthRatio: string,
157
- netApy: string,
158
- incentiveUsd: string,
159
- totalInterestUsd: string,
160
- currentVolatilePairRatio?: string,
161
- }
162
-
163
- export type AaveV4UsedReserveAssets = Record<string, AaveV4UsedReserveAsset>;
164
-
165
- export interface AaveV4AccountData extends AaveV4AggregatedPositionData {
166
- usedAssets: AaveV4UsedReserveAssets,
167
- healthFactor: string,
168
- riskPremiumBps: number,
169
- }