@1delta/margin-fetcher 0.0.18 → 0.0.20

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 (126) hide show
  1. package/dist/abis/aave-v2/YLDR.d.ts.map +1 -1
  2. package/dist/abis/aave-v2/YLDR.js +176 -148
  3. package/dist/abis/aave-v3/YLDR.js +29 -29
  4. package/dist/abis/compound-v3/Comet.d.ts +0 -20
  5. package/dist/abis/compound-v3/Comet.d.ts.map +1 -1
  6. package/dist/abis/compound-v3/Comet.js +0 -25
  7. package/dist/assets/liquidityThresholds.d.ts +10 -0
  8. package/dist/assets/liquidityThresholds.d.ts.map +1 -1
  9. package/dist/assets/liquidityThresholds.js +9 -2
  10. package/dist/flash-liquidity/fetchLiquidity.d.ts +2 -2
  11. package/dist/flash-liquidity/fetchLiquidity.d.ts.map +1 -1
  12. package/dist/flash-liquidity/fetchLiquidity.js +85 -54
  13. package/dist/flash-liquidity/types.d.ts +1 -0
  14. package/dist/flash-liquidity/types.d.ts.map +1 -1
  15. package/dist/lending/aave-v3-type/publicCallBuild.d.ts +1 -1
  16. package/dist/lending/aave-v3-type/publicCallBuild.d.ts.map +1 -1
  17. package/dist/lending/aave-v3-type/publicCallBuild.js +46 -48
  18. package/dist/lending/aave-v3-type/publicCallParse.d.ts.map +1 -1
  19. package/dist/lending/aave-v3-type/publicCallParse.js +8 -2
  20. package/dist/lending/compound-v3/publicCallParse.d.ts.map +1 -1
  21. package/dist/lending/compound-v3/publicCallParse.js +8 -3
  22. package/dist/lending/fetchLender.js +3 -3
  23. package/dist/lending/morpho/convertPublic.js +1 -1
  24. package/dist/lending/user-data/abis.d.ts +20 -20
  25. package/dist/lending/user-data/compound-v3/userCallBuild.d.ts.map +1 -1
  26. package/dist/lending/user-data/compound-v3/userCallBuild.js +1 -7
  27. package/dist/lending/user-data/compound-v3/userCallParse.d.ts +2 -2
  28. package/dist/lending/user-data/compound-v3/userCallParse.d.ts.map +1 -1
  29. package/dist/lending/user-data/compound-v3/userCallParse.js +19 -20
  30. package/dist/lending/user-data/morpho/userCallBuild.d.ts.map +1 -1
  31. package/dist/lending/user-data/morpho/userCallBuild.js +6 -4
  32. package/dist/lending/user-data/types.js +2 -2
  33. package/dist/lending-pairs/computeLendingPairs.d.ts +10 -1
  34. package/dist/lending-pairs/computeLendingPairs.d.ts.map +1 -1
  35. package/dist/lending-pairs/computeLendingPairs.js +26 -22
  36. package/dist/prices/defillama/index.d.ts.map +1 -1
  37. package/dist/prices/defillama/index.js +162 -151
  38. package/dist/prices/index.d.ts +3 -2
  39. package/dist/prices/index.d.ts.map +1 -1
  40. package/dist/prices/index.js +3 -2
  41. package/dist/prices/main-prices/addresses/aaveOracles.d.ts +159 -143
  42. package/dist/prices/main-prices/addresses/aaveOracles.d.ts.map +1 -1
  43. package/dist/prices/main-prices/addresses/aaveOracles.js +276 -260
  44. package/dist/prices/main-prices/addresses/morpho.d.ts.map +1 -1
  45. package/dist/prices/main-prices/addresses/morpho.js +305 -0
  46. package/dist/prices/main-prices/fetchOracleData.d.ts.map +1 -1
  47. package/dist/prices/main-prices/fetchOracleData.js +25 -11
  48. package/dist/prices/pendle/fetchPendlePrices.d.ts +7 -0
  49. package/dist/prices/pendle/fetchPendlePrices.d.ts.map +1 -0
  50. package/dist/prices/pendle/fetchPendlePrices.js +148 -0
  51. package/dist/prices/pendle/index.d.ts +2 -0
  52. package/dist/prices/pendle/index.d.ts.map +1 -0
  53. package/dist/prices/pendle/index.js +1 -0
  54. package/dist/types/apiReturnType.d.ts +2 -0
  55. package/dist/types/apiReturnType.d.ts.map +1 -1
  56. package/dist/utils/index.d.ts +1 -3
  57. package/dist/utils/index.d.ts.map +1 -1
  58. package/dist/utils/index.js +10 -16
  59. package/dist/yields/index.d.ts.map +1 -1
  60. package/dist/yields/index.js +58 -33
  61. package/package.json +3 -6
  62. package/src/abis/aave-v2/YLDR.ts +177 -149
  63. package/src/abis/aave-v3/YLDR.ts +45 -45
  64. package/src/abis/compound-v3/Comet.ts +0 -25
  65. package/src/assets/liquidityThresholds.ts +22 -3
  66. package/src/flash-liquidity/fetchLiquidity.ts +298 -261
  67. package/src/flash-liquidity/types.ts +1 -0
  68. package/src/lending/aave-v3-type/publicCallBuild.ts +74 -68
  69. package/src/lending/aave-v3-type/publicCallParse.ts +8 -2
  70. package/src/lending/compound-v3/publicCallParse.ts +10 -3
  71. package/src/lending/fetchLender.ts +3 -3
  72. package/src/lending/morpho/convertPublic.ts +1 -1
  73. package/src/lending/user-data/compound-v3/userCallBuild.ts +1 -8
  74. package/src/lending/user-data/compound-v3/userCallParse.ts +39 -29
  75. package/src/lending/user-data/morpho/userCallBuild.ts +6 -4
  76. package/src/lending/user-data/types.ts +2 -2
  77. package/src/lending-pairs/computeLendingPairs.ts +423 -410
  78. package/src/prices/defillama/index.ts +233 -227
  79. package/src/prices/index.ts +3 -2
  80. package/src/prices/main-prices/addresses/aaveOracles.ts +292 -277
  81. package/src/prices/main-prices/addresses/morpho.ts +305 -0
  82. package/src/prices/main-prices/fetchOracleData.ts +33 -24
  83. package/src/prices/pendle/fetchPendlePrices.ts +208 -0
  84. package/src/prices/pendle/index.ts +1 -0
  85. package/src/types/apiReturnType.ts +42 -39
  86. package/src/utils/index.ts +11 -18
  87. package/src/yields/index.ts +219 -178
  88. package/test/flashLiquidity.test.ts +40 -0
  89. package/test/index.test.ts +101 -97
  90. package/test/lenderData.test.ts +18 -13254
  91. package/test/mainPriceMB.test.ts +1 -1
  92. package/test/mainPrices.test.ts +24 -19
  93. package/test/morpho.test.ts +1 -1
  94. package/test/morphoPrice.test.ts +1 -1
  95. package/test/userDataAave.test.ts +73 -0
  96. package/test/yields.test.ts +27 -0
  97. package/tsconfig.json +2 -1
  98. package/dist/abis/aave/AToken.d.ts +0 -526
  99. package/dist/abis/aave/AToken.d.ts.map +0 -1
  100. package/dist/abis/aave/AToken.js +0 -686
  101. package/dist/abis/aave/AavePoolV3.d.ts +0 -819
  102. package/dist/abis/aave/AavePoolV3.d.ts.map +0 -1
  103. package/dist/abis/aave/AavePoolV3.js +0 -1060
  104. package/dist/abis/init/Core.d.ts +0 -523
  105. package/dist/abis/init/Core.d.ts.map +0 -1
  106. package/dist/abis/init/Core.js +0 -681
  107. package/dist/abis/init/InitFlashAggregator.d.ts +0 -624
  108. package/dist/abis/init/InitFlashAggregator.d.ts.map +0 -1
  109. package/dist/abis/init/InitFlashAggregator.js +0 -795
  110. package/dist/abis/init/PosManager.d.ts +0 -802
  111. package/dist/abis/init/PosManager.d.ts.map +0 -1
  112. package/dist/abis/init/PosManager.js +0 -1055
  113. package/dist/abis/uniswap/FeeOnTransferDetector.d.ts +0 -102
  114. package/dist/abis/uniswap/FeeOnTransferDetector.d.ts.map +0 -1
  115. package/dist/abis/uniswap/FeeOnTransferDetector.js +0 -133
  116. package/dist/abis/uniswap/UniswapV2Pair.d.ts +0 -513
  117. package/dist/abis/uniswap/UniswapV2Pair.d.ts.map +0 -1
  118. package/dist/abis/uniswap/UniswapV2Pair.js +0 -659
  119. package/src/abis/aave/AToken.ts +0 -686
  120. package/src/abis/aave/AavePoolV3.ts +0 -1060
  121. package/src/abis/init/Core.ts +0 -681
  122. package/src/abis/init/InitFlashAggregator.ts +0 -795
  123. package/src/abis/init/PosManager.ts +0 -1055
  124. package/src/abis/uniswap/FeeOnTransferDetector.ts +0 -133
  125. package/src/abis/uniswap/UniswapV2Pair.ts +0 -659
  126. /package/test/{userdata.test.ts → userData.test.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"YLDR.d.ts","sourceRoot":"","sources":["../../../src/abis/aave-v2/YLDR.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsM9B,CAAA"}
1
+ {"version":3,"file":"YLDR.d.ts","sourceRoot":"","sources":["../../../src/abis/aave-v2/YLDR.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkO9B,CAAA"}
@@ -1,199 +1,227 @@
1
1
  export const YLDRProtocolDataProviderAbi = [
2
2
  {
3
- "type": "constructor",
4
- "inputs": [
5
- {
6
- "type": "address",
7
- "name": "addressesProvider",
8
- "internalType": "contract ILendingPoolAddressesProvider"
9
- }
10
- ]
3
+ type: 'constructor',
4
+ inputs: [
5
+ {
6
+ type: 'address',
7
+ name: 'addressesProvider',
8
+ internalType: 'contract ILendingPoolAddressesProvider',
9
+ },
10
+ ],
11
11
  },
12
12
  {
13
- "type": "function",
14
- "stateMutability": "view",
15
- "outputs": [
16
- {
17
- "type": "address",
18
- "name": "",
19
- "internalType": "contract ILendingPoolAddressesProvider"
20
- }
13
+ type: 'function',
14
+ stateMutability: 'view',
15
+ outputs: [
16
+ {
17
+ type: 'address',
18
+ name: '',
19
+ internalType: 'contract ILendingPoolAddressesProvider',
20
+ },
21
21
  ],
22
- "name": "ADDRESSES_PROVIDER",
23
- "inputs": []
22
+ name: 'ADDRESSES_PROVIDER',
23
+ inputs: [],
24
24
  },
25
25
  {
26
- "type": "function",
27
- "stateMutability": "view",
28
- "outputs": [
29
- {
30
- "type": "tuple[]",
31
- "name": "",
32
- "internalType": "struct AaveProtocolDataProvider.TokenData[]",
33
- "components": [
26
+ type: 'function',
27
+ stateMutability: 'view',
28
+ outputs: [
29
+ {
30
+ type: 'tuple[]',
31
+ name: '',
32
+ internalType: 'struct AaveProtocolDataProvider.TokenData[]',
33
+ components: [
34
34
  {
35
- "type": "string"
35
+ type: 'string',
36
36
  },
37
37
  {
38
- "type": "address"
39
- }
40
- ]
41
- }
38
+ type: 'address',
39
+ },
40
+ ],
41
+ },
42
42
  ],
43
- "name": "getAllATokens",
44
- "inputs": []
43
+ name: 'getAllATokens',
44
+ inputs: [],
45
45
  },
46
46
  {
47
- "type": "function",
48
- "stateMutability": "view",
49
- "outputs": [
50
- {
51
- "type": "tuple[]",
52
- "name": "",
53
- "internalType": "struct AaveProtocolDataProvider.TokenData[]",
54
- "components": [
47
+ type: 'function',
48
+ stateMutability: 'view',
49
+ outputs: [
50
+ {
51
+ type: 'tuple[]',
52
+ name: '',
53
+ internalType: 'struct AaveProtocolDataProvider.TokenData[]',
54
+ components: [
55
55
  {
56
- "type": "string"
56
+ type: 'string',
57
57
  },
58
58
  {
59
- "type": "address"
60
- }
61
- ]
62
- }
59
+ type: 'address',
60
+ },
61
+ ],
62
+ },
63
63
  ],
64
- "name": "getAllReservesTokens",
65
- "inputs": []
64
+ name: 'getAllReservesTokens',
65
+ inputs: [],
66
66
  },
67
- { "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], "name": "getReserveConfigurationData", "outputs": [{ "internalType": "uint256", "name": "decimals", "type": "uint256" }, { "internalType": "uint256", "name": "ltv", "type": "uint256" }, { "internalType": "uint256", "name": "liquidationThreshold", "type": "uint256" }, { "internalType": "uint256", "name": "liquidationBonus", "type": "uint256" }, { "internalType": "uint256", "name": "reserveFactor", "type": "uint256" }, { "internalType": "bool", "name": "usageAsCollateralEnabled", "type": "bool" }, { "internalType": "bool", "name": "borrowingEnabled", "type": "bool" }, { "internalType": "bool", "name": "isActive", "type": "bool" }, { "internalType": "bool", "name": "isFrozen", "type": "bool" }], "stateMutability": "view", "type": "function" },
68
67
  {
69
- "inputs": [{
70
- "internalType": "address",
71
- "name": "asset",
72
- "type": "address"
73
- }],
74
- "name": "getReserveData",
75
- "outputs": [{
76
- "internalType": "uint256",
77
- "name": "accruedToTreasuryScaled",
78
- "type": "uint256"
79
- },
80
- {
81
- "internalType": "uint256",
82
- "name": "totalYToken",
83
- "type": "uint256"
84
- }, {
85
- "internalType": "uint256",
86
- "name": "totalVariableDebt",
87
- "type": "uint256"
88
- },
89
- {
90
- "internalType": "uint256",
91
- "name": "liquidityRate",
92
- "type": "uint256"
93
- }, {
94
- "internalType": "uint256",
95
- "name": "variableBorrowRate",
96
- "type": "uint256"
97
- },
98
- {
99
- "internalType": "uint256",
100
- "name": "liquidityIndex",
101
- "type": "uint256"
102
- }, { "internalType": "uint256", "name": "variableBorrowIndex", "type": "uint256" },
103
- { "internalType": "uint40", "name": "lastUpdateTimestamp", "type": "uint40" }],
104
- "stateMutability": "view", "type": "function"
68
+ inputs: [{ internalType: 'address', name: 'asset', type: 'address' }],
69
+ name: 'getReserveConfigurationData',
70
+ outputs: [
71
+ { internalType: 'uint256', name: 'decimals', type: 'uint256' },
72
+ { internalType: 'uint256', name: 'ltv', type: 'uint256' },
73
+ {
74
+ internalType: 'uint256',
75
+ name: 'liquidationThreshold',
76
+ type: 'uint256',
77
+ },
78
+ { internalType: 'uint256', name: 'liquidationBonus', type: 'uint256' },
79
+ { internalType: 'uint256', name: 'reserveFactor', type: 'uint256' },
80
+ { internalType: 'bool', name: 'usageAsCollateralEnabled', type: 'bool' },
81
+ { internalType: 'bool', name: 'borrowingEnabled', type: 'bool' },
82
+ { internalType: 'bool', name: 'isActive', type: 'bool' },
83
+ { internalType: 'bool', name: 'isFrozen', type: 'bool' },
84
+ ],
85
+ stateMutability: 'view',
86
+ type: 'function',
105
87
  },
106
88
  {
107
- "type": "function",
108
- "stateMutability": "view",
109
- "outputs": [
89
+ inputs: [
110
90
  {
111
- "type": "address",
112
- "name": "aTokenAddress",
113
- "internalType": "address"
91
+ internalType: 'address',
92
+ name: 'asset',
93
+ type: 'address',
114
94
  },
95
+ ],
96
+ name: 'getReserveData',
97
+ outputs: [
115
98
  {
116
- "type": "address",
117
- "name": "stableDebtTokenAddress",
118
- "internalType": "address"
99
+ internalType: 'uint256',
100
+ name: 'accruedToTreasuryScaled',
101
+ type: 'uint256',
119
102
  },
120
103
  {
121
- "type": "address",
122
- "name": "variableDebtTokenAddress",
123
- "internalType": "address"
124
- }
104
+ internalType: 'uint256',
105
+ name: 'totalYToken',
106
+ type: 'uint256',
107
+ },
108
+ {
109
+ internalType: 'uint256',
110
+ name: 'totalVariableDebt',
111
+ type: 'uint256',
112
+ },
113
+ {
114
+ internalType: 'uint256',
115
+ name: 'liquidityRate',
116
+ type: 'uint256',
117
+ },
118
+ {
119
+ internalType: 'uint256',
120
+ name: 'variableBorrowRate',
121
+ type: 'uint256',
122
+ },
123
+ {
124
+ internalType: 'uint256',
125
+ name: 'liquidityIndex',
126
+ type: 'uint256',
127
+ },
128
+ { internalType: 'uint256', name: 'variableBorrowIndex', type: 'uint256' },
129
+ { internalType: 'uint40', name: 'lastUpdateTimestamp', type: 'uint40' },
130
+ ],
131
+ stateMutability: 'view',
132
+ type: 'function',
133
+ },
134
+ {
135
+ type: 'function',
136
+ stateMutability: 'view',
137
+ outputs: [
138
+ {
139
+ type: 'address',
140
+ name: 'aTokenAddress',
141
+ internalType: 'address',
142
+ },
143
+ {
144
+ type: 'address',
145
+ name: 'stableDebtTokenAddress',
146
+ internalType: 'address',
147
+ },
148
+ {
149
+ type: 'address',
150
+ name: 'variableDebtTokenAddress',
151
+ internalType: 'address',
152
+ },
153
+ ],
154
+ name: 'getReserveTokensAddresses',
155
+ inputs: [
156
+ {
157
+ type: 'address',
158
+ name: 'asset',
159
+ internalType: 'address',
160
+ },
125
161
  ],
126
- "name": "getReserveTokensAddresses",
127
- "inputs": [
128
- {
129
- "type": "address",
130
- "name": "asset",
131
- "internalType": "address"
132
- }
133
- ]
134
162
  },
135
163
  {
136
- "type": "function",
137
- "stateMutability": "view",
138
- "outputs": [
164
+ type: 'function',
165
+ stateMutability: 'view',
166
+ outputs: [
139
167
  {
140
- "type": "uint256",
141
- "name": "currentATokenBalance",
142
- "internalType": "uint256"
168
+ type: 'uint256',
169
+ name: 'currentATokenBalance',
170
+ internalType: 'uint256',
143
171
  },
144
172
  {
145
- "type": "uint256",
146
- "name": "currentStableDebt",
147
- "internalType": "uint256"
173
+ type: 'uint256',
174
+ name: 'currentStableDebt',
175
+ internalType: 'uint256',
148
176
  },
149
177
  {
150
- "type": "uint256",
151
- "name": "currentVariableDebt",
152
- "internalType": "uint256"
178
+ type: 'uint256',
179
+ name: 'currentVariableDebt',
180
+ internalType: 'uint256',
153
181
  },
154
182
  {
155
- "type": "uint256",
156
- "name": "principalStableDebt",
157
- "internalType": "uint256"
183
+ type: 'uint256',
184
+ name: 'principalStableDebt',
185
+ internalType: 'uint256',
158
186
  },
159
187
  {
160
- "type": "uint256",
161
- "name": "scaledVariableDebt",
162
- "internalType": "uint256"
188
+ type: 'uint256',
189
+ name: 'scaledVariableDebt',
190
+ internalType: 'uint256',
163
191
  },
164
192
  {
165
- "type": "uint256",
166
- "name": "stableBorrowRate",
167
- "internalType": "uint256"
193
+ type: 'uint256',
194
+ name: 'stableBorrowRate',
195
+ internalType: 'uint256',
168
196
  },
169
197
  {
170
- "type": "uint256",
171
- "name": "liquidityRate",
172
- "internalType": "uint256"
198
+ type: 'uint256',
199
+ name: 'liquidityRate',
200
+ internalType: 'uint256',
173
201
  },
174
202
  {
175
- "type": "uint40",
176
- "name": "stableRateLastUpdated",
177
- "internalType": "uint40"
203
+ type: 'uint40',
204
+ name: 'stableRateLastUpdated',
205
+ internalType: 'uint40',
178
206
  },
179
207
  {
180
- "type": "bool",
181
- "name": "usageAsCollateralEnabled",
182
- "internalType": "bool"
183
- }
208
+ type: 'bool',
209
+ name: 'usageAsCollateralEnabled',
210
+ internalType: 'bool',
211
+ },
184
212
  ],
185
- "name": "getUserReserveData",
186
- "inputs": [
213
+ name: 'getUserReserveData',
214
+ inputs: [
187
215
  {
188
- "type": "address",
189
- "name": "asset",
190
- "internalType": "address"
216
+ type: 'address',
217
+ name: 'asset',
218
+ internalType: 'address',
191
219
  },
192
220
  {
193
- "type": "address",
194
- "name": "user",
195
- "internalType": "address"
196
- }
197
- ]
198
- }
221
+ type: 'address',
222
+ name: 'user',
223
+ internalType: 'address',
224
+ },
225
+ ],
226
+ },
199
227
  ];
@@ -1,46 +1,46 @@
1
1
  export const YLDRAbi = [
2
2
  {
3
- "inputs": [
3
+ inputs: [
4
4
  {
5
- "internalType": "address",
6
- "name": "asset",
7
- "type": "address"
5
+ internalType: 'address',
6
+ name: 'asset',
7
+ type: 'address',
8
8
  },
9
9
  {
10
- "internalType": "address",
11
- "name": "user",
12
- "type": "address"
13
- }
10
+ internalType: 'address',
11
+ name: 'user',
12
+ type: 'address',
13
+ },
14
14
  ],
15
- "name": "getUserReserveData",
16
- "outputs": [
15
+ name: 'getUserReserveData',
16
+ outputs: [
17
17
  {
18
- "internalType": "uint256",
19
- "name": "currentYTokenBalance",
20
- "type": "uint256"
18
+ internalType: 'uint256',
19
+ name: 'currentYTokenBalance',
20
+ type: 'uint256',
21
21
  },
22
22
  {
23
- "internalType": "uint256",
24
- "name": "currentVariableDebt",
25
- "type": "uint256"
23
+ internalType: 'uint256',
24
+ name: 'currentVariableDebt',
25
+ type: 'uint256',
26
26
  },
27
27
  {
28
- "internalType": "uint256",
29
- "name": "scaledVariableDebt",
30
- "type": "uint256"
28
+ internalType: 'uint256',
29
+ name: 'scaledVariableDebt',
30
+ type: 'uint256',
31
31
  },
32
32
  {
33
- "internalType": "uint256",
34
- "name": "liquidityRate",
35
- "type": "uint256"
33
+ internalType: 'uint256',
34
+ name: 'liquidityRate',
35
+ type: 'uint256',
36
36
  },
37
37
  {
38
- "internalType": "bool",
39
- "name": "usageAsCollateralEnabled",
40
- "type": "bool"
41
- }
38
+ internalType: 'bool',
39
+ name: 'usageAsCollateralEnabled',
40
+ type: 'bool',
41
+ },
42
42
  ],
43
- "stateMutability": "view",
44
- "type": "function"
45
- }
43
+ stateMutability: 'view',
44
+ type: 'function',
45
+ },
46
46
  ];
@@ -989,26 +989,6 @@ export declare const CometAbi: readonly [{
989
989
  readonly outputs: readonly [];
990
990
  readonly stateMutability: "nonpayable";
991
991
  readonly type: "function";
992
- }, {
993
- readonly anonymous: false;
994
- readonly inputs: readonly [{
995
- readonly indexed: true;
996
- readonly internalType: "address";
997
- readonly name: "owner";
998
- readonly type: "address";
999
- }, {
1000
- readonly indexed: true;
1001
- readonly internalType: "address";
1002
- readonly name: "spender";
1003
- readonly type: "address";
1004
- }, {
1005
- readonly indexed: false;
1006
- readonly internalType: "uint256";
1007
- readonly name: "amount";
1008
- readonly type: "uint256";
1009
- }];
1010
- readonly name: "Approval";
1011
- readonly type: "event";
1012
992
  }, {
1013
993
  readonly inputs: readonly [{
1014
994
  readonly internalType: "address";
@@ -1 +1 @@
1
- {"version":3,"file":"Comet.d.ts","sourceRoot":"","sources":["../../../src/abis/compound-v3/Comet.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2wDX,CAAA"}
@@ -1292,31 +1292,6 @@ export const CometAbi = [
1292
1292
  "stateMutability": "nonpayable",
1293
1293
  "type": "function"
1294
1294
  },
1295
- {
1296
- "anonymous": false,
1297
- "inputs": [
1298
- {
1299
- "indexed": true,
1300
- "internalType": "address",
1301
- "name": "owner",
1302
- "type": "address"
1303
- },
1304
- {
1305
- "indexed": true,
1306
- "internalType": "address",
1307
- "name": "spender",
1308
- "type": "address"
1309
- },
1310
- {
1311
- "indexed": false,
1312
- "internalType": "uint256",
1313
- "name": "amount",
1314
- "type": "uint256"
1315
- }
1316
- ],
1317
- "name": "Approval",
1318
- "type": "event"
1319
- },
1320
1295
  {
1321
1296
  "inputs": [
1322
1297
  {
@@ -26,4 +26,14 @@ export declare function meetsLiquidityThresholds(pool: {
26
26
  totalDebtUSD: number;
27
27
  totalLiquidityUSD: number;
28
28
  }, thresholds: LiquidityThresholds): boolean;
29
+ export declare function meetsLiquidityThresholdsLong(pool: {
30
+ totalDepositsUSD: number;
31
+ totalDebtUSD: number;
32
+ totalLiquidityUSD: number;
33
+ }, thresholds: LiquidityThresholds): boolean;
34
+ export declare function meetsLiquidityThresholdsShort(pool: {
35
+ totalDepositsUSD: number;
36
+ totalDebtUSD: number;
37
+ totalLiquidityUSD: number;
38
+ }, thresholds: LiquidityThresholds): boolean;
29
39
  //# sourceMappingURL=liquidityThresholds.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"liquidityThresholds.d.ts","sourceRoot":"","sources":["../../src/assets/liquidityThresholds.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,oCAAoC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,4BAA4B,EAAE,mBAI1C,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE;IAAE,CAAC,UAAU,EAAE,MAAM,GAAG,mBAAmB,CAAA;CAMzF,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;CAWpE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,CAAA;CAEhF,CAAC;AAKF,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,UAAU,CAAC,EAAC,MAAM,GACjB,mBAAmB,CAkBrB;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,EACnF,UAAU,EAAE,mBAAmB,GAC9B,OAAO,CAMT"}
1
+ {"version":3,"file":"liquidityThresholds.d.ts","sourceRoot":"","sources":["../../src/assets/liquidityThresholds.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,oCAAoC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,eAAe,EA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000,
5
+ minLiquidityUSD: 15_000,
6
6
  };
7
7
  export const ASSET_GROUP_LIQUIDITY_THRESHOLDS = {
8
8
  'USDC': {
@@ -49,3 +49,10 @@ export function meetsLiquidityThresholds(pool, thresholds) {
49
49
  pool.totalDebtUSD >= thresholds.minDebtUSD &&
50
50
  pool.totalLiquidityUSD >= thresholds.minLiquidityUSD);
51
51
  }
52
+ export function meetsLiquidityThresholdsLong(pool, thresholds) {
53
+ return (pool.totalDepositsUSD >= thresholds.minDepositsUSD);
54
+ }
55
+ export function meetsLiquidityThresholdsShort(pool, thresholds) {
56
+ return (pool.totalDebtUSD >= thresholds.minDebtUSD &&
57
+ pool.totalLiquidityUSD >= thresholds.minLiquidityUSD);
58
+ }
@@ -1,4 +1,4 @@
1
- import { MulticallRetryFunction } from "../types";
2
- import { FlashLiquiditiesOnChain } from "./types";
1
+ import { MulticallRetryFunction } from '../types';
2
+ import { FlashLiquiditiesOnChain } from './types';
3
3
  export declare function fetchFlashLiquidityForChain(chain: string, multicallRetry: MulticallRetryFunction): Promise<FlashLiquiditiesOnChain>;
4
4
  //# sourceMappingURL=fetchLiquidity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetchLiquidity.d.ts","sourceRoot":"","sources":["../../src/flash-liquidity/fetchLiquidity.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAAE,uBAAuB,EAAgB,MAAM,SAAS,CAAC;AAoBhE,wBAAsB,2BAA2B,CAC7C,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,sBAAsB,oCAyQzC"}
1
+ {"version":3,"file":"fetchLiquidity.d.ts","sourceRoot":"","sources":["../../src/flash-liquidity/fetchLiquidity.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAEjD,OAAO,EAAE,uBAAuB,EAAgB,MAAM,SAAS,CAAA;AAsB/D,wBAAsB,2BAA2B,CAC/C,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,sBAAsB,oCAwSvC"}