@kehtus/proportion-sdk 0.1.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 (56) hide show
  1. package/SDK_IMPROVEMENT_PLAN.md +197 -0
  2. package/arch.md +448 -0
  3. package/dist/__tests__/account.test.d.ts +1 -0
  4. package/dist/__tests__/account.test.js +36 -0
  5. package/dist/__tests__/indexer.test.d.ts +1 -0
  6. package/dist/__tests__/indexer.test.js +230 -0
  7. package/dist/__tests__/lifecycle.test.d.ts +1 -0
  8. package/dist/__tests__/lifecycle.test.js +186 -0
  9. package/dist/__tests__/reads.test.d.ts +1 -0
  10. package/dist/__tests__/reads.test.js +185 -0
  11. package/dist/__tests__/utils.test.d.ts +1 -0
  12. package/dist/__tests__/utils.test.js +185 -0
  13. package/dist/abi/factory.d.ts +308 -0
  14. package/dist/abi/factory.js +399 -0
  15. package/dist/abi/fundedAccount.d.ts +1074 -0
  16. package/dist/abi/fundedAccount.js +1373 -0
  17. package/dist/abi/mainVault.d.ts +1448 -0
  18. package/dist/abi/mainVault.js +1865 -0
  19. package/dist/account.d.ts +55 -0
  20. package/dist/account.js +290 -0
  21. package/dist/constants.d.ts +48 -0
  22. package/dist/constants.js +42 -0
  23. package/dist/factory.d.ts +23 -0
  24. package/dist/factory.js +139 -0
  25. package/dist/index.d.ts +11 -0
  26. package/dist/index.js +14 -0
  27. package/dist/indexer.d.ts +57 -0
  28. package/dist/indexer.js +540 -0
  29. package/dist/sdk.d.ts +22 -0
  30. package/dist/sdk.js +89 -0
  31. package/dist/types.d.ts +384 -0
  32. package/dist/types.js +11 -0
  33. package/dist/utils.d.ts +21 -0
  34. package/dist/utils.js +89 -0
  35. package/dist/vault.d.ts +60 -0
  36. package/dist/vault.js +429 -0
  37. package/package.json +32 -0
  38. package/src/__tests__/account.test.ts +40 -0
  39. package/src/__tests__/indexer.test.ts +255 -0
  40. package/src/__tests__/lifecycle.test.ts +231 -0
  41. package/src/__tests__/reads.test.ts +209 -0
  42. package/src/__tests__/utils.test.ts +245 -0
  43. package/src/abi/factory.ts +399 -0
  44. package/src/abi/fundedAccount.ts +1373 -0
  45. package/src/abi/mainVault.ts +1865 -0
  46. package/src/account.ts +339 -0
  47. package/src/constants.ts +50 -0
  48. package/src/factory.ts +157 -0
  49. package/src/index.ts +16 -0
  50. package/src/indexer.ts +636 -0
  51. package/src/sdk.ts +93 -0
  52. package/src/types.ts +426 -0
  53. package/src/utils.ts +143 -0
  54. package/src/vault.ts +479 -0
  55. package/tsconfig.json +19 -0
  56. package/vitest.config.ts +8 -0
@@ -0,0 +1,1373 @@
1
+ export const fundedAccountAbi = [
2
+ {
3
+ "inputs": [],
4
+ "stateMutability": "nonpayable",
5
+ "type": "constructor"
6
+ },
7
+ {
8
+ "inputs": [],
9
+ "name": "ReentrancyGuardReentrantCall",
10
+ "type": "error"
11
+ },
12
+ {
13
+ "inputs": [
14
+ {
15
+ "internalType": "address",
16
+ "name": "token",
17
+ "type": "address"
18
+ }
19
+ ],
20
+ "name": "SafeERC20FailedOperation",
21
+ "type": "error"
22
+ },
23
+ {
24
+ "anonymous": false,
25
+ "inputs": [
26
+ {
27
+ "indexed": true,
28
+ "internalType": "address",
29
+ "name": "owner",
30
+ "type": "address"
31
+ },
32
+ {
33
+ "indexed": false,
34
+ "internalType": "uint256",
35
+ "name": "returnedAmount",
36
+ "type": "uint256"
37
+ }
38
+ ],
39
+ "name": "AccountClosed",
40
+ "type": "event"
41
+ },
42
+ {
43
+ "anonymous": false,
44
+ "inputs": [
45
+ {
46
+ "indexed": true,
47
+ "internalType": "address",
48
+ "name": "owner",
49
+ "type": "address"
50
+ },
51
+ {
52
+ "indexed": true,
53
+ "internalType": "address",
54
+ "name": "closedBy",
55
+ "type": "address"
56
+ }
57
+ ],
58
+ "name": "AdminCloseRequested",
59
+ "type": "event"
60
+ },
61
+ {
62
+ "anonymous": false,
63
+ "inputs": [
64
+ {
65
+ "indexed": true,
66
+ "internalType": "address",
67
+ "name": "wallet",
68
+ "type": "address"
69
+ }
70
+ ],
71
+ "name": "ApiWalletSet",
72
+ "type": "event"
73
+ },
74
+ {
75
+ "anonymous": false,
76
+ "inputs": [
77
+ {
78
+ "indexed": true,
79
+ "internalType": "address",
80
+ "name": "wallet",
81
+ "type": "address"
82
+ }
83
+ ],
84
+ "name": "BuilderRiskEngineWalletSet",
85
+ "type": "event"
86
+ },
87
+ {
88
+ "anonymous": false,
89
+ "inputs": [
90
+ {
91
+ "indexed": true,
92
+ "internalType": "uint256",
93
+ "name": "dayNumber",
94
+ "type": "uint256"
95
+ },
96
+ {
97
+ "indexed": false,
98
+ "internalType": "int64",
99
+ "name": "accountValue",
100
+ "type": "int64"
101
+ },
102
+ {
103
+ "indexed": false,
104
+ "internalType": "int64",
105
+ "name": "previousValue",
106
+ "type": "int64"
107
+ },
108
+ {
109
+ "indexed": false,
110
+ "internalType": "bool",
111
+ "name": "profitable",
112
+ "type": "bool"
113
+ },
114
+ {
115
+ "indexed": false,
116
+ "internalType": "uint8",
117
+ "name": "profitableDaysCount",
118
+ "type": "uint8"
119
+ }
120
+ ],
121
+ "name": "CheckpointCreated",
122
+ "type": "event"
123
+ },
124
+ {
125
+ "anonymous": false,
126
+ "inputs": [
127
+ {
128
+ "indexed": false,
129
+ "internalType": "uint256",
130
+ "name": "pendingSubFee",
131
+ "type": "uint256"
132
+ },
133
+ {
134
+ "indexed": false,
135
+ "internalType": "uint256",
136
+ "name": "pendingWithdrawalProfit",
137
+ "type": "uint256"
138
+ }
139
+ ],
140
+ "name": "CloseBreakdown",
141
+ "type": "event"
142
+ },
143
+ {
144
+ "anonymous": false,
145
+ "inputs": [
146
+ {
147
+ "indexed": true,
148
+ "internalType": "address",
149
+ "name": "owner",
150
+ "type": "address"
151
+ }
152
+ ],
153
+ "name": "CloseRequested",
154
+ "type": "event"
155
+ },
156
+ {
157
+ "anonymous": false,
158
+ "inputs": [
159
+ {
160
+ "indexed": true,
161
+ "internalType": "address",
162
+ "name": "owner",
163
+ "type": "address"
164
+ },
165
+ {
166
+ "indexed": false,
167
+ "internalType": "int64",
168
+ "name": "accountValue",
169
+ "type": "int64"
170
+ },
171
+ {
172
+ "indexed": false,
173
+ "internalType": "uint256",
174
+ "name": "dailyFloor",
175
+ "type": "uint256"
176
+ }
177
+ ],
178
+ "name": "DailyDrawdownBreached",
179
+ "type": "event"
180
+ },
181
+ {
182
+ "anonymous": false,
183
+ "inputs": [
184
+ {
185
+ "indexed": false,
186
+ "internalType": "uint256",
187
+ "name": "oldHWM",
188
+ "type": "uint256"
189
+ },
190
+ {
191
+ "indexed": false,
192
+ "internalType": "uint256",
193
+ "name": "newHWM",
194
+ "type": "uint256"
195
+ }
196
+ ],
197
+ "name": "HighWaterMarkUpdated",
198
+ "type": "event"
199
+ },
200
+ {
201
+ "anonymous": false,
202
+ "inputs": [
203
+ {
204
+ "indexed": false,
205
+ "internalType": "uint256",
206
+ "name": "amount",
207
+ "type": "uint256"
208
+ }
209
+ ],
210
+ "name": "Initialized",
211
+ "type": "event"
212
+ },
213
+ {
214
+ "anonymous": false,
215
+ "inputs": [
216
+ {
217
+ "indexed": true,
218
+ "internalType": "address",
219
+ "name": "owner",
220
+ "type": "address"
221
+ },
222
+ {
223
+ "indexed": false,
224
+ "internalType": "uint64",
225
+ "name": "ntlPos",
226
+ "type": "uint64"
227
+ },
228
+ {
229
+ "indexed": false,
230
+ "internalType": "int64",
231
+ "name": "accountValue",
232
+ "type": "int64"
233
+ }
234
+ ],
235
+ "name": "LeverageBreached",
236
+ "type": "event"
237
+ },
238
+ {
239
+ "anonymous": false,
240
+ "inputs": [
241
+ {
242
+ "indexed": true,
243
+ "internalType": "address",
244
+ "name": "owner",
245
+ "type": "address"
246
+ },
247
+ {
248
+ "indexed": false,
249
+ "internalType": "uint32",
250
+ "name": "perpIndex",
251
+ "type": "uint32"
252
+ },
253
+ {
254
+ "indexed": false,
255
+ "internalType": "uint32",
256
+ "name": "leverage",
257
+ "type": "uint32"
258
+ }
259
+ ],
260
+ "name": "PositionLeverageBreached",
261
+ "type": "event"
262
+ },
263
+ {
264
+ "anonymous": false,
265
+ "inputs": [
266
+ {
267
+ "indexed": true,
268
+ "internalType": "address",
269
+ "name": "wallet",
270
+ "type": "address"
271
+ }
272
+ ],
273
+ "name": "RiskEngineWalletSet",
274
+ "type": "event"
275
+ },
276
+ {
277
+ "anonymous": false,
278
+ "inputs": [
279
+ {
280
+ "indexed": false,
281
+ "internalType": "uint256",
282
+ "name": "amount",
283
+ "type": "uint256"
284
+ }
285
+ ],
286
+ "name": "StuckFundsRescued",
287
+ "type": "event"
288
+ },
289
+ {
290
+ "anonymous": false,
291
+ "inputs": [
292
+ {
293
+ "indexed": true,
294
+ "internalType": "address",
295
+ "name": "owner",
296
+ "type": "address"
297
+ }
298
+ ],
299
+ "name": "SubscriptionCancelled",
300
+ "type": "event"
301
+ },
302
+ {
303
+ "anonymous": false,
304
+ "inputs": [
305
+ {
306
+ "indexed": true,
307
+ "internalType": "address",
308
+ "name": "owner",
309
+ "type": "address"
310
+ }
311
+ ],
312
+ "name": "SubscriptionExpired",
313
+ "type": "event"
314
+ },
315
+ {
316
+ "anonymous": false,
317
+ "inputs": [
318
+ {
319
+ "indexed": false,
320
+ "internalType": "uint256",
321
+ "name": "amount",
322
+ "type": "uint256"
323
+ }
324
+ ],
325
+ "name": "SubscriptionFeeClaimed",
326
+ "type": "event"
327
+ },
328
+ {
329
+ "anonymous": false,
330
+ "inputs": [
331
+ {
332
+ "indexed": false,
333
+ "internalType": "uint256",
334
+ "name": "amount",
335
+ "type": "uint256"
336
+ },
337
+ {
338
+ "indexed": false,
339
+ "internalType": "uint256",
340
+ "name": "paidUntil",
341
+ "type": "uint256"
342
+ }
343
+ ],
344
+ "name": "SubscriptionPaid",
345
+ "type": "event"
346
+ },
347
+ {
348
+ "anonymous": false,
349
+ "inputs": [
350
+ {
351
+ "indexed": true,
352
+ "internalType": "address",
353
+ "name": "owner",
354
+ "type": "address"
355
+ },
356
+ {
357
+ "indexed": false,
358
+ "internalType": "uint256",
359
+ "name": "fee",
360
+ "type": "uint256"
361
+ },
362
+ {
363
+ "indexed": false,
364
+ "internalType": "bool",
365
+ "name": "insufficientBalance",
366
+ "type": "bool"
367
+ }
368
+ ],
369
+ "name": "SubscriptionPaymentFailed",
370
+ "type": "event"
371
+ },
372
+ {
373
+ "anonymous": false,
374
+ "inputs": [
375
+ {
376
+ "indexed": true,
377
+ "internalType": "address",
378
+ "name": "owner",
379
+ "type": "address"
380
+ },
381
+ {
382
+ "indexed": false,
383
+ "internalType": "int64",
384
+ "name": "accountValue",
385
+ "type": "int64"
386
+ },
387
+ {
388
+ "indexed": false,
389
+ "internalType": "uint256",
390
+ "name": "floor",
391
+ "type": "uint256"
392
+ }
393
+ ],
394
+ "name": "TrailingDrawdownBreached",
395
+ "type": "event"
396
+ },
397
+ {
398
+ "anonymous": false,
399
+ "inputs": [
400
+ {
401
+ "indexed": true,
402
+ "internalType": "address",
403
+ "name": "owner",
404
+ "type": "address"
405
+ },
406
+ {
407
+ "indexed": false,
408
+ "internalType": "uint32",
409
+ "name": "perpIndex",
410
+ "type": "uint32"
411
+ }
412
+ ],
413
+ "name": "UnauthorizedAssetDetected",
414
+ "type": "event"
415
+ },
416
+ {
417
+ "anonymous": false,
418
+ "inputs": [
419
+ {
420
+ "indexed": false,
421
+ "internalType": "uint256",
422
+ "name": "amount",
423
+ "type": "uint256"
424
+ }
425
+ ],
426
+ "name": "VaultReturnInitiated",
427
+ "type": "event"
428
+ },
429
+ {
430
+ "anonymous": false,
431
+ "inputs": [
432
+ {
433
+ "indexed": true,
434
+ "internalType": "address",
435
+ "name": "owner",
436
+ "type": "address"
437
+ },
438
+ {
439
+ "indexed": false,
440
+ "internalType": "uint256",
441
+ "name": "profit",
442
+ "type": "uint256"
443
+ }
444
+ ],
445
+ "name": "WithdrawalCancelled",
446
+ "type": "event"
447
+ },
448
+ {
449
+ "anonymous": false,
450
+ "inputs": [
451
+ {
452
+ "indexed": true,
453
+ "internalType": "address",
454
+ "name": "owner",
455
+ "type": "address"
456
+ },
457
+ {
458
+ "indexed": false,
459
+ "internalType": "uint256",
460
+ "name": "ownerAmount",
461
+ "type": "uint256"
462
+ },
463
+ {
464
+ "indexed": false,
465
+ "internalType": "uint256",
466
+ "name": "vaultAmount",
467
+ "type": "uint256"
468
+ }
469
+ ],
470
+ "name": "WithdrawalClaimed",
471
+ "type": "event"
472
+ },
473
+ {
474
+ "anonymous": false,
475
+ "inputs": [
476
+ {
477
+ "indexed": true,
478
+ "internalType": "address",
479
+ "name": "owner",
480
+ "type": "address"
481
+ }
482
+ ],
483
+ "name": "WithdrawalEligible",
484
+ "type": "event"
485
+ },
486
+ {
487
+ "anonymous": false,
488
+ "inputs": [
489
+ {
490
+ "indexed": true,
491
+ "internalType": "address",
492
+ "name": "owner",
493
+ "type": "address"
494
+ },
495
+ {
496
+ "indexed": false,
497
+ "internalType": "uint256",
498
+ "name": "profit",
499
+ "type": "uint256"
500
+ },
501
+ {
502
+ "indexed": false,
503
+ "internalType": "uint256",
504
+ "name": "ownerAmount",
505
+ "type": "uint256"
506
+ },
507
+ {
508
+ "indexed": false,
509
+ "internalType": "uint256",
510
+ "name": "vaultAmount",
511
+ "type": "uint256"
512
+ },
513
+ {
514
+ "indexed": false,
515
+ "internalType": "uint256",
516
+ "name": "protocolAmount",
517
+ "type": "uint256"
518
+ }
519
+ ],
520
+ "name": "WithdrawalRequested",
521
+ "type": "event"
522
+ },
523
+ {
524
+ "inputs": [],
525
+ "name": "BPS_DENOMINATOR",
526
+ "outputs": [
527
+ {
528
+ "internalType": "uint256",
529
+ "name": "",
530
+ "type": "uint256"
531
+ }
532
+ ],
533
+ "stateMutability": "view",
534
+ "type": "function"
535
+ },
536
+ {
537
+ "inputs": [],
538
+ "name": "BRIDGE_DELAY",
539
+ "outputs": [
540
+ {
541
+ "internalType": "uint256",
542
+ "name": "",
543
+ "type": "uint256"
544
+ }
545
+ ],
546
+ "stateMutability": "view",
547
+ "type": "function"
548
+ },
549
+ {
550
+ "inputs": [],
551
+ "name": "CHECKPOINT_INTERVAL",
552
+ "outputs": [
553
+ {
554
+ "internalType": "uint256",
555
+ "name": "",
556
+ "type": "uint256"
557
+ }
558
+ ],
559
+ "stateMutability": "view",
560
+ "type": "function"
561
+ },
562
+ {
563
+ "inputs": [],
564
+ "name": "CLOSING_TIMEOUT",
565
+ "outputs": [
566
+ {
567
+ "internalType": "uint256",
568
+ "name": "",
569
+ "type": "uint256"
570
+ }
571
+ ],
572
+ "stateMutability": "view",
573
+ "type": "function"
574
+ },
575
+ {
576
+ "inputs": [],
577
+ "name": "CORE_WRITER",
578
+ "outputs": [
579
+ {
580
+ "internalType": "contract ICoreWriter",
581
+ "name": "",
582
+ "type": "address"
583
+ }
584
+ ],
585
+ "stateMutability": "view",
586
+ "type": "function"
587
+ },
588
+ {
589
+ "inputs": [],
590
+ "name": "DAILY_DD_DISCOUNT_BPS",
591
+ "outputs": [
592
+ {
593
+ "internalType": "uint16",
594
+ "name": "",
595
+ "type": "uint16"
596
+ }
597
+ ],
598
+ "stateMutability": "view",
599
+ "type": "function"
600
+ },
601
+ {
602
+ "inputs": [],
603
+ "name": "MAX_LEVERAGE",
604
+ "outputs": [
605
+ {
606
+ "internalType": "uint256",
607
+ "name": "",
608
+ "type": "uint256"
609
+ }
610
+ ],
611
+ "stateMutability": "view",
612
+ "type": "function"
613
+ },
614
+ {
615
+ "inputs": [],
616
+ "name": "MIN_PROFIT_BPS",
617
+ "outputs": [
618
+ {
619
+ "internalType": "uint256",
620
+ "name": "",
621
+ "type": "uint256"
622
+ }
623
+ ],
624
+ "stateMutability": "view",
625
+ "type": "function"
626
+ },
627
+ {
628
+ "inputs": [],
629
+ "name": "OWNER_PROFIT_BPS",
630
+ "outputs": [
631
+ {
632
+ "internalType": "uint256",
633
+ "name": "",
634
+ "type": "uint256"
635
+ }
636
+ ],
637
+ "stateMutability": "view",
638
+ "type": "function"
639
+ },
640
+ {
641
+ "inputs": [],
642
+ "name": "PERP_DEX_INDEX",
643
+ "outputs": [
644
+ {
645
+ "internalType": "uint32",
646
+ "name": "",
647
+ "type": "uint32"
648
+ }
649
+ ],
650
+ "stateMutability": "view",
651
+ "type": "function"
652
+ },
653
+ {
654
+ "inputs": [],
655
+ "name": "PROFITABLE_DAYS_REQUIRED",
656
+ "outputs": [
657
+ {
658
+ "internalType": "uint8",
659
+ "name": "",
660
+ "type": "uint8"
661
+ }
662
+ ],
663
+ "stateMutability": "view",
664
+ "type": "function"
665
+ },
666
+ {
667
+ "inputs": [],
668
+ "name": "PROTOCOL_PROFIT_BPS",
669
+ "outputs": [
670
+ {
671
+ "internalType": "uint256",
672
+ "name": "",
673
+ "type": "uint256"
674
+ }
675
+ ],
676
+ "stateMutability": "view",
677
+ "type": "function"
678
+ },
679
+ {
680
+ "inputs": [],
681
+ "name": "SUBSCRIPTION_PERIOD",
682
+ "outputs": [
683
+ {
684
+ "internalType": "uint256",
685
+ "name": "",
686
+ "type": "uint256"
687
+ }
688
+ ],
689
+ "stateMutability": "view",
690
+ "type": "function"
691
+ },
692
+ {
693
+ "inputs": [],
694
+ "name": "SUBSCRIPTION_PROTOCOL_BPS",
695
+ "outputs": [
696
+ {
697
+ "internalType": "uint256",
698
+ "name": "",
699
+ "type": "uint256"
700
+ }
701
+ ],
702
+ "stateMutability": "view",
703
+ "type": "function"
704
+ },
705
+ {
706
+ "inputs": [],
707
+ "name": "TRADING_DAYS_REQUIRED",
708
+ "outputs": [
709
+ {
710
+ "internalType": "uint8",
711
+ "name": "",
712
+ "type": "uint8"
713
+ }
714
+ ],
715
+ "stateMutability": "view",
716
+ "type": "function"
717
+ },
718
+ {
719
+ "inputs": [],
720
+ "name": "WITHDRAWAL_TIMEOUT",
721
+ "outputs": [
722
+ {
723
+ "internalType": "uint256",
724
+ "name": "",
725
+ "type": "uint256"
726
+ }
727
+ ],
728
+ "stateMutability": "view",
729
+ "type": "function"
730
+ },
731
+ {
732
+ "inputs": [],
733
+ "name": "accountSize",
734
+ "outputs": [
735
+ {
736
+ "internalType": "uint96",
737
+ "name": "",
738
+ "type": "uint96"
739
+ }
740
+ ],
741
+ "stateMutability": "view",
742
+ "type": "function"
743
+ },
744
+ {
745
+ "inputs": [],
746
+ "name": "activatedAt",
747
+ "outputs": [
748
+ {
749
+ "internalType": "uint256",
750
+ "name": "",
751
+ "type": "uint256"
752
+ }
753
+ ],
754
+ "stateMutability": "view",
755
+ "type": "function"
756
+ },
757
+ {
758
+ "inputs": [],
759
+ "name": "apiWallet",
760
+ "outputs": [
761
+ {
762
+ "internalType": "address",
763
+ "name": "",
764
+ "type": "address"
765
+ }
766
+ ],
767
+ "stateMutability": "view",
768
+ "type": "function"
769
+ },
770
+ {
771
+ "inputs": [],
772
+ "name": "builder",
773
+ "outputs": [
774
+ {
775
+ "internalType": "address",
776
+ "name": "",
777
+ "type": "address"
778
+ }
779
+ ],
780
+ "stateMutability": "view",
781
+ "type": "function"
782
+ },
783
+ {
784
+ "inputs": [],
785
+ "name": "builderRiskEngineWallet",
786
+ "outputs": [
787
+ {
788
+ "internalType": "address",
789
+ "name": "",
790
+ "type": "address"
791
+ }
792
+ ],
793
+ "stateMutability": "view",
794
+ "type": "function"
795
+ },
796
+ {
797
+ "inputs": [],
798
+ "name": "canWithdrawProfit",
799
+ "outputs": [
800
+ {
801
+ "internalType": "bool",
802
+ "name": "",
803
+ "type": "bool"
804
+ }
805
+ ],
806
+ "stateMutability": "view",
807
+ "type": "function"
808
+ },
809
+ {
810
+ "inputs": [],
811
+ "name": "cancelStuckWithdrawal",
812
+ "outputs": [],
813
+ "stateMutability": "nonpayable",
814
+ "type": "function"
815
+ },
816
+ {
817
+ "inputs": [],
818
+ "name": "cancelSubscription",
819
+ "outputs": [],
820
+ "stateMutability": "nonpayable",
821
+ "type": "function"
822
+ },
823
+ {
824
+ "inputs": [],
825
+ "name": "checkpoint",
826
+ "outputs": [],
827
+ "stateMutability": "nonpayable",
828
+ "type": "function"
829
+ },
830
+ {
831
+ "inputs": [],
832
+ "name": "checkpointIndex",
833
+ "outputs": [
834
+ {
835
+ "internalType": "uint8",
836
+ "name": "",
837
+ "type": "uint8"
838
+ }
839
+ ],
840
+ "stateMutability": "view",
841
+ "type": "function"
842
+ },
843
+ {
844
+ "inputs": [
845
+ {
846
+ "internalType": "uint256",
847
+ "name": "",
848
+ "type": "uint256"
849
+ }
850
+ ],
851
+ "name": "checkpoints",
852
+ "outputs": [
853
+ {
854
+ "internalType": "int64",
855
+ "name": "accountValue",
856
+ "type": "int64"
857
+ },
858
+ {
859
+ "internalType": "uint48",
860
+ "name": "timestamp",
861
+ "type": "uint48"
862
+ },
863
+ {
864
+ "internalType": "bool",
865
+ "name": "profitable",
866
+ "type": "bool"
867
+ }
868
+ ],
869
+ "stateMutability": "view",
870
+ "type": "function"
871
+ },
872
+ {
873
+ "inputs": [],
874
+ "name": "claimSubscriptionFee",
875
+ "outputs": [],
876
+ "stateMutability": "nonpayable",
877
+ "type": "function"
878
+ },
879
+ {
880
+ "inputs": [],
881
+ "name": "claimWithdrawal",
882
+ "outputs": [],
883
+ "stateMutability": "nonpayable",
884
+ "type": "function"
885
+ },
886
+ {
887
+ "inputs": [],
888
+ "name": "closeAndReturn",
889
+ "outputs": [],
890
+ "stateMutability": "nonpayable",
891
+ "type": "function"
892
+ },
893
+ {
894
+ "inputs": [],
895
+ "name": "closedWithPendingProfit",
896
+ "outputs": [
897
+ {
898
+ "internalType": "uint256",
899
+ "name": "",
900
+ "type": "uint256"
901
+ }
902
+ ],
903
+ "stateMutability": "view",
904
+ "type": "function"
905
+ },
906
+ {
907
+ "inputs": [],
908
+ "name": "closingInitiatedAt",
909
+ "outputs": [
910
+ {
911
+ "internalType": "uint48",
912
+ "name": "",
913
+ "type": "uint48"
914
+ }
915
+ ],
916
+ "stateMutability": "view",
917
+ "type": "function"
918
+ },
919
+ {
920
+ "inputs": [],
921
+ "name": "dailyDrawdownEnabled",
922
+ "outputs": [
923
+ {
924
+ "internalType": "bool",
925
+ "name": "",
926
+ "type": "bool"
927
+ }
928
+ ],
929
+ "stateMutability": "view",
930
+ "type": "function"
931
+ },
932
+ {
933
+ "inputs": [],
934
+ "name": "dayStartValue",
935
+ "outputs": [
936
+ {
937
+ "internalType": "uint256",
938
+ "name": "",
939
+ "type": "uint256"
940
+ }
941
+ ],
942
+ "stateMutability": "view",
943
+ "type": "function"
944
+ },
945
+ {
946
+ "inputs": [],
947
+ "name": "drawdownBps",
948
+ "outputs": [
949
+ {
950
+ "internalType": "uint16",
951
+ "name": "",
952
+ "type": "uint16"
953
+ }
954
+ ],
955
+ "stateMutability": "view",
956
+ "type": "function"
957
+ },
958
+ {
959
+ "inputs": [],
960
+ "name": "finalizeReturn",
961
+ "outputs": [],
962
+ "stateMutability": "nonpayable",
963
+ "type": "function"
964
+ },
965
+ {
966
+ "inputs": [],
967
+ "name": "getAllCheckpoints",
968
+ "outputs": [
969
+ {
970
+ "components": [
971
+ {
972
+ "internalType": "int64",
973
+ "name": "accountValue",
974
+ "type": "int64"
975
+ },
976
+ {
977
+ "internalType": "uint48",
978
+ "name": "timestamp",
979
+ "type": "uint48"
980
+ },
981
+ {
982
+ "internalType": "bool",
983
+ "name": "profitable",
984
+ "type": "bool"
985
+ }
986
+ ],
987
+ "internalType": "struct FundedAccount.Checkpoint[7]",
988
+ "name": "",
989
+ "type": "tuple[7]"
990
+ }
991
+ ],
992
+ "stateMutability": "view",
993
+ "type": "function"
994
+ },
995
+ {
996
+ "inputs": [],
997
+ "name": "getDailyFloor",
998
+ "outputs": [
999
+ {
1000
+ "internalType": "uint256",
1001
+ "name": "",
1002
+ "type": "uint256"
1003
+ }
1004
+ ],
1005
+ "stateMutability": "view",
1006
+ "type": "function"
1007
+ },
1008
+ {
1009
+ "inputs": [],
1010
+ "name": "getSubscriptionFee",
1011
+ "outputs": [
1012
+ {
1013
+ "internalType": "uint256",
1014
+ "name": "",
1015
+ "type": "uint256"
1016
+ }
1017
+ ],
1018
+ "stateMutability": "view",
1019
+ "type": "function"
1020
+ },
1021
+ {
1022
+ "inputs": [],
1023
+ "name": "getTrailingFloor",
1024
+ "outputs": [
1025
+ {
1026
+ "internalType": "uint256",
1027
+ "name": "",
1028
+ "type": "uint256"
1029
+ }
1030
+ ],
1031
+ "stateMutability": "view",
1032
+ "type": "function"
1033
+ },
1034
+ {
1035
+ "inputs": [],
1036
+ "name": "highWaterMark",
1037
+ "outputs": [
1038
+ {
1039
+ "internalType": "uint256",
1040
+ "name": "",
1041
+ "type": "uint256"
1042
+ }
1043
+ ],
1044
+ "stateMutability": "view",
1045
+ "type": "function"
1046
+ },
1047
+ {
1048
+ "inputs": [
1049
+ {
1050
+ "internalType": "address",
1051
+ "name": "_usdc",
1052
+ "type": "address"
1053
+ },
1054
+ {
1055
+ "internalType": "address",
1056
+ "name": "_owner",
1057
+ "type": "address"
1058
+ },
1059
+ {
1060
+ "internalType": "address",
1061
+ "name": "_vault",
1062
+ "type": "address"
1063
+ },
1064
+ {
1065
+ "internalType": "address",
1066
+ "name": "_builder",
1067
+ "type": "address"
1068
+ },
1069
+ {
1070
+ "internalType": "uint96",
1071
+ "name": "_accountSize",
1072
+ "type": "uint96"
1073
+ },
1074
+ {
1075
+ "internalType": "uint16",
1076
+ "name": "_drawdownBps",
1077
+ "type": "uint16"
1078
+ },
1079
+ {
1080
+ "internalType": "bool",
1081
+ "name": "_dailyDrawdownEnabled",
1082
+ "type": "bool"
1083
+ },
1084
+ {
1085
+ "internalType": "uint16",
1086
+ "name": "_subscriptionFeeMultiplier",
1087
+ "type": "uint16"
1088
+ }
1089
+ ],
1090
+ "name": "init",
1091
+ "outputs": [],
1092
+ "stateMutability": "nonpayable",
1093
+ "type": "function"
1094
+ },
1095
+ {
1096
+ "inputs": [],
1097
+ "name": "initialize",
1098
+ "outputs": [],
1099
+ "stateMutability": "nonpayable",
1100
+ "type": "function"
1101
+ },
1102
+ {
1103
+ "inputs": [],
1104
+ "name": "initiateClose",
1105
+ "outputs": [],
1106
+ "stateMutability": "nonpayable",
1107
+ "type": "function"
1108
+ },
1109
+ {
1110
+ "inputs": [
1111
+ {
1112
+ "internalType": "uint32",
1113
+ "name": "perpIndex",
1114
+ "type": "uint32"
1115
+ }
1116
+ ],
1117
+ "name": "initiateClose",
1118
+ "outputs": [],
1119
+ "stateMutability": "nonpayable",
1120
+ "type": "function"
1121
+ },
1122
+ {
1123
+ "inputs": [],
1124
+ "name": "initiateCloseAdmin",
1125
+ "outputs": [],
1126
+ "stateMutability": "nonpayable",
1127
+ "type": "function"
1128
+ },
1129
+ {
1130
+ "inputs": [],
1131
+ "name": "isSubscriptionActive",
1132
+ "outputs": [
1133
+ {
1134
+ "internalType": "bool",
1135
+ "name": "",
1136
+ "type": "bool"
1137
+ }
1138
+ ],
1139
+ "stateMutability": "view",
1140
+ "type": "function"
1141
+ },
1142
+ {
1143
+ "inputs": [],
1144
+ "name": "lastCheckpointDay",
1145
+ "outputs": [
1146
+ {
1147
+ "internalType": "uint256",
1148
+ "name": "",
1149
+ "type": "uint256"
1150
+ }
1151
+ ],
1152
+ "stateMutability": "view",
1153
+ "type": "function"
1154
+ },
1155
+ {
1156
+ "inputs": [],
1157
+ "name": "owner",
1158
+ "outputs": [
1159
+ {
1160
+ "internalType": "address",
1161
+ "name": "",
1162
+ "type": "address"
1163
+ }
1164
+ ],
1165
+ "stateMutability": "view",
1166
+ "type": "function"
1167
+ },
1168
+ {
1169
+ "inputs": [],
1170
+ "name": "pendingSubscriptionFee",
1171
+ "outputs": [
1172
+ {
1173
+ "internalType": "uint256",
1174
+ "name": "",
1175
+ "type": "uint256"
1176
+ }
1177
+ ],
1178
+ "stateMutability": "view",
1179
+ "type": "function"
1180
+ },
1181
+ {
1182
+ "inputs": [],
1183
+ "name": "pendingWithdrawal",
1184
+ "outputs": [
1185
+ {
1186
+ "internalType": "uint256",
1187
+ "name": "profit",
1188
+ "type": "uint256"
1189
+ },
1190
+ {
1191
+ "internalType": "uint48",
1192
+ "name": "requestedAt",
1193
+ "type": "uint48"
1194
+ }
1195
+ ],
1196
+ "stateMutability": "view",
1197
+ "type": "function"
1198
+ },
1199
+ {
1200
+ "inputs": [],
1201
+ "name": "profitableDaysCount",
1202
+ "outputs": [
1203
+ {
1204
+ "internalType": "uint8",
1205
+ "name": "",
1206
+ "type": "uint8"
1207
+ }
1208
+ ],
1209
+ "stateMutability": "view",
1210
+ "type": "function"
1211
+ },
1212
+ {
1213
+ "inputs": [],
1214
+ "name": "requestWithdrawProfit",
1215
+ "outputs": [],
1216
+ "stateMutability": "nonpayable",
1217
+ "type": "function"
1218
+ },
1219
+ {
1220
+ "inputs": [],
1221
+ "name": "rescueStuckFunds",
1222
+ "outputs": [],
1223
+ "stateMutability": "nonpayable",
1224
+ "type": "function"
1225
+ },
1226
+ {
1227
+ "inputs": [],
1228
+ "name": "returnInitiatedAt",
1229
+ "outputs": [
1230
+ {
1231
+ "internalType": "uint48",
1232
+ "name": "",
1233
+ "type": "uint48"
1234
+ }
1235
+ ],
1236
+ "stateMutability": "view",
1237
+ "type": "function"
1238
+ },
1239
+ {
1240
+ "inputs": [],
1241
+ "name": "riskEngineWallet",
1242
+ "outputs": [
1243
+ {
1244
+ "internalType": "address",
1245
+ "name": "",
1246
+ "type": "address"
1247
+ }
1248
+ ],
1249
+ "stateMutability": "view",
1250
+ "type": "function"
1251
+ },
1252
+ {
1253
+ "inputs": [
1254
+ {
1255
+ "internalType": "address",
1256
+ "name": "_wallet",
1257
+ "type": "address"
1258
+ }
1259
+ ],
1260
+ "name": "setApiWallet",
1261
+ "outputs": [],
1262
+ "stateMutability": "nonpayable",
1263
+ "type": "function"
1264
+ },
1265
+ {
1266
+ "inputs": [
1267
+ {
1268
+ "internalType": "address",
1269
+ "name": "_wallet",
1270
+ "type": "address"
1271
+ }
1272
+ ],
1273
+ "name": "setRiskEngineWallet",
1274
+ "outputs": [],
1275
+ "stateMutability": "nonpayable",
1276
+ "type": "function"
1277
+ },
1278
+ {
1279
+ "inputs": [],
1280
+ "name": "state",
1281
+ "outputs": [
1282
+ {
1283
+ "internalType": "enum FundedAccount.State",
1284
+ "name": "",
1285
+ "type": "uint8"
1286
+ }
1287
+ ],
1288
+ "stateMutability": "view",
1289
+ "type": "function"
1290
+ },
1291
+ {
1292
+ "inputs": [],
1293
+ "name": "subscriptionCancelled",
1294
+ "outputs": [
1295
+ {
1296
+ "internalType": "bool",
1297
+ "name": "",
1298
+ "type": "bool"
1299
+ }
1300
+ ],
1301
+ "stateMutability": "view",
1302
+ "type": "function"
1303
+ },
1304
+ {
1305
+ "inputs": [],
1306
+ "name": "subscriptionFeeMultiplier",
1307
+ "outputs": [
1308
+ {
1309
+ "internalType": "uint16",
1310
+ "name": "",
1311
+ "type": "uint16"
1312
+ }
1313
+ ],
1314
+ "stateMutability": "view",
1315
+ "type": "function"
1316
+ },
1317
+ {
1318
+ "inputs": [],
1319
+ "name": "subscriptionPaidUntil",
1320
+ "outputs": [
1321
+ {
1322
+ "internalType": "uint256",
1323
+ "name": "",
1324
+ "type": "uint256"
1325
+ }
1326
+ ],
1327
+ "stateMutability": "view",
1328
+ "type": "function"
1329
+ },
1330
+ {
1331
+ "inputs": [],
1332
+ "name": "totalCheckpoints",
1333
+ "outputs": [
1334
+ {
1335
+ "internalType": "uint8",
1336
+ "name": "",
1337
+ "type": "uint8"
1338
+ }
1339
+ ],
1340
+ "stateMutability": "view",
1341
+ "type": "function"
1342
+ },
1343
+ {
1344
+ "inputs": [],
1345
+ "name": "usdc",
1346
+ "outputs": [
1347
+ {
1348
+ "internalType": "contract IERC20",
1349
+ "name": "",
1350
+ "type": "address"
1351
+ }
1352
+ ],
1353
+ "stateMutability": "view",
1354
+ "type": "function"
1355
+ },
1356
+ {
1357
+ "inputs": [],
1358
+ "name": "vault",
1359
+ "outputs": [
1360
+ {
1361
+ "internalType": "address",
1362
+ "name": "",
1363
+ "type": "address"
1364
+ }
1365
+ ],
1366
+ "stateMutability": "view",
1367
+ "type": "function"
1368
+ },
1369
+ {
1370
+ "stateMutability": "payable",
1371
+ "type": "receive"
1372
+ }
1373
+ ];