@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,991 @@
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": "max_borrowable",
304
+ "outputs": [
305
+ {
306
+ "name": "",
307
+ "type": "uint256"
308
+ }
309
+ ],
310
+ "stateMutability": "view",
311
+ "type": "function"
312
+ },
313
+ {
314
+ "inputs": [
315
+ {
316
+ "name": "debt",
317
+ "type": "uint256"
318
+ },
319
+ {
320
+ "name": "N",
321
+ "type": "uint256"
322
+ }
323
+ ],
324
+ "name": "min_collateral",
325
+ "outputs": [
326
+ {
327
+ "name": "",
328
+ "type": "uint256"
329
+ }
330
+ ],
331
+ "stateMutability": "view",
332
+ "type": "function"
333
+ },
334
+ {
335
+ "inputs": [
336
+ {
337
+ "name": "collateral",
338
+ "type": "uint256"
339
+ },
340
+ {
341
+ "name": "debt",
342
+ "type": "uint256"
343
+ },
344
+ {
345
+ "name": "N",
346
+ "type": "uint256"
347
+ }
348
+ ],
349
+ "name": "calculate_debt_n1",
350
+ "outputs": [
351
+ {
352
+ "name": "",
353
+ "type": "int256"
354
+ }
355
+ ],
356
+ "stateMutability": "view",
357
+ "type": "function"
358
+ },
359
+ {
360
+ "inputs": [
361
+ {
362
+ "name": "collateral",
363
+ "type": "uint256"
364
+ },
365
+ {
366
+ "name": "debt",
367
+ "type": "uint256"
368
+ },
369
+ {
370
+ "name": "N",
371
+ "type": "uint256"
372
+ }
373
+ ],
374
+ "name": "create_loan",
375
+ "outputs": [],
376
+ "stateMutability": "payable",
377
+ "type": "function"
378
+ },
379
+ {
380
+ "inputs": [
381
+ {
382
+ "name": "collateral",
383
+ "type": "uint256"
384
+ },
385
+ {
386
+ "name": "debt",
387
+ "type": "uint256"
388
+ },
389
+ {
390
+ "name": "N",
391
+ "type": "uint256"
392
+ },
393
+ {
394
+ "name": "callbacker",
395
+ "type": "address"
396
+ },
397
+ {
398
+ "name": "callback_args",
399
+ "type": "uint256[]"
400
+ }
401
+ ],
402
+ "name": "create_loan_extended",
403
+ "outputs": [],
404
+ "stateMutability": "payable",
405
+ "type": "function"
406
+ },
407
+ {
408
+ "inputs": [
409
+ {
410
+ "name": "collateral",
411
+ "type": "uint256"
412
+ },
413
+ {
414
+ "name": "_for",
415
+ "type": "address"
416
+ }
417
+ ],
418
+ "name": "add_collateral",
419
+ "outputs": [],
420
+ "stateMutability": "payable",
421
+ "type": "function"
422
+ },
423
+ {
424
+ "inputs": [
425
+ {
426
+ "name": "collateral",
427
+ "type": "uint256"
428
+ },
429
+ {
430
+ "name": "use_eth",
431
+ "type": "bool"
432
+ }
433
+ ],
434
+ "name": "remove_collateral",
435
+ "outputs": [],
436
+ "stateMutability": "nonpayable",
437
+ "type": "function"
438
+ },
439
+ {
440
+ "inputs": [
441
+ {
442
+ "name": "collateral",
443
+ "type": "uint256"
444
+ },
445
+ {
446
+ "name": "debt",
447
+ "type": "uint256"
448
+ }
449
+ ],
450
+ "name": "borrow_more",
451
+ "outputs": [],
452
+ "stateMutability": "payable",
453
+ "type": "function"
454
+ },
455
+ {
456
+ "inputs": [
457
+ {
458
+ "name": "_d_debt",
459
+ "type": "uint256"
460
+ },
461
+ {
462
+ "name": "_for",
463
+ "type": "address"
464
+ },
465
+ {
466
+ "name": "max_active_band",
467
+ "type": "int256"
468
+ },
469
+ {
470
+ "name": "use_eth",
471
+ "type": "bool"
472
+ }
473
+ ],
474
+ "name": "repay",
475
+ "outputs": [],
476
+ "stateMutability": "payable",
477
+ "type": "function"
478
+ },
479
+ {
480
+ "inputs": [
481
+ {
482
+ "name": "callbacker",
483
+ "type": "address"
484
+ },
485
+ {
486
+ "name": "callback_args",
487
+ "type": "uint256[]"
488
+ }
489
+ ],
490
+ "name": "repay_extended",
491
+ "outputs": [],
492
+ "stateMutability": "nonpayable",
493
+ "type": "function"
494
+ },
495
+ {
496
+ "inputs": [
497
+ {
498
+ "name": "user",
499
+ "type": "address"
500
+ },
501
+ {
502
+ "name": "d_collateral",
503
+ "type": "int256"
504
+ },
505
+ {
506
+ "name": "d_debt",
507
+ "type": "int256"
508
+ },
509
+ {
510
+ "name": "full",
511
+ "type": "bool"
512
+ },
513
+ {
514
+ "name": "N",
515
+ "type": "uint256"
516
+ }
517
+ ],
518
+ "name": "health_calculator",
519
+ "outputs": [
520
+ {
521
+ "name": "",
522
+ "type": "int256"
523
+ }
524
+ ],
525
+ "stateMutability": "view",
526
+ "type": "function"
527
+ },
528
+ {
529
+ "inputs": [
530
+ {
531
+ "name": "user",
532
+ "type": "address"
533
+ },
534
+ {
535
+ "name": "min_x",
536
+ "type": "uint256"
537
+ },
538
+ {
539
+ "name": "use_eth",
540
+ "type": "bool"
541
+ }
542
+ ],
543
+ "name": "liquidate",
544
+ "outputs": [],
545
+ "stateMutability": "nonpayable",
546
+ "type": "function"
547
+ },
548
+ {
549
+ "inputs": [
550
+ {
551
+ "name": "user",
552
+ "type": "address"
553
+ },
554
+ {
555
+ "name": "min_x",
556
+ "type": "uint256"
557
+ },
558
+ {
559
+ "name": "frac",
560
+ "type": "uint256"
561
+ },
562
+ {
563
+ "name": "use_eth",
564
+ "type": "bool"
565
+ },
566
+ {
567
+ "name": "callbacker",
568
+ "type": "address"
569
+ },
570
+ {
571
+ "name": "callback_args",
572
+ "type": "uint256[]"
573
+ }
574
+ ],
575
+ "name": "liquidate_extended",
576
+ "outputs": [],
577
+ "stateMutability": "nonpayable",
578
+ "type": "function"
579
+ },
580
+ {
581
+ "inputs": [
582
+ {
583
+ "name": "user",
584
+ "type": "address"
585
+ }
586
+ ],
587
+ "name": "tokens_to_liquidate",
588
+ "outputs": [
589
+ {
590
+ "name": "",
591
+ "type": "uint256"
592
+ }
593
+ ],
594
+ "stateMutability": "view",
595
+ "type": "function"
596
+ },
597
+ {
598
+ "inputs": [
599
+ {
600
+ "name": "user",
601
+ "type": "address"
602
+ },
603
+ {
604
+ "name": "full",
605
+ "type": "bool"
606
+ }
607
+ ],
608
+ "name": "health",
609
+ "outputs": [
610
+ {
611
+ "name": "",
612
+ "type": "int256"
613
+ }
614
+ ],
615
+ "stateMutability": "view",
616
+ "type": "function"
617
+ },
618
+ {
619
+ "inputs": [],
620
+ "name": "users_to_liquidate",
621
+ "outputs": [
622
+ {
623
+ "components": [
624
+ {
625
+ "name": "user",
626
+ "type": "address"
627
+ },
628
+ {
629
+ "name": "x",
630
+ "type": "uint256"
631
+ },
632
+ {
633
+ "name": "y",
634
+ "type": "uint256"
635
+ },
636
+ {
637
+ "name": "debt",
638
+ "type": "uint256"
639
+ },
640
+ {
641
+ "name": "health",
642
+ "type": "int256"
643
+ }
644
+ ],
645
+ "name": "",
646
+ "type": "tuple[]"
647
+ }
648
+ ],
649
+ "stateMutability": "view",
650
+ "type": "function"
651
+ },
652
+ {
653
+ "inputs": [
654
+ {
655
+ "name": "_from",
656
+ "type": "uint256"
657
+ }
658
+ ],
659
+ "name": "users_to_liquidate",
660
+ "outputs": [
661
+ {
662
+ "components": [
663
+ {
664
+ "name": "user",
665
+ "type": "address"
666
+ },
667
+ {
668
+ "name": "x",
669
+ "type": "uint256"
670
+ },
671
+ {
672
+ "name": "y",
673
+ "type": "uint256"
674
+ },
675
+ {
676
+ "name": "debt",
677
+ "type": "uint256"
678
+ },
679
+ {
680
+ "name": "health",
681
+ "type": "int256"
682
+ }
683
+ ],
684
+ "name": "",
685
+ "type": "tuple[]"
686
+ }
687
+ ],
688
+ "stateMutability": "view",
689
+ "type": "function"
690
+ },
691
+ {
692
+ "inputs": [
693
+ {
694
+ "name": "_from",
695
+ "type": "uint256"
696
+ },
697
+ {
698
+ "name": "_limit",
699
+ "type": "uint256"
700
+ }
701
+ ],
702
+ "name": "users_to_liquidate",
703
+ "outputs": [
704
+ {
705
+ "components": [
706
+ {
707
+ "name": "user",
708
+ "type": "address"
709
+ },
710
+ {
711
+ "name": "x",
712
+ "type": "uint256"
713
+ },
714
+ {
715
+ "name": "y",
716
+ "type": "uint256"
717
+ },
718
+ {
719
+ "name": "debt",
720
+ "type": "uint256"
721
+ },
722
+ {
723
+ "name": "health",
724
+ "type": "int256"
725
+ }
726
+ ],
727
+ "name": "",
728
+ "type": "tuple[]"
729
+ }
730
+ ],
731
+ "stateMutability": "view",
732
+ "type": "function"
733
+ },
734
+ {
735
+ "inputs": [],
736
+ "name": "amm_price",
737
+ "outputs": [
738
+ {
739
+ "name": "",
740
+ "type": "uint256"
741
+ }
742
+ ],
743
+ "stateMutability": "view",
744
+ "type": "function"
745
+ },
746
+ {
747
+ "inputs": [
748
+ {
749
+ "name": "user",
750
+ "type": "address"
751
+ }
752
+ ],
753
+ "name": "user_prices",
754
+ "outputs": [
755
+ {
756
+ "name": "",
757
+ "type": "uint256[2]"
758
+ }
759
+ ],
760
+ "stateMutability": "view",
761
+ "type": "function"
762
+ },
763
+ {
764
+ "inputs": [
765
+ {
766
+ "name": "user",
767
+ "type": "address"
768
+ }
769
+ ],
770
+ "name": "user_state",
771
+ "outputs": [
772
+ {
773
+ "name": "",
774
+ "type": "uint256[4]"
775
+ }
776
+ ],
777
+ "stateMutability": "view",
778
+ "type": "function"
779
+ },
780
+ {
781
+ "inputs": [
782
+ {
783
+ "name": "fee",
784
+ "type": "uint256"
785
+ }
786
+ ],
787
+ "name": "set_amm_fee",
788
+ "outputs": [],
789
+ "stateMutability": "nonpayable",
790
+ "type": "function"
791
+ },
792
+ {
793
+ "inputs": [
794
+ {
795
+ "name": "fee",
796
+ "type": "uint256"
797
+ }
798
+ ],
799
+ "name": "set_amm_admin_fee",
800
+ "outputs": [],
801
+ "stateMutability": "nonpayable",
802
+ "type": "function"
803
+ },
804
+ {
805
+ "inputs": [
806
+ {
807
+ "name": "monetary_policy",
808
+ "type": "address"
809
+ }
810
+ ],
811
+ "name": "set_monetary_policy",
812
+ "outputs": [],
813
+ "stateMutability": "nonpayable",
814
+ "type": "function"
815
+ },
816
+ {
817
+ "inputs": [
818
+ {
819
+ "name": "loan_discount",
820
+ "type": "uint256"
821
+ },
822
+ {
823
+ "name": "liquidation_discount",
824
+ "type": "uint256"
825
+ }
826
+ ],
827
+ "name": "set_borrowing_discounts",
828
+ "outputs": [],
829
+ "stateMutability": "nonpayable",
830
+ "type": "function"
831
+ },
832
+ {
833
+ "inputs": [
834
+ {
835
+ "name": "cb",
836
+ "type": "address"
837
+ }
838
+ ],
839
+ "name": "set_callback",
840
+ "outputs": [],
841
+ "stateMutability": "nonpayable",
842
+ "type": "function"
843
+ },
844
+ {
845
+ "inputs": [],
846
+ "name": "admin_fees",
847
+ "outputs": [
848
+ {
849
+ "name": "",
850
+ "type": "uint256"
851
+ }
852
+ ],
853
+ "stateMutability": "view",
854
+ "type": "function"
855
+ },
856
+ {
857
+ "inputs": [],
858
+ "name": "collect_fees",
859
+ "outputs": [
860
+ {
861
+ "name": "",
862
+ "type": "uint256"
863
+ }
864
+ ],
865
+ "stateMutability": "nonpayable",
866
+ "type": "function"
867
+ },
868
+ {
869
+ "inputs": [
870
+ {
871
+ "name": "arg0",
872
+ "type": "address"
873
+ }
874
+ ],
875
+ "name": "liquidation_discounts",
876
+ "outputs": [
877
+ {
878
+ "name": "",
879
+ "type": "uint256"
880
+ }
881
+ ],
882
+ "stateMutability": "view",
883
+ "type": "function"
884
+ },
885
+ {
886
+ "inputs": [
887
+ {
888
+ "name": "arg0",
889
+ "type": "uint256"
890
+ }
891
+ ],
892
+ "name": "loans",
893
+ "outputs": [
894
+ {
895
+ "name": "",
896
+ "type": "address"
897
+ }
898
+ ],
899
+ "stateMutability": "view",
900
+ "type": "function"
901
+ },
902
+ {
903
+ "inputs": [
904
+ {
905
+ "name": "arg0",
906
+ "type": "address"
907
+ }
908
+ ],
909
+ "name": "loan_ix",
910
+ "outputs": [
911
+ {
912
+ "name": "",
913
+ "type": "uint256"
914
+ }
915
+ ],
916
+ "stateMutability": "view",
917
+ "type": "function"
918
+ },
919
+ {
920
+ "inputs": [],
921
+ "name": "n_loans",
922
+ "outputs": [
923
+ {
924
+ "name": "",
925
+ "type": "uint256"
926
+ }
927
+ ],
928
+ "stateMutability": "view",
929
+ "type": "function"
930
+ },
931
+ {
932
+ "inputs": [],
933
+ "name": "minted",
934
+ "outputs": [
935
+ {
936
+ "name": "",
937
+ "type": "uint256"
938
+ }
939
+ ],
940
+ "stateMutability": "view",
941
+ "type": "function"
942
+ },
943
+ {
944
+ "inputs": [],
945
+ "name": "redeemed",
946
+ "outputs": [
947
+ {
948
+ "name": "",
949
+ "type": "uint256"
950
+ }
951
+ ],
952
+ "stateMutability": "view",
953
+ "type": "function"
954
+ },
955
+ {
956
+ "inputs": [],
957
+ "name": "monetary_policy",
958
+ "outputs": [
959
+ {
960
+ "name": "",
961
+ "type": "address"
962
+ }
963
+ ],
964
+ "stateMutability": "view",
965
+ "type": "function"
966
+ },
967
+ {
968
+ "inputs": [],
969
+ "name": "liquidation_discount",
970
+ "outputs": [
971
+ {
972
+ "name": "",
973
+ "type": "uint256"
974
+ }
975
+ ],
976
+ "stateMutability": "view",
977
+ "type": "function"
978
+ },
979
+ {
980
+ "inputs": [],
981
+ "name": "loan_discount",
982
+ "outputs": [
983
+ {
984
+ "name": "",
985
+ "type": "uint256"
986
+ }
987
+ ],
988
+ "stateMutability": "view",
989
+ "type": "function"
990
+ }
991
+ ]