@curvefi/llamalend-api 1.0.2

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 (125) hide show
  1. package/.eslintrc.json +40 -0
  2. package/.github/workflows/lint.yml +15 -0
  3. package/.github/workflows/publish.yml +55 -0
  4. package/LICENSE +21 -0
  5. package/README.md +1976 -0
  6. package/lib/cache/index.d.ts +14 -0
  7. package/lib/cache/index.js +31 -0
  8. package/lib/constants/L2Networks.d.ts +1 -0
  9. package/lib/constants/L2Networks.js +1 -0
  10. package/lib/constants/abis/Controller.json +1027 -0
  11. package/lib/constants/abis/ERC20.json +222 -0
  12. package/lib/constants/abis/ERC4626.json +1674 -0
  13. package/lib/constants/abis/GaugeController.json +794 -0
  14. package/lib/constants/abis/GaugeFactoryMainnet.json +1 -0
  15. package/lib/constants/abis/GaugeFactorySidechain.json +475 -0
  16. package/lib/constants/abis/GaugeV5.json +958 -0
  17. package/lib/constants/abis/LeverageZap.json +35 -0
  18. package/lib/constants/abis/Llamma.json +984 -0
  19. package/lib/constants/abis/Minter.json +1 -0
  20. package/lib/constants/abis/MonetaryPolicy.json +221 -0
  21. package/lib/constants/abis/OneWayLendingFactoryABI.json +899 -0
  22. package/lib/constants/abis/SidechainGauge.json +939 -0
  23. package/lib/constants/abis/Vault.json +721 -0
  24. package/lib/constants/abis/crvUSD/DeleverageZap.json +248 -0
  25. package/lib/constants/abis/crvUSD/Factory.json +514 -0
  26. package/lib/constants/abis/crvUSD/HealthCalculatorZap.json +54 -0
  27. package/lib/constants/abis/crvUSD/LeverageZap.json +312 -0
  28. package/lib/constants/abis/crvUSD/MonetaryPolicy.json +294 -0
  29. package/lib/constants/abis/crvUSD/MonetaryPolicy2.json +299 -0
  30. package/lib/constants/abis/crvUSD/PegKeeper.json +411 -0
  31. package/lib/constants/abis/crvUSD/controller.json +991 -0
  32. package/lib/constants/abis/crvUSD/llamma.json +984 -0
  33. package/lib/constants/abis/gas_oracle_optimism.json +149 -0
  34. package/lib/constants/abis/gas_oracle_optimism_blob.json +203 -0
  35. package/lib/constants/aliases.d.ts +16 -0
  36. package/lib/constants/aliases.js +124 -0
  37. package/lib/constants/coins.d.ts +16 -0
  38. package/lib/constants/coins.js +24 -0
  39. package/lib/constants/llammas.d.ts +2 -0
  40. package/lib/constants/llammas.js +96 -0
  41. package/lib/constants/utils.d.ts +4 -0
  42. package/lib/constants/utils.js +27 -0
  43. package/lib/external-api.d.ts +13 -0
  44. package/lib/external-api.js +436 -0
  45. package/lib/index.d.ts +104 -0
  46. package/lib/index.js +123 -0
  47. package/lib/interfaces.d.ts +228 -0
  48. package/lib/interfaces.js +1 -0
  49. package/lib/lendMarkets/LendMarketTemplate.d.ts +510 -0
  50. package/lib/lendMarkets/LendMarketTemplate.js +4682 -0
  51. package/lib/lendMarkets/index.d.ts +3 -0
  52. package/lib/lendMarkets/index.js +3 -0
  53. package/lib/lendMarkets/lendMarketConstructor.d.ts +2 -0
  54. package/lib/lendMarkets/lendMarketConstructor.js +6 -0
  55. package/lib/llamalend.d.ts +80 -0
  56. package/lib/llamalend.js +878 -0
  57. package/lib/mintMarkets/MintMarketTemplate.d.ts +308 -0
  58. package/lib/mintMarkets/MintMarketTemplate.js +2998 -0
  59. package/lib/mintMarkets/index.d.ts +3 -0
  60. package/lib/mintMarkets/index.js +3 -0
  61. package/lib/mintMarkets/mintMarketConstructor.d.ts +2 -0
  62. package/lib/mintMarkets/mintMarketConstructor.js +4 -0
  63. package/lib/st-crvUSD.d.ts +35 -0
  64. package/lib/st-crvUSD.js +505 -0
  65. package/lib/utils.d.ts +58 -0
  66. package/lib/utils.js +661 -0
  67. package/package.json +42 -0
  68. package/src/cache/index.ts +41 -0
  69. package/src/constants/L2Networks.ts +1 -0
  70. package/src/constants/abis/Controller.json +1027 -0
  71. package/src/constants/abis/ERC20.json +222 -0
  72. package/src/constants/abis/ERC4626.json +1674 -0
  73. package/src/constants/abis/GaugeController.json +794 -0
  74. package/src/constants/abis/GaugeFactoryMainnet.json +1 -0
  75. package/src/constants/abis/GaugeFactorySidechain.json +475 -0
  76. package/src/constants/abis/GaugeV5.json +958 -0
  77. package/src/constants/abis/LeverageZap.json +35 -0
  78. package/src/constants/abis/Llamma.json +984 -0
  79. package/src/constants/abis/Minter.json +1 -0
  80. package/src/constants/abis/MonetaryPolicy.json +221 -0
  81. package/src/constants/abis/OneWayLendingFactoryABI.json +899 -0
  82. package/src/constants/abis/SidechainGauge.json +939 -0
  83. package/src/constants/abis/Vault.json +721 -0
  84. package/src/constants/abis/crvUSD/DeleverageZap.json +248 -0
  85. package/src/constants/abis/crvUSD/ERC20.json +222 -0
  86. package/src/constants/abis/crvUSD/Factory.json +514 -0
  87. package/src/constants/abis/crvUSD/HealthCalculatorZap.json +54 -0
  88. package/src/constants/abis/crvUSD/LeverageZap.json +312 -0
  89. package/src/constants/abis/crvUSD/MonetaryPolicy.json +294 -0
  90. package/src/constants/abis/crvUSD/MonetaryPolicy2.json +299 -0
  91. package/src/constants/abis/crvUSD/PegKeeper.json +411 -0
  92. package/src/constants/abis/crvUSD/controller.json +991 -0
  93. package/src/constants/abis/crvUSD/llamma.json +984 -0
  94. package/src/constants/abis/gas_oracle_optimism.json +149 -0
  95. package/src/constants/abis/gas_oracle_optimism_blob.json +203 -0
  96. package/src/constants/aliases.ts +141 -0
  97. package/src/constants/coins.ts +41 -0
  98. package/src/constants/llammas.ts +99 -0
  99. package/src/constants/utils.ts +33 -0
  100. package/src/external-api.ts +325 -0
  101. package/src/index.ts +128 -0
  102. package/src/interfaces.ts +237 -0
  103. package/src/lendMarkets/LendMarketTemplate.ts +3022 -0
  104. package/src/lendMarkets/index.ts +7 -0
  105. package/src/lendMarkets/lendMarketConstructor.ts +7 -0
  106. package/src/llamalend.ts +785 -0
  107. package/src/mintMarkets/MintMarketTemplate.ts +1781 -0
  108. package/src/mintMarkets/index.ts +7 -0
  109. package/src/mintMarkets/mintMarketConstructor.ts +5 -0
  110. package/src/st-crvUSD.ts +244 -0
  111. package/src/utils.ts +497 -0
  112. package/test/fetch.test.ts +152 -0
  113. package/test/general.test.ts +216 -0
  114. package/test/leverageBorrowMore.test.ts +245 -0
  115. package/test/leverageCreateLoan.test.ts +236 -0
  116. package/test/leverageRepay.test.ts +240 -0
  117. package/test/readme.test.ts +475 -0
  118. package/test/selfLiquidate.test.ts +57 -0
  119. package/test/selfLiquidateCrvUSD.test.ts +54 -0
  120. package/test/st_crvUSD.test.ts +68 -0
  121. package/test/swap.test.ts +62 -0
  122. package/test/swapCrvUSD.test.ts +56 -0
  123. package/test/vault.test.ts +112 -0
  124. package/tsconfig.build.json +10 -0
  125. package/tsconfig.json +72 -0
@@ -0,0 +1,1027 @@
1
+ [
2
+ {
3
+ "anonymous": false,
4
+ "inputs": [
5
+ {
6
+ "indexed": true,
7
+ "name": "user",
8
+ "type": "address"
9
+ },
10
+ {
11
+ "indexed": false,
12
+ "name": "collateral",
13
+ "type": "uint256"
14
+ },
15
+ {
16
+ "indexed": false,
17
+ "name": "debt",
18
+ "type": "uint256"
19
+ },
20
+ {
21
+ "indexed": false,
22
+ "name": "n1",
23
+ "type": "int256"
24
+ },
25
+ {
26
+ "indexed": false,
27
+ "name": "n2",
28
+ "type": "int256"
29
+ },
30
+ {
31
+ "indexed": false,
32
+ "name": "liquidation_discount",
33
+ "type": "uint256"
34
+ }
35
+ ],
36
+ "name": "UserState",
37
+ "type": "event"
38
+ },
39
+ {
40
+ "anonymous": false,
41
+ "inputs": [
42
+ {
43
+ "indexed": true,
44
+ "name": "user",
45
+ "type": "address"
46
+ },
47
+ {
48
+ "indexed": false,
49
+ "name": "collateral_increase",
50
+ "type": "uint256"
51
+ },
52
+ {
53
+ "indexed": false,
54
+ "name": "loan_increase",
55
+ "type": "uint256"
56
+ }
57
+ ],
58
+ "name": "Borrow",
59
+ "type": "event"
60
+ },
61
+ {
62
+ "anonymous": false,
63
+ "inputs": [
64
+ {
65
+ "indexed": true,
66
+ "name": "user",
67
+ "type": "address"
68
+ },
69
+ {
70
+ "indexed": false,
71
+ "name": "collateral_decrease",
72
+ "type": "uint256"
73
+ },
74
+ {
75
+ "indexed": false,
76
+ "name": "loan_decrease",
77
+ "type": "uint256"
78
+ }
79
+ ],
80
+ "name": "Repay",
81
+ "type": "event"
82
+ },
83
+ {
84
+ "anonymous": false,
85
+ "inputs": [
86
+ {
87
+ "indexed": true,
88
+ "name": "user",
89
+ "type": "address"
90
+ },
91
+ {
92
+ "indexed": false,
93
+ "name": "collateral_decrease",
94
+ "type": "uint256"
95
+ }
96
+ ],
97
+ "name": "RemoveCollateral",
98
+ "type": "event"
99
+ },
100
+ {
101
+ "anonymous": false,
102
+ "inputs": [
103
+ {
104
+ "indexed": true,
105
+ "name": "liquidator",
106
+ "type": "address"
107
+ },
108
+ {
109
+ "indexed": true,
110
+ "name": "user",
111
+ "type": "address"
112
+ },
113
+ {
114
+ "indexed": false,
115
+ "name": "collateral_received",
116
+ "type": "uint256"
117
+ },
118
+ {
119
+ "indexed": false,
120
+ "name": "stablecoin_received",
121
+ "type": "uint256"
122
+ },
123
+ {
124
+ "indexed": false,
125
+ "name": "debt",
126
+ "type": "uint256"
127
+ }
128
+ ],
129
+ "name": "Liquidate",
130
+ "type": "event"
131
+ },
132
+ {
133
+ "anonymous": false,
134
+ "inputs": [
135
+ {
136
+ "indexed": false,
137
+ "name": "monetary_policy",
138
+ "type": "address"
139
+ }
140
+ ],
141
+ "name": "SetMonetaryPolicy",
142
+ "type": "event"
143
+ },
144
+ {
145
+ "anonymous": false,
146
+ "inputs": [
147
+ {
148
+ "indexed": false,
149
+ "name": "loan_discount",
150
+ "type": "uint256"
151
+ },
152
+ {
153
+ "indexed": false,
154
+ "name": "liquidation_discount",
155
+ "type": "uint256"
156
+ }
157
+ ],
158
+ "name": "SetBorrowingDiscounts",
159
+ "type": "event"
160
+ },
161
+ {
162
+ "anonymous": false,
163
+ "inputs": [
164
+ {
165
+ "indexed": false,
166
+ "name": "amount",
167
+ "type": "uint256"
168
+ },
169
+ {
170
+ "indexed": false,
171
+ "name": "new_supply",
172
+ "type": "uint256"
173
+ }
174
+ ],
175
+ "name": "CollectFees",
176
+ "type": "event"
177
+ },
178
+ {
179
+ "inputs": [
180
+ {
181
+ "name": "collateral_token",
182
+ "type": "address"
183
+ },
184
+ {
185
+ "name": "monetary_policy",
186
+ "type": "address"
187
+ },
188
+ {
189
+ "name": "loan_discount",
190
+ "type": "uint256"
191
+ },
192
+ {
193
+ "name": "liquidation_discount",
194
+ "type": "uint256"
195
+ },
196
+ {
197
+ "name": "amm",
198
+ "type": "address"
199
+ }
200
+ ],
201
+ "name": "constructor",
202
+ "outputs": [],
203
+ "stateMutability": "nonpayable",
204
+ "type": "constructor"
205
+ },
206
+ {
207
+ "stateMutability": "payable",
208
+ "type": "fallback"
209
+ },
210
+ {
211
+ "inputs": [],
212
+ "name": "factory",
213
+ "outputs": [
214
+ {
215
+ "name": "",
216
+ "type": "address"
217
+ }
218
+ ],
219
+ "stateMutability": "view",
220
+ "type": "function"
221
+ },
222
+ {
223
+ "inputs": [],
224
+ "name": "amm",
225
+ "outputs": [
226
+ {
227
+ "name": "",
228
+ "type": "address"
229
+ }
230
+ ],
231
+ "stateMutability": "view",
232
+ "type": "function"
233
+ },
234
+ {
235
+ "inputs": [],
236
+ "name": "collateral_token",
237
+ "outputs": [
238
+ {
239
+ "name": "",
240
+ "type": "address"
241
+ }
242
+ ],
243
+ "stateMutability": "view",
244
+ "type": "function"
245
+ },
246
+ {
247
+ "inputs": [
248
+ {
249
+ "name": "user",
250
+ "type": "address"
251
+ }
252
+ ],
253
+ "name": "debt",
254
+ "outputs": [
255
+ {
256
+ "name": "",
257
+ "type": "uint256"
258
+ }
259
+ ],
260
+ "stateMutability": "view",
261
+ "type": "function"
262
+ },
263
+ {
264
+ "inputs": [
265
+ {
266
+ "name": "user",
267
+ "type": "address"
268
+ }
269
+ ],
270
+ "name": "loan_exists",
271
+ "outputs": [
272
+ {
273
+ "name": "",
274
+ "type": "bool"
275
+ }
276
+ ],
277
+ "stateMutability": "view",
278
+ "type": "function"
279
+ },
280
+ {
281
+ "inputs": [],
282
+ "name": "total_debt",
283
+ "outputs": [
284
+ {
285
+ "name": "",
286
+ "type": "uint256"
287
+ }
288
+ ],
289
+ "stateMutability": "view",
290
+ "type": "function"
291
+ },
292
+ {
293
+ "inputs": [
294
+ {
295
+ "name": "collateral",
296
+ "type": "uint256"
297
+ },
298
+ {
299
+ "name": "N",
300
+ "type": "uint256"
301
+ },
302
+ {
303
+ "name": "current_debt",
304
+ "type": "uint256"
305
+ }
306
+ ],
307
+ "name": "max_borrowable",
308
+ "outputs": [
309
+ {
310
+ "name": "",
311
+ "type": "uint256"
312
+ }
313
+ ],
314
+ "stateMutability": "view",
315
+ "type": "function"
316
+ },
317
+ {
318
+ "inputs": [
319
+ {
320
+ "name": "debt",
321
+ "type": "uint256"
322
+ },
323
+ {
324
+ "name": "N",
325
+ "type": "uint256"
326
+ }
327
+ ],
328
+ "name": "min_collateral",
329
+ "outputs": [
330
+ {
331
+ "name": "",
332
+ "type": "uint256"
333
+ }
334
+ ],
335
+ "stateMutability": "view",
336
+ "type": "function"
337
+ },
338
+ {
339
+ "inputs": [
340
+ {
341
+ "name": "collateral",
342
+ "type": "uint256"
343
+ },
344
+ {
345
+ "name": "debt",
346
+ "type": "uint256"
347
+ },
348
+ {
349
+ "name": "N",
350
+ "type": "uint256"
351
+ }
352
+ ],
353
+ "name": "calculate_debt_n1",
354
+ "outputs": [
355
+ {
356
+ "name": "",
357
+ "type": "int256"
358
+ }
359
+ ],
360
+ "stateMutability": "view",
361
+ "type": "function"
362
+ },
363
+ {
364
+ "inputs": [
365
+ {
366
+ "name": "collateral",
367
+ "type": "uint256"
368
+ },
369
+ {
370
+ "name": "debt",
371
+ "type": "uint256"
372
+ },
373
+ {
374
+ "name": "N",
375
+ "type": "uint256"
376
+ }
377
+ ],
378
+ "name": "create_loan",
379
+ "outputs": [],
380
+ "stateMutability": "payable",
381
+ "type": "function"
382
+ },
383
+ {
384
+ "inputs": [
385
+ {
386
+ "name": "collateral",
387
+ "type": "uint256"
388
+ },
389
+ {
390
+ "name": "debt",
391
+ "type": "uint256"
392
+ },
393
+ {
394
+ "name": "N",
395
+ "type": "uint256"
396
+ },
397
+ {
398
+ "name": "callbacker",
399
+ "type": "address"
400
+ },
401
+ {
402
+ "name": "callback_args",
403
+ "type": "uint256[]"
404
+ },
405
+ {
406
+ "name": "callback_bytes",
407
+ "type": "bytes"
408
+ }
409
+ ],
410
+ "name": "create_loan_extended",
411
+ "outputs": [],
412
+ "stateMutability": "payable",
413
+ "type": "function"
414
+ },
415
+ {
416
+ "inputs": [
417
+ {
418
+ "name": "collateral",
419
+ "type": "uint256"
420
+ },
421
+ {
422
+ "name": "_for",
423
+ "type": "address"
424
+ }
425
+ ],
426
+ "name": "add_collateral",
427
+ "outputs": [],
428
+ "stateMutability": "payable",
429
+ "type": "function"
430
+ },
431
+ {
432
+ "inputs": [
433
+ {
434
+ "name": "collateral",
435
+ "type": "uint256"
436
+ }
437
+ ],
438
+ "name": "remove_collateral",
439
+ "outputs": [],
440
+ "stateMutability": "nonpayable",
441
+ "type": "function"
442
+ },
443
+ {
444
+ "inputs": [
445
+ {
446
+ "name": "collateral",
447
+ "type": "uint256"
448
+ },
449
+ {
450
+ "name": "debt",
451
+ "type": "uint256"
452
+ }
453
+ ],
454
+ "name": "borrow_more",
455
+ "outputs": [],
456
+ "stateMutability": "payable",
457
+ "type": "function"
458
+ },
459
+ {
460
+ "stateMutability": "nonpayable",
461
+ "type": "function",
462
+ "name": "borrow_more_extended",
463
+ "inputs": [
464
+ {
465
+ "name": "collateral",
466
+ "type": "uint256"
467
+ },
468
+ {
469
+ "name": "debt",
470
+ "type": "uint256"
471
+ },
472
+ {
473
+ "name": "callbacker",
474
+ "type": "address"
475
+ },
476
+ {
477
+ "name": "callback_args",
478
+ "type": "uint256[]"
479
+ },
480
+ {
481
+ "name": "callback_bytes",
482
+ "type": "bytes"
483
+ }
484
+ ],
485
+ "outputs": []
486
+ },
487
+ {
488
+ "stateMutability": "nonpayable",
489
+ "type": "function",
490
+ "name": "repay",
491
+ "inputs": [
492
+ {
493
+ "name": "_d_debt",
494
+ "type": "uint256"
495
+ }
496
+ ],
497
+ "outputs": []
498
+ },
499
+ {
500
+ "inputs": [
501
+ {
502
+ "name": "_d_debt",
503
+ "type": "uint256"
504
+ },
505
+ {
506
+ "name": "_for",
507
+ "type": "address"
508
+ },
509
+ {
510
+ "name": "max_active_band",
511
+ "type": "int256"
512
+ }
513
+ ],
514
+ "name": "repay",
515
+ "outputs": [],
516
+ "stateMutability": "payable",
517
+ "type": "function"
518
+ },
519
+ {
520
+ "inputs": [
521
+ {
522
+ "name": "callbacker",
523
+ "type": "address"
524
+ },
525
+ {
526
+ "name": "callback_args",
527
+ "type": "uint256[]"
528
+ },
529
+ {
530
+ "name": "callback_bytes",
531
+ "type": "bytes"
532
+ }
533
+ ],
534
+ "name": "repay_extended",
535
+ "outputs": [],
536
+ "stateMutability": "nonpayable",
537
+ "type": "function"
538
+ },
539
+ {
540
+ "inputs": [
541
+ {
542
+ "name": "user",
543
+ "type": "address"
544
+ },
545
+ {
546
+ "name": "d_collateral",
547
+ "type": "int256"
548
+ },
549
+ {
550
+ "name": "d_debt",
551
+ "type": "int256"
552
+ },
553
+ {
554
+ "name": "full",
555
+ "type": "bool"
556
+ },
557
+ {
558
+ "name": "N",
559
+ "type": "uint256"
560
+ }
561
+ ],
562
+ "name": "health_calculator",
563
+ "outputs": [
564
+ {
565
+ "name": "",
566
+ "type": "int256"
567
+ }
568
+ ],
569
+ "stateMutability": "view",
570
+ "type": "function"
571
+ },
572
+ {
573
+ "inputs": [
574
+ {
575
+ "name": "user",
576
+ "type": "address"
577
+ },
578
+ {
579
+ "name": "min_x",
580
+ "type": "uint256"
581
+ }
582
+ ],
583
+ "name": "liquidate",
584
+ "outputs": [],
585
+ "stateMutability": "nonpayable",
586
+ "type": "function"
587
+ },
588
+ {
589
+ "inputs": [
590
+ {
591
+ "name": "user",
592
+ "type": "address"
593
+ },
594
+ {
595
+ "name": "min_x",
596
+ "type": "uint256"
597
+ },
598
+ {
599
+ "name": "frac",
600
+ "type": "uint256"
601
+ },
602
+ {
603
+ "name": "callbacker",
604
+ "type": "address"
605
+ },
606
+ {
607
+ "name": "callback_args",
608
+ "type": "uint256[]"
609
+ }
610
+ ],
611
+ "name": "liquidate_extended",
612
+ "outputs": [],
613
+ "stateMutability": "nonpayable",
614
+ "type": "function"
615
+ },
616
+ {
617
+ "inputs": [
618
+ {
619
+ "name": "user",
620
+ "type": "address"
621
+ }
622
+ ],
623
+ "name": "tokens_to_liquidate",
624
+ "outputs": [
625
+ {
626
+ "name": "",
627
+ "type": "uint256"
628
+ }
629
+ ],
630
+ "stateMutability": "view",
631
+ "type": "function"
632
+ },
633
+ {
634
+ "inputs": [
635
+ {
636
+ "name": "user",
637
+ "type": "address"
638
+ },
639
+ {
640
+ "name": "full",
641
+ "type": "bool"
642
+ }
643
+ ],
644
+ "name": "health",
645
+ "outputs": [
646
+ {
647
+ "name": "",
648
+ "type": "int256"
649
+ }
650
+ ],
651
+ "stateMutability": "view",
652
+ "type": "function"
653
+ },
654
+ {
655
+ "inputs": [],
656
+ "name": "users_to_liquidate",
657
+ "outputs": [
658
+ {
659
+ "components": [
660
+ {
661
+ "name": "user",
662
+ "type": "address"
663
+ },
664
+ {
665
+ "name": "x",
666
+ "type": "uint256"
667
+ },
668
+ {
669
+ "name": "y",
670
+ "type": "uint256"
671
+ },
672
+ {
673
+ "name": "debt",
674
+ "type": "uint256"
675
+ },
676
+ {
677
+ "name": "health",
678
+ "type": "int256"
679
+ }
680
+ ],
681
+ "name": "",
682
+ "type": "tuple[]"
683
+ }
684
+ ],
685
+ "stateMutability": "view",
686
+ "type": "function"
687
+ },
688
+ {
689
+ "inputs": [
690
+ {
691
+ "name": "_from",
692
+ "type": "uint256"
693
+ }
694
+ ],
695
+ "name": "users_to_liquidate",
696
+ "outputs": [
697
+ {
698
+ "components": [
699
+ {
700
+ "name": "user",
701
+ "type": "address"
702
+ },
703
+ {
704
+ "name": "x",
705
+ "type": "uint256"
706
+ },
707
+ {
708
+ "name": "y",
709
+ "type": "uint256"
710
+ },
711
+ {
712
+ "name": "debt",
713
+ "type": "uint256"
714
+ },
715
+ {
716
+ "name": "health",
717
+ "type": "int256"
718
+ }
719
+ ],
720
+ "name": "",
721
+ "type": "tuple[]"
722
+ }
723
+ ],
724
+ "stateMutability": "view",
725
+ "type": "function"
726
+ },
727
+ {
728
+ "inputs": [
729
+ {
730
+ "name": "_from",
731
+ "type": "uint256"
732
+ },
733
+ {
734
+ "name": "_limit",
735
+ "type": "uint256"
736
+ }
737
+ ],
738
+ "name": "users_to_liquidate",
739
+ "outputs": [
740
+ {
741
+ "components": [
742
+ {
743
+ "name": "user",
744
+ "type": "address"
745
+ },
746
+ {
747
+ "name": "x",
748
+ "type": "uint256"
749
+ },
750
+ {
751
+ "name": "y",
752
+ "type": "uint256"
753
+ },
754
+ {
755
+ "name": "debt",
756
+ "type": "uint256"
757
+ },
758
+ {
759
+ "name": "health",
760
+ "type": "int256"
761
+ }
762
+ ],
763
+ "name": "",
764
+ "type": "tuple[]"
765
+ }
766
+ ],
767
+ "stateMutability": "view",
768
+ "type": "function"
769
+ },
770
+ {
771
+ "inputs": [],
772
+ "name": "amm_price",
773
+ "outputs": [
774
+ {
775
+ "name": "",
776
+ "type": "uint256"
777
+ }
778
+ ],
779
+ "stateMutability": "view",
780
+ "type": "function"
781
+ },
782
+ {
783
+ "inputs": [
784
+ {
785
+ "name": "user",
786
+ "type": "address"
787
+ }
788
+ ],
789
+ "name": "user_prices",
790
+ "outputs": [
791
+ {
792
+ "name": "",
793
+ "type": "uint256[2]"
794
+ }
795
+ ],
796
+ "stateMutability": "view",
797
+ "type": "function"
798
+ },
799
+ {
800
+ "inputs": [
801
+ {
802
+ "name": "user",
803
+ "type": "address"
804
+ }
805
+ ],
806
+ "name": "user_state",
807
+ "outputs": [
808
+ {
809
+ "name": "",
810
+ "type": "uint256[4]"
811
+ }
812
+ ],
813
+ "stateMutability": "view",
814
+ "type": "function"
815
+ },
816
+ {
817
+ "inputs": [
818
+ {
819
+ "name": "fee",
820
+ "type": "uint256"
821
+ }
822
+ ],
823
+ "name": "set_amm_fee",
824
+ "outputs": [],
825
+ "stateMutability": "nonpayable",
826
+ "type": "function"
827
+ },
828
+ {
829
+ "inputs": [
830
+ {
831
+ "name": "fee",
832
+ "type": "uint256"
833
+ }
834
+ ],
835
+ "name": "set_amm_admin_fee",
836
+ "outputs": [],
837
+ "stateMutability": "nonpayable",
838
+ "type": "function"
839
+ },
840
+ {
841
+ "inputs": [
842
+ {
843
+ "name": "monetary_policy",
844
+ "type": "address"
845
+ }
846
+ ],
847
+ "name": "set_monetary_policy",
848
+ "outputs": [],
849
+ "stateMutability": "nonpayable",
850
+ "type": "function"
851
+ },
852
+ {
853
+ "inputs": [
854
+ {
855
+ "name": "loan_discount",
856
+ "type": "uint256"
857
+ },
858
+ {
859
+ "name": "liquidation_discount",
860
+ "type": "uint256"
861
+ }
862
+ ],
863
+ "name": "set_borrowing_discounts",
864
+ "outputs": [],
865
+ "stateMutability": "nonpayable",
866
+ "type": "function"
867
+ },
868
+ {
869
+ "inputs": [
870
+ {
871
+ "name": "cb",
872
+ "type": "address"
873
+ }
874
+ ],
875
+ "name": "set_callback",
876
+ "outputs": [],
877
+ "stateMutability": "nonpayable",
878
+ "type": "function"
879
+ },
880
+ {
881
+ "inputs": [],
882
+ "name": "admin_fees",
883
+ "outputs": [
884
+ {
885
+ "name": "",
886
+ "type": "uint256"
887
+ }
888
+ ],
889
+ "stateMutability": "view",
890
+ "type": "function"
891
+ },
892
+ {
893
+ "inputs": [],
894
+ "name": "collect_fees",
895
+ "outputs": [
896
+ {
897
+ "name": "",
898
+ "type": "uint256"
899
+ }
900
+ ],
901
+ "stateMutability": "nonpayable",
902
+ "type": "function"
903
+ },
904
+ {
905
+ "inputs": [
906
+ {
907
+ "name": "arg0",
908
+ "type": "address"
909
+ }
910
+ ],
911
+ "name": "liquidation_discounts",
912
+ "outputs": [
913
+ {
914
+ "name": "",
915
+ "type": "uint256"
916
+ }
917
+ ],
918
+ "stateMutability": "view",
919
+ "type": "function"
920
+ },
921
+ {
922
+ "inputs": [
923
+ {
924
+ "name": "arg0",
925
+ "type": "uint256"
926
+ }
927
+ ],
928
+ "name": "loans",
929
+ "outputs": [
930
+ {
931
+ "name": "",
932
+ "type": "address"
933
+ }
934
+ ],
935
+ "stateMutability": "view",
936
+ "type": "function"
937
+ },
938
+ {
939
+ "inputs": [
940
+ {
941
+ "name": "arg0",
942
+ "type": "address"
943
+ }
944
+ ],
945
+ "name": "loan_ix",
946
+ "outputs": [
947
+ {
948
+ "name": "",
949
+ "type": "uint256"
950
+ }
951
+ ],
952
+ "stateMutability": "view",
953
+ "type": "function"
954
+ },
955
+ {
956
+ "inputs": [],
957
+ "name": "n_loans",
958
+ "outputs": [
959
+ {
960
+ "name": "",
961
+ "type": "uint256"
962
+ }
963
+ ],
964
+ "stateMutability": "view",
965
+ "type": "function"
966
+ },
967
+ {
968
+ "inputs": [],
969
+ "name": "minted",
970
+ "outputs": [
971
+ {
972
+ "name": "",
973
+ "type": "uint256"
974
+ }
975
+ ],
976
+ "stateMutability": "view",
977
+ "type": "function"
978
+ },
979
+ {
980
+ "inputs": [],
981
+ "name": "redeemed",
982
+ "outputs": [
983
+ {
984
+ "name": "",
985
+ "type": "uint256"
986
+ }
987
+ ],
988
+ "stateMutability": "view",
989
+ "type": "function"
990
+ },
991
+ {
992
+ "inputs": [],
993
+ "name": "monetary_policy",
994
+ "outputs": [
995
+ {
996
+ "name": "",
997
+ "type": "address"
998
+ }
999
+ ],
1000
+ "stateMutability": "view",
1001
+ "type": "function"
1002
+ },
1003
+ {
1004
+ "inputs": [],
1005
+ "name": "liquidation_discount",
1006
+ "outputs": [
1007
+ {
1008
+ "name": "",
1009
+ "type": "uint256"
1010
+ }
1011
+ ],
1012
+ "stateMutability": "view",
1013
+ "type": "function"
1014
+ },
1015
+ {
1016
+ "inputs": [],
1017
+ "name": "loan_discount",
1018
+ "outputs": [
1019
+ {
1020
+ "name": "",
1021
+ "type": "uint256"
1022
+ }
1023
+ ],
1024
+ "stateMutability": "view",
1025
+ "type": "function"
1026
+ }
1027
+ ]