impermax-sdk 1.0.0

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 (103) hide show
  1. package/.idea/impermax-sdk.iml +12 -0
  2. package/.idea/misc.xml +6 -0
  3. package/.idea/modules.xml +8 -0
  4. package/.idea/workspace.xml +642 -0
  5. package/abis/ImpermaxABI.ts +3 -0
  6. package/abis/contracts/BAllowance.json +4735 -0
  7. package/abis/contracts/BDeployer.json +1195 -0
  8. package/abis/contracts/BInterestRateModel.json +10796 -0
  9. package/abis/contracts/BSetter.json +6219 -0
  10. package/abis/contracts/BStorage.json +2613 -0
  11. package/abis/contracts/Borrowable.json +19937 -0
  12. package/abis/contracts/CDeployer.json +1104 -0
  13. package/abis/contracts/CSetter.json +5094 -0
  14. package/abis/contracts/CStorage.json +516 -0
  15. package/abis/contracts/ClaimAggregator.json +2015 -0
  16. package/abis/contracts/Collateral.json +21615 -0
  17. package/abis/contracts/ERC20.json +819 -0
  18. package/abis/contracts/Factory.json +21986 -0
  19. package/abis/contracts/FarmingPool.json +8601 -0
  20. package/abis/contracts/IBDeployer.json +351 -0
  21. package/abis/contracts/IBorrowTracker.json +346 -0
  22. package/abis/contracts/IBorrowable.json +13207 -0
  23. package/abis/contracts/ICDeployer.json +294 -0
  24. package/abis/contracts/IClaimable.json +406 -0
  25. package/abis/contracts/ICollateral.json +8952 -0
  26. package/abis/contracts/IERC20.json +2376 -0
  27. package/abis/contracts/IFactory.json +3660 -0
  28. package/abis/contracts/IFarmingPool.json +3584 -0
  29. package/abis/contracts/IImpermaxCallee.json +679 -0
  30. package/abis/contracts/IMerkleDistributor.json +1134 -0
  31. package/abis/contracts/IPoolToken.json +5343 -0
  32. package/abis/contracts/IRouter01.json +6891 -0
  33. package/abis/contracts/IRouter02.json +7283 -0
  34. package/abis/contracts/ISimpleUniswapOracle.json +1469 -0
  35. package/abis/contracts/IStakedLPToken.json +7309 -0
  36. package/abis/contracts/IStakingRewards.json +1036 -0
  37. package/abis/contracts/IUniswapV2Callee.json +403 -0
  38. package/abis/contracts/IUniswapV2ERC20.json +3155 -0
  39. package/abis/contracts/IUniswapV2Factory.json +1690 -0
  40. package/abis/contracts/IUniswapV2Pair.json +6761 -0
  41. package/abis/contracts/IWETH.json +561 -0
  42. package/abis/contracts/ImpermaxChef.json +20945 -0
  43. package/abis/contracts/ImpermaxERC20.json +12095 -0
  44. package/abis/contracts/Math.json +1966 -0
  45. package/abis/contracts/MockERC20.json +8884 -0
  46. package/abis/contracts/PoolToken.json +10784 -0
  47. package/abis/contracts/Router01.json +43963 -0
  48. package/abis/contracts/SafeMath.json +6828 -0
  49. package/abis/contracts/SimpleUniswapOracle.json +9640 -0
  50. package/abis/contracts/TransferHelper.json +4875 -0
  51. package/abis/contracts/UQ112x112.json +1201 -0
  52. package/abis/contracts/UniswapV2ERC20.json +10969 -0
  53. package/abis/contracts/UniswapV2Factory.json +5521 -0
  54. package/abis/contracts/UniswapV2Library.json +13789 -0
  55. package/abis/contracts/UniswapV2Pair.json +30782 -0
  56. package/abis/contracts/WETH9.json +6613 -0
  57. package/config/amms.ts +199 -0
  58. package/config/contracts/claim-aggregators.ts +16 -0
  59. package/config/contracts/impermax-chef.ts +16 -0
  60. package/config/contracts/imxes.ts +16 -0
  61. package/config/contracts/merkle-distributors.ts +13 -0
  62. package/config/contracts/routers.ts +36 -0
  63. package/config/contracts/simple-uniswap-oracles.ts +33 -0
  64. package/config/contracts/weths.ts +18 -0
  65. package/config/debank-ids.ts +15 -0
  66. package/config/endpoints/merkle-distributors.ts +13 -0
  67. package/config/eth.ts +32 -0
  68. package/config/factories.ts +26 -0
  69. package/config/farms.ts +119 -0
  70. package/config/general.ts +8 -0
  71. package/config/subgraphs.ts +69 -0
  72. package/config/types.ts +81 -0
  73. package/impermax-router/Account.ts +123 -0
  74. package/impermax-router/AccountBorrowable.ts +110 -0
  75. package/impermax-router/AccountCollateral.ts +40 -0
  76. package/impermax-router/AccountLendingPool.ts +231 -0
  77. package/impermax-router/AccountPoolToken.ts +76 -0
  78. package/impermax-router/Borrowable.ts +86 -0
  79. package/impermax-router/Collateral.ts +26 -0
  80. package/impermax-router/ContractsHelper.ts +64 -0
  81. package/impermax-router/ImpermaxFactory.ts +47 -0
  82. package/impermax-router/Interactions.ts +94 -0
  83. package/impermax-router/InteractionsLendingPool.ts +129 -0
  84. package/impermax-router/InteractionsPoolToken.ts +187 -0
  85. package/impermax-router/LendingPool.ts +256 -0
  86. package/impermax-router/PoolToken.ts +112 -0
  87. package/impermax-router/index.ts +49 -0
  88. package/impermax-router/interfaces.ts +233 -0
  89. package/index.ts +5 -0
  90. package/package.json +23 -0
  91. package/subgraph/Account.ts +93 -0
  92. package/subgraph/AccountLendingPool.ts +60 -0
  93. package/subgraph/AccountPoolToken.ts +60 -0
  94. package/subgraph/LendingPool.ts +179 -0
  95. package/subgraph/PoolToken.ts +381 -0
  96. package/subgraph/PriceHelper.ts +150 -0
  97. package/subgraph/SolidexHelper.ts +54 -0
  98. package/subgraph/index.ts +166 -0
  99. package/subgraph/initializer.ts +509 -0
  100. package/subgraph/query.ts +224 -0
  101. package/tsconfig.json +16 -0
  102. package/utils/ether-utils.ts +22 -0
  103. package/utils/index.ts +12 -0
@@ -0,0 +1,346 @@
1
+ {
2
+ "contractName": "IBorrowTracker",
3
+ "abi": [
4
+ {
5
+ "constant": false,
6
+ "inputs": [
7
+ {
8
+ "internalType": "address",
9
+ "name": "borrower",
10
+ "type": "address"
11
+ },
12
+ {
13
+ "internalType": "uint256",
14
+ "name": "borrowBalance",
15
+ "type": "uint256"
16
+ },
17
+ {
18
+ "internalType": "uint256",
19
+ "name": "borrowIndex",
20
+ "type": "uint256"
21
+ }
22
+ ],
23
+ "name": "trackBorrow",
24
+ "outputs": [],
25
+ "payable": false,
26
+ "stateMutability": "nonpayable",
27
+ "type": "function"
28
+ }
29
+ ],
30
+ "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"borrower\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"borrowBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"borrowIndex\",\"type\":\"uint256\"}],\"name\":\"trackBorrow\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/test/Contracts/imx-univ2-core/interfaces/IBorrowTracker.sol\":\"IBorrowTracker\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/test/Contracts/imx-univ2-core/interfaces/IBorrowTracker.sol\":{\"keccak256\":\"0xc2ddd380effc1179ff0ca88f4733113ff8ab9b7317e75483df57abc2f4dfab0b\",\"urls\":[\"bzz-raw://3bde59cee4b505dc0ed83cc67e6a26a530b08dfe02bdaf9a8da096576a630ff5\",\"dweb:/ipfs/QmNdnZBVo4eWPirmUU8AhoC5adUbS2xferbeBi1AZkaLtW\"]}},\"version\":1}",
31
+ "bytecode": "0x",
32
+ "deployedBytecode": "0x",
33
+ "sourceMap": "",
34
+ "deployedSourceMap": "",
35
+ "source": "pragma solidity >=0.5.0;\r\n\r\ninterface IBorrowTracker {\r\n\tfunction trackBorrow(address borrower, uint borrowBalance, uint borrowIndex) external;\r\n}",
36
+ "sourcePath": "C:\\Users\\simor\\Desktop\\impermax-x-uniswapv2-periphery\\test\\Contracts\\imx-univ2-core\\interfaces\\IBorrowTracker.sol",
37
+ "ast": {
38
+ "absolutePath": "/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/test/Contracts/imx-univ2-core/interfaces/IBorrowTracker.sol",
39
+ "exportedSymbols": {
40
+ "IBorrowTracker": [
41
+ 4944
42
+ ]
43
+ },
44
+ "id": 4945,
45
+ "nodeType": "SourceUnit",
46
+ "nodes": [
47
+ {
48
+ "id": 4934,
49
+ "literals": [
50
+ "solidity",
51
+ ">=",
52
+ "0.5",
53
+ ".0"
54
+ ],
55
+ "nodeType": "PragmaDirective",
56
+ "src": "0:24:18"
57
+ },
58
+ {
59
+ "baseContracts": [],
60
+ "contractDependencies": [],
61
+ "contractKind": "interface",
62
+ "documentation": null,
63
+ "fullyImplemented": false,
64
+ "id": 4944,
65
+ "linearizedBaseContracts": [
66
+ 4944
67
+ ],
68
+ "name": "IBorrowTracker",
69
+ "nodeType": "ContractDefinition",
70
+ "nodes": [
71
+ {
72
+ "body": null,
73
+ "documentation": null,
74
+ "id": 4943,
75
+ "implemented": false,
76
+ "kind": "function",
77
+ "modifiers": [],
78
+ "name": "trackBorrow",
79
+ "nodeType": "FunctionDefinition",
80
+ "parameters": {
81
+ "id": 4941,
82
+ "nodeType": "ParameterList",
83
+ "parameters": [
84
+ {
85
+ "constant": false,
86
+ "id": 4936,
87
+ "name": "borrower",
88
+ "nodeType": "VariableDeclaration",
89
+ "scope": 4943,
90
+ "src": "78:16:18",
91
+ "stateVariable": false,
92
+ "storageLocation": "default",
93
+ "typeDescriptions": {
94
+ "typeIdentifier": "t_address",
95
+ "typeString": "address"
96
+ },
97
+ "typeName": {
98
+ "id": 4935,
99
+ "name": "address",
100
+ "nodeType": "ElementaryTypeName",
101
+ "src": "78:7:18",
102
+ "stateMutability": "nonpayable",
103
+ "typeDescriptions": {
104
+ "typeIdentifier": "t_address",
105
+ "typeString": "address"
106
+ }
107
+ },
108
+ "value": null,
109
+ "visibility": "internal"
110
+ },
111
+ {
112
+ "constant": false,
113
+ "id": 4938,
114
+ "name": "borrowBalance",
115
+ "nodeType": "VariableDeclaration",
116
+ "scope": 4943,
117
+ "src": "96:18:18",
118
+ "stateVariable": false,
119
+ "storageLocation": "default",
120
+ "typeDescriptions": {
121
+ "typeIdentifier": "t_uint256",
122
+ "typeString": "uint256"
123
+ },
124
+ "typeName": {
125
+ "id": 4937,
126
+ "name": "uint",
127
+ "nodeType": "ElementaryTypeName",
128
+ "src": "96:4:18",
129
+ "typeDescriptions": {
130
+ "typeIdentifier": "t_uint256",
131
+ "typeString": "uint256"
132
+ }
133
+ },
134
+ "value": null,
135
+ "visibility": "internal"
136
+ },
137
+ {
138
+ "constant": false,
139
+ "id": 4940,
140
+ "name": "borrowIndex",
141
+ "nodeType": "VariableDeclaration",
142
+ "scope": 4943,
143
+ "src": "116:16:18",
144
+ "stateVariable": false,
145
+ "storageLocation": "default",
146
+ "typeDescriptions": {
147
+ "typeIdentifier": "t_uint256",
148
+ "typeString": "uint256"
149
+ },
150
+ "typeName": {
151
+ "id": 4939,
152
+ "name": "uint",
153
+ "nodeType": "ElementaryTypeName",
154
+ "src": "116:4:18",
155
+ "typeDescriptions": {
156
+ "typeIdentifier": "t_uint256",
157
+ "typeString": "uint256"
158
+ }
159
+ },
160
+ "value": null,
161
+ "visibility": "internal"
162
+ }
163
+ ],
164
+ "src": "77:56:18"
165
+ },
166
+ "returnParameters": {
167
+ "id": 4942,
168
+ "nodeType": "ParameterList",
169
+ "parameters": [],
170
+ "src": "142:0:18"
171
+ },
172
+ "scope": 4944,
173
+ "src": "57:86:18",
174
+ "stateMutability": "nonpayable",
175
+ "superFunction": null,
176
+ "visibility": "external"
177
+ }
178
+ ],
179
+ "scope": 4945,
180
+ "src": "28:118:18"
181
+ }
182
+ ],
183
+ "src": "0:146:18"
184
+ },
185
+ "legacyAST": {
186
+ "absolutePath": "/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/test/Contracts/imx-univ2-core/interfaces/IBorrowTracker.sol",
187
+ "exportedSymbols": {
188
+ "IBorrowTracker": [
189
+ 4944
190
+ ]
191
+ },
192
+ "id": 4945,
193
+ "nodeType": "SourceUnit",
194
+ "nodes": [
195
+ {
196
+ "id": 4934,
197
+ "literals": [
198
+ "solidity",
199
+ ">=",
200
+ "0.5",
201
+ ".0"
202
+ ],
203
+ "nodeType": "PragmaDirective",
204
+ "src": "0:24:18"
205
+ },
206
+ {
207
+ "baseContracts": [],
208
+ "contractDependencies": [],
209
+ "contractKind": "interface",
210
+ "documentation": null,
211
+ "fullyImplemented": false,
212
+ "id": 4944,
213
+ "linearizedBaseContracts": [
214
+ 4944
215
+ ],
216
+ "name": "IBorrowTracker",
217
+ "nodeType": "ContractDefinition",
218
+ "nodes": [
219
+ {
220
+ "body": null,
221
+ "documentation": null,
222
+ "id": 4943,
223
+ "implemented": false,
224
+ "kind": "function",
225
+ "modifiers": [],
226
+ "name": "trackBorrow",
227
+ "nodeType": "FunctionDefinition",
228
+ "parameters": {
229
+ "id": 4941,
230
+ "nodeType": "ParameterList",
231
+ "parameters": [
232
+ {
233
+ "constant": false,
234
+ "id": 4936,
235
+ "name": "borrower",
236
+ "nodeType": "VariableDeclaration",
237
+ "scope": 4943,
238
+ "src": "78:16:18",
239
+ "stateVariable": false,
240
+ "storageLocation": "default",
241
+ "typeDescriptions": {
242
+ "typeIdentifier": "t_address",
243
+ "typeString": "address"
244
+ },
245
+ "typeName": {
246
+ "id": 4935,
247
+ "name": "address",
248
+ "nodeType": "ElementaryTypeName",
249
+ "src": "78:7:18",
250
+ "stateMutability": "nonpayable",
251
+ "typeDescriptions": {
252
+ "typeIdentifier": "t_address",
253
+ "typeString": "address"
254
+ }
255
+ },
256
+ "value": null,
257
+ "visibility": "internal"
258
+ },
259
+ {
260
+ "constant": false,
261
+ "id": 4938,
262
+ "name": "borrowBalance",
263
+ "nodeType": "VariableDeclaration",
264
+ "scope": 4943,
265
+ "src": "96:18:18",
266
+ "stateVariable": false,
267
+ "storageLocation": "default",
268
+ "typeDescriptions": {
269
+ "typeIdentifier": "t_uint256",
270
+ "typeString": "uint256"
271
+ },
272
+ "typeName": {
273
+ "id": 4937,
274
+ "name": "uint",
275
+ "nodeType": "ElementaryTypeName",
276
+ "src": "96:4:18",
277
+ "typeDescriptions": {
278
+ "typeIdentifier": "t_uint256",
279
+ "typeString": "uint256"
280
+ }
281
+ },
282
+ "value": null,
283
+ "visibility": "internal"
284
+ },
285
+ {
286
+ "constant": false,
287
+ "id": 4940,
288
+ "name": "borrowIndex",
289
+ "nodeType": "VariableDeclaration",
290
+ "scope": 4943,
291
+ "src": "116:16:18",
292
+ "stateVariable": false,
293
+ "storageLocation": "default",
294
+ "typeDescriptions": {
295
+ "typeIdentifier": "t_uint256",
296
+ "typeString": "uint256"
297
+ },
298
+ "typeName": {
299
+ "id": 4939,
300
+ "name": "uint",
301
+ "nodeType": "ElementaryTypeName",
302
+ "src": "116:4:18",
303
+ "typeDescriptions": {
304
+ "typeIdentifier": "t_uint256",
305
+ "typeString": "uint256"
306
+ }
307
+ },
308
+ "value": null,
309
+ "visibility": "internal"
310
+ }
311
+ ],
312
+ "src": "77:56:18"
313
+ },
314
+ "returnParameters": {
315
+ "id": 4942,
316
+ "nodeType": "ParameterList",
317
+ "parameters": [],
318
+ "src": "142:0:18"
319
+ },
320
+ "scope": 4944,
321
+ "src": "57:86:18",
322
+ "stateMutability": "nonpayable",
323
+ "superFunction": null,
324
+ "visibility": "external"
325
+ }
326
+ ],
327
+ "scope": 4945,
328
+ "src": "28:118:18"
329
+ }
330
+ ],
331
+ "src": "0:146:18"
332
+ },
333
+ "compiler": {
334
+ "name": "solc",
335
+ "version": "0.5.16+commit.9c3226ce.Emscripten.clang"
336
+ },
337
+ "networks": {},
338
+ "schemaVersion": "3.3.2",
339
+ "updatedAt": "2021-01-07T23:07:24.814Z",
340
+ "devdoc": {
341
+ "methods": {}
342
+ },
343
+ "userdoc": {
344
+ "methods": {}
345
+ }
346
+ }