@hodlmarkets/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 (68) hide show
  1. package/README.md +121 -0
  2. package/dist/accounts.cjs +1893 -0
  3. package/dist/accounts.cjs.map +1 -0
  4. package/dist/accounts.d.cts +9 -0
  5. package/dist/accounts.d.ts +9 -0
  6. package/dist/accounts.js +1885 -0
  7. package/dist/accounts.js.map +1 -0
  8. package/dist/client.cjs +2161 -0
  9. package/dist/client.cjs.map +1 -0
  10. package/dist/client.d.cts +44 -0
  11. package/dist/client.d.ts +44 -0
  12. package/dist/client.js +2155 -0
  13. package/dist/client.js.map +1 -0
  14. package/dist/constants.cjs +68 -0
  15. package/dist/constants.cjs.map +1 -0
  16. package/dist/constants.d.cts +62 -0
  17. package/dist/constants.d.ts +62 -0
  18. package/dist/constants.js +50 -0
  19. package/dist/constants.js.map +1 -0
  20. package/dist/errors.cjs +43 -0
  21. package/dist/errors.cjs.map +1 -0
  22. package/dist/errors.d.cts +8 -0
  23. package/dist/errors.d.ts +8 -0
  24. package/dist/errors.js +39 -0
  25. package/dist/errors.js.map +1 -0
  26. package/dist/events.cjs +1923 -0
  27. package/dist/events.cjs.map +1 -0
  28. package/dist/events.d.cts +20 -0
  29. package/dist/events.d.ts +20 -0
  30. package/dist/events.js +1913 -0
  31. package/dist/events.js.map +1 -0
  32. package/dist/index.cjs +2357 -0
  33. package/dist/index.cjs.map +1 -0
  34. package/dist/index.d.cts +12 -0
  35. package/dist/index.d.ts +12 -0
  36. package/dist/index.js +2302 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/instructions.cjs +2022 -0
  39. package/dist/instructions.cjs.map +1 -0
  40. package/dist/instructions.d.cts +38 -0
  41. package/dist/instructions.d.ts +38 -0
  42. package/dist/instructions.js +2012 -0
  43. package/dist/instructions.js.map +1 -0
  44. package/dist/math.cjs +98 -0
  45. package/dist/math.cjs.map +1 -0
  46. package/dist/math.d.cts +58 -0
  47. package/dist/math.d.ts +58 -0
  48. package/dist/math.js +85 -0
  49. package/dist/math.js.map +1 -0
  50. package/dist/pda.cjs +52 -0
  51. package/dist/pda.cjs.map +1 -0
  52. package/dist/pda.d.cts +10 -0
  53. package/dist/pda.d.ts +10 -0
  54. package/dist/pda.js +41 -0
  55. package/dist/pda.js.map +1 -0
  56. package/dist/transaction.cjs +37 -0
  57. package/dist/transaction.cjs.map +1 -0
  58. package/dist/transaction.d.cts +11 -0
  59. package/dist/transaction.d.ts +11 -0
  60. package/dist/transaction.js +34 -0
  61. package/dist/transaction.js.map +1 -0
  62. package/dist/types.cjs +4 -0
  63. package/dist/types.cjs.map +1 -0
  64. package/dist/types.d.cts +153 -0
  65. package/dist/types.d.ts +153 -0
  66. package/dist/types.js +3 -0
  67. package/dist/types.js.map +1 -0
  68. package/package.json +96 -0
@@ -0,0 +1,1885 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import BN from 'bn.js';
3
+ import { AnchorProvider, Program } from '@coral-xyz/anchor';
4
+
5
+ // src/pda.ts
6
+ new PublicKey("hodLrUfwyK3Z7Td5hdZhyojyznG1rqbHVex11y5s4yG");
7
+ new PublicKey("EFAquDGAHjkoPB6TGKVibD3BYhbFXNDjuXKpiBHdYzji");
8
+ new BN("30000000000");
9
+ new BN("1000000000000000");
10
+ new BN("100000000");
11
+ var SEEDS = {
12
+ POOL: Buffer.from("pool"),
13
+ VAULT_AUTHORITY: Buffer.from("vault_authority"),
14
+ SOL_VAULT: Buffer.from("sol_vault"),
15
+ POSITION: Buffer.from("position"),
16
+ PROTOCOL_FEES: Buffer.from("protocol_fees"),
17
+ EVENT_AUTHORITY: Buffer.from("__event_authority")
18
+ };
19
+
20
+ // src/pda.ts
21
+ function getPoolStatePDA(mint, programId) {
22
+ return PublicKey.findProgramAddressSync([SEEDS.POOL, mint.toBuffer()], programId);
23
+ }
24
+ function getPositionPDA(poolState, owner, programId) {
25
+ return PublicKey.findProgramAddressSync([SEEDS.POSITION, poolState.toBuffer(), owner.toBuffer()], programId);
26
+ }
27
+
28
+ // src/idl/hodl.json
29
+ var hodl_default = {
30
+ address: "hodLrUfwyK3Z7Td5hdZhyojyznG1rqbHVex11y5s4yG",
31
+ metadata: {
32
+ name: "hodl",
33
+ version: "0.1.0",
34
+ spec: "0.1.0"
35
+ },
36
+ instructions: [
37
+ {
38
+ name: "buy",
39
+ docs: [
40
+ "Buy tokens from the vAMM",
41
+ "",
42
+ "Tokens are split into tradable (immediate) and vaulted (accrue linearly).",
43
+ "Allocation is based on token-amount range bands: 40/60 at 0-50M, +5% per 50M band, 100/0 at 600M+.",
44
+ "After vest_duration passes, all buys are 100% tradable."
45
+ ],
46
+ discriminator: [
47
+ 102,
48
+ 6,
49
+ 61,
50
+ 18,
51
+ 1,
52
+ 218,
53
+ 235,
54
+ 234
55
+ ],
56
+ accounts: [
57
+ {
58
+ name: "buyer",
59
+ writable: true,
60
+ signer: true
61
+ },
62
+ {
63
+ name: "pool_state",
64
+ writable: true,
65
+ pda: {
66
+ seeds: [
67
+ {
68
+ kind: "const",
69
+ value: [
70
+ 112,
71
+ 111,
72
+ 111,
73
+ 108
74
+ ]
75
+ },
76
+ {
77
+ kind: "account",
78
+ path: "mint"
79
+ }
80
+ ]
81
+ }
82
+ },
83
+ {
84
+ name: "token_vault",
85
+ writable: true
86
+ },
87
+ {
88
+ name: "vault_authority",
89
+ pda: {
90
+ seeds: [
91
+ {
92
+ kind: "const",
93
+ value: [
94
+ 118,
95
+ 97,
96
+ 117,
97
+ 108,
98
+ 116,
99
+ 95,
100
+ 97,
101
+ 117,
102
+ 116,
103
+ 104,
104
+ 111,
105
+ 114,
106
+ 105,
107
+ 116,
108
+ 121
109
+ ]
110
+ },
111
+ {
112
+ kind: "account",
113
+ path: "pool_state"
114
+ }
115
+ ]
116
+ }
117
+ },
118
+ {
119
+ name: "buyer_token_account",
120
+ writable: true,
121
+ pda: {
122
+ seeds: [
123
+ {
124
+ kind: "account",
125
+ path: "buyer"
126
+ },
127
+ {
128
+ kind: "const",
129
+ value: [
130
+ 6,
131
+ 221,
132
+ 246,
133
+ 225,
134
+ 215,
135
+ 101,
136
+ 161,
137
+ 147,
138
+ 217,
139
+ 203,
140
+ 225,
141
+ 70,
142
+ 206,
143
+ 235,
144
+ 121,
145
+ 172,
146
+ 28,
147
+ 180,
148
+ 133,
149
+ 237,
150
+ 95,
151
+ 91,
152
+ 55,
153
+ 145,
154
+ 58,
155
+ 140,
156
+ 245,
157
+ 133,
158
+ 126,
159
+ 255,
160
+ 0,
161
+ 169
162
+ ]
163
+ },
164
+ {
165
+ kind: "account",
166
+ path: "mint"
167
+ }
168
+ ],
169
+ program: {
170
+ kind: "const",
171
+ value: [
172
+ 140,
173
+ 151,
174
+ 37,
175
+ 143,
176
+ 78,
177
+ 36,
178
+ 137,
179
+ 241,
180
+ 187,
181
+ 61,
182
+ 16,
183
+ 41,
184
+ 20,
185
+ 142,
186
+ 13,
187
+ 131,
188
+ 11,
189
+ 90,
190
+ 19,
191
+ 153,
192
+ 218,
193
+ 255,
194
+ 16,
195
+ 132,
196
+ 4,
197
+ 142,
198
+ 123,
199
+ 216,
200
+ 219,
201
+ 233,
202
+ 248,
203
+ 89
204
+ ]
205
+ }
206
+ }
207
+ },
208
+ {
209
+ name: "pool_sol_account",
210
+ writable: true,
211
+ pda: {
212
+ seeds: [
213
+ {
214
+ kind: "const",
215
+ value: [
216
+ 115,
217
+ 111,
218
+ 108,
219
+ 95,
220
+ 118,
221
+ 97,
222
+ 117,
223
+ 108,
224
+ 116
225
+ ]
226
+ },
227
+ {
228
+ kind: "account",
229
+ path: "pool_state"
230
+ }
231
+ ]
232
+ }
233
+ },
234
+ {
235
+ name: "mint"
236
+ },
237
+ {
238
+ name: "token_program",
239
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
240
+ },
241
+ {
242
+ name: "associated_token_program",
243
+ address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
244
+ },
245
+ {
246
+ name: "system_program",
247
+ address: "11111111111111111111111111111111"
248
+ },
249
+ {
250
+ name: "position",
251
+ writable: true,
252
+ pda: {
253
+ seeds: [
254
+ {
255
+ kind: "const",
256
+ value: [
257
+ 112,
258
+ 111,
259
+ 115,
260
+ 105,
261
+ 116,
262
+ 105,
263
+ 111,
264
+ 110
265
+ ]
266
+ },
267
+ {
268
+ kind: "account",
269
+ path: "pool_state"
270
+ },
271
+ {
272
+ kind: "account",
273
+ path: "buyer"
274
+ }
275
+ ]
276
+ }
277
+ },
278
+ {
279
+ name: "event_authority",
280
+ pda: {
281
+ seeds: [
282
+ {
283
+ kind: "const",
284
+ value: [
285
+ 95,
286
+ 95,
287
+ 101,
288
+ 118,
289
+ 101,
290
+ 110,
291
+ 116,
292
+ 95,
293
+ 97,
294
+ 117,
295
+ 116,
296
+ 104,
297
+ 111,
298
+ 114,
299
+ 105,
300
+ 116,
301
+ 121
302
+ ]
303
+ }
304
+ ]
305
+ }
306
+ },
307
+ {
308
+ name: "program"
309
+ }
310
+ ],
311
+ args: [
312
+ {
313
+ name: "sol_amount",
314
+ type: "u64"
315
+ },
316
+ {
317
+ name: "min_tokens_out",
318
+ type: "u64"
319
+ }
320
+ ]
321
+ },
322
+ {
323
+ name: "claim_accrued",
324
+ docs: [
325
+ "Claim accrued tokens",
326
+ "Transfers tokens that have accrued from vaulted to tradable from vault to wallet"
327
+ ],
328
+ discriminator: [
329
+ 209,
330
+ 92,
331
+ 30,
332
+ 216,
333
+ 89,
334
+ 249,
335
+ 122,
336
+ 243
337
+ ],
338
+ accounts: [
339
+ {
340
+ name: "owner",
341
+ signer: true
342
+ },
343
+ {
344
+ name: "pool_state",
345
+ writable: true,
346
+ pda: {
347
+ seeds: [
348
+ {
349
+ kind: "const",
350
+ value: [
351
+ 112,
352
+ 111,
353
+ 111,
354
+ 108
355
+ ]
356
+ },
357
+ {
358
+ kind: "account",
359
+ path: "pool_state.mint",
360
+ account: "PoolState"
361
+ }
362
+ ]
363
+ }
364
+ },
365
+ {
366
+ name: "position",
367
+ writable: true,
368
+ pda: {
369
+ seeds: [
370
+ {
371
+ kind: "const",
372
+ value: [
373
+ 112,
374
+ 111,
375
+ 115,
376
+ 105,
377
+ 116,
378
+ 105,
379
+ 111,
380
+ 110
381
+ ]
382
+ },
383
+ {
384
+ kind: "account",
385
+ path: "pool_state"
386
+ },
387
+ {
388
+ kind: "account",
389
+ path: "owner"
390
+ }
391
+ ]
392
+ }
393
+ },
394
+ {
395
+ name: "token_vault",
396
+ writable: true
397
+ },
398
+ {
399
+ name: "vault_authority",
400
+ pda: {
401
+ seeds: [
402
+ {
403
+ kind: "const",
404
+ value: [
405
+ 118,
406
+ 97,
407
+ 117,
408
+ 108,
409
+ 116,
410
+ 95,
411
+ 97,
412
+ 117,
413
+ 116,
414
+ 104,
415
+ 111,
416
+ 114,
417
+ 105,
418
+ 116,
419
+ 121
420
+ ]
421
+ },
422
+ {
423
+ kind: "account",
424
+ path: "pool_state"
425
+ }
426
+ ]
427
+ }
428
+ },
429
+ {
430
+ name: "user_token_account",
431
+ writable: true
432
+ },
433
+ {
434
+ name: "token_program",
435
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
436
+ },
437
+ {
438
+ name: "event_authority",
439
+ pda: {
440
+ seeds: [
441
+ {
442
+ kind: "const",
443
+ value: [
444
+ 95,
445
+ 95,
446
+ 101,
447
+ 118,
448
+ 101,
449
+ 110,
450
+ 116,
451
+ 95,
452
+ 97,
453
+ 117,
454
+ 116,
455
+ 104,
456
+ 111,
457
+ 114,
458
+ 105,
459
+ 116,
460
+ 121
461
+ ]
462
+ }
463
+ ]
464
+ }
465
+ },
466
+ {
467
+ name: "program"
468
+ }
469
+ ],
470
+ args: []
471
+ },
472
+ {
473
+ name: "close_position",
474
+ docs: [
475
+ "Close an empty position account and reclaim rent"
476
+ ],
477
+ discriminator: [
478
+ 123,
479
+ 134,
480
+ 81,
481
+ 0,
482
+ 49,
483
+ 68,
484
+ 98,
485
+ 98
486
+ ],
487
+ accounts: [
488
+ {
489
+ name: "owner",
490
+ writable: true,
491
+ signer: true
492
+ },
493
+ {
494
+ name: "pool_state",
495
+ writable: true
496
+ },
497
+ {
498
+ name: "position",
499
+ writable: true,
500
+ pda: {
501
+ seeds: [
502
+ {
503
+ kind: "const",
504
+ value: [
505
+ 112,
506
+ 111,
507
+ 115,
508
+ 105,
509
+ 116,
510
+ 105,
511
+ 111,
512
+ 110
513
+ ]
514
+ },
515
+ {
516
+ kind: "account",
517
+ path: "pool_state"
518
+ },
519
+ {
520
+ kind: "account",
521
+ path: "owner"
522
+ }
523
+ ]
524
+ }
525
+ },
526
+ {
527
+ name: "user_token_account",
528
+ writable: true
529
+ },
530
+ {
531
+ name: "mint"
532
+ },
533
+ {
534
+ name: "token_program",
535
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
536
+ },
537
+ {
538
+ name: "system_program",
539
+ address: "11111111111111111111111111111111"
540
+ },
541
+ {
542
+ name: "event_authority",
543
+ pda: {
544
+ seeds: [
545
+ {
546
+ kind: "const",
547
+ value: [
548
+ 95,
549
+ 95,
550
+ 101,
551
+ 118,
552
+ 101,
553
+ 110,
554
+ 116,
555
+ 95,
556
+ 97,
557
+ 117,
558
+ 116,
559
+ 104,
560
+ 111,
561
+ 114,
562
+ 105,
563
+ 116,
564
+ 121
565
+ ]
566
+ }
567
+ ]
568
+ }
569
+ },
570
+ {
571
+ name: "program"
572
+ }
573
+ ],
574
+ args: []
575
+ },
576
+ {
577
+ name: "create_token",
578
+ docs: [
579
+ "Create a new token and initialize vAMM pool"
580
+ ],
581
+ discriminator: [
582
+ 84,
583
+ 52,
584
+ 204,
585
+ 228,
586
+ 24,
587
+ 140,
588
+ 234,
589
+ 75
590
+ ],
591
+ accounts: [
592
+ {
593
+ name: "creator",
594
+ writable: true,
595
+ signer: true
596
+ },
597
+ {
598
+ name: "protocol_authority"
599
+ },
600
+ {
601
+ name: "mint",
602
+ writable: true,
603
+ signer: true
604
+ },
605
+ {
606
+ name: "pool_state",
607
+ writable: true,
608
+ pda: {
609
+ seeds: [
610
+ {
611
+ kind: "const",
612
+ value: [
613
+ 112,
614
+ 111,
615
+ 111,
616
+ 108
617
+ ]
618
+ },
619
+ {
620
+ kind: "account",
621
+ path: "mint"
622
+ }
623
+ ]
624
+ }
625
+ },
626
+ {
627
+ name: "token_vault",
628
+ writable: true
629
+ },
630
+ {
631
+ name: "vault_authority",
632
+ pda: {
633
+ seeds: [
634
+ {
635
+ kind: "const",
636
+ value: [
637
+ 118,
638
+ 97,
639
+ 117,
640
+ 108,
641
+ 116,
642
+ 95,
643
+ 97,
644
+ 117,
645
+ 116,
646
+ 104,
647
+ 111,
648
+ 114,
649
+ 105,
650
+ 116,
651
+ 121
652
+ ]
653
+ },
654
+ {
655
+ kind: "account",
656
+ path: "pool_state"
657
+ }
658
+ ]
659
+ }
660
+ },
661
+ {
662
+ name: "metadata",
663
+ writable: true
664
+ },
665
+ {
666
+ name: "pool_sol_account",
667
+ writable: true
668
+ },
669
+ {
670
+ name: "protocol_fee_wallet",
671
+ writable: true,
672
+ pda: {
673
+ seeds: [
674
+ {
675
+ kind: "const",
676
+ value: [
677
+ 112,
678
+ 114,
679
+ 111,
680
+ 116,
681
+ 111,
682
+ 99,
683
+ 111,
684
+ 108,
685
+ 95,
686
+ 102,
687
+ 101,
688
+ 101,
689
+ 115
690
+ ]
691
+ }
692
+ ]
693
+ }
694
+ },
695
+ {
696
+ name: "token_program",
697
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
698
+ },
699
+ {
700
+ name: "associated_token_program",
701
+ address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
702
+ },
703
+ {
704
+ name: "system_program",
705
+ address: "11111111111111111111111111111111"
706
+ },
707
+ {
708
+ name: "rent",
709
+ address: "SysvarRent111111111111111111111111111111111"
710
+ },
711
+ {
712
+ name: "metadata_program"
713
+ },
714
+ {
715
+ name: "sysvar_instructions"
716
+ },
717
+ {
718
+ name: "event_authority",
719
+ pda: {
720
+ seeds: [
721
+ {
722
+ kind: "const",
723
+ value: [
724
+ 95,
725
+ 95,
726
+ 101,
727
+ 118,
728
+ 101,
729
+ 110,
730
+ 116,
731
+ 95,
732
+ 97,
733
+ 117,
734
+ 116,
735
+ 104,
736
+ 111,
737
+ 114,
738
+ 105,
739
+ 116,
740
+ 121
741
+ ]
742
+ }
743
+ ]
744
+ }
745
+ },
746
+ {
747
+ name: "program"
748
+ }
749
+ ],
750
+ args: [
751
+ {
752
+ name: "name",
753
+ type: "string"
754
+ },
755
+ {
756
+ name: "symbol",
757
+ type: "string"
758
+ },
759
+ {
760
+ name: "uri",
761
+ type: "string"
762
+ },
763
+ {
764
+ name: "pool_description",
765
+ type: "string"
766
+ },
767
+ {
768
+ name: "vest_duration",
769
+ type: "i64"
770
+ }
771
+ ]
772
+ },
773
+ {
774
+ name: "emergency_withdraw_sol",
775
+ docs: [
776
+ "Emergency withdraw SOL from a pool's sol_vault"
777
+ ],
778
+ discriminator: [
779
+ 219,
780
+ 156,
781
+ 123,
782
+ 176,
783
+ 91,
784
+ 105,
785
+ 30,
786
+ 160
787
+ ],
788
+ accounts: [
789
+ {
790
+ name: "authority",
791
+ writable: true,
792
+ signer: true
793
+ },
794
+ {
795
+ name: "pool_state"
796
+ },
797
+ {
798
+ name: "sol_vault",
799
+ writable: true,
800
+ pda: {
801
+ seeds: [
802
+ {
803
+ kind: "const",
804
+ value: [
805
+ 115,
806
+ 111,
807
+ 108,
808
+ 95,
809
+ 118,
810
+ 97,
811
+ 117,
812
+ 108,
813
+ 116
814
+ ]
815
+ },
816
+ {
817
+ kind: "account",
818
+ path: "pool_state"
819
+ }
820
+ ]
821
+ }
822
+ },
823
+ {
824
+ name: "system_program",
825
+ address: "11111111111111111111111111111111"
826
+ }
827
+ ],
828
+ args: [
829
+ {
830
+ name: "amount",
831
+ type: "u64"
832
+ }
833
+ ]
834
+ },
835
+ {
836
+ name: "sell",
837
+ docs: [
838
+ "Sell tokens back to the vAMM",
839
+ "If sell_percentage is provided, it overrides token_amount"
840
+ ],
841
+ discriminator: [
842
+ 51,
843
+ 230,
844
+ 133,
845
+ 164,
846
+ 1,
847
+ 127,
848
+ 131,
849
+ 173
850
+ ],
851
+ accounts: [
852
+ {
853
+ name: "seller",
854
+ writable: true,
855
+ signer: true
856
+ },
857
+ {
858
+ name: "pool_state",
859
+ writable: true,
860
+ pda: {
861
+ seeds: [
862
+ {
863
+ kind: "const",
864
+ value: [
865
+ 112,
866
+ 111,
867
+ 111,
868
+ 108
869
+ ]
870
+ },
871
+ {
872
+ kind: "account",
873
+ path: "mint"
874
+ }
875
+ ]
876
+ }
877
+ },
878
+ {
879
+ name: "position",
880
+ writable: true,
881
+ pda: {
882
+ seeds: [
883
+ {
884
+ kind: "const",
885
+ value: [
886
+ 112,
887
+ 111,
888
+ 115,
889
+ 105,
890
+ 116,
891
+ 105,
892
+ 111,
893
+ 110
894
+ ]
895
+ },
896
+ {
897
+ kind: "account",
898
+ path: "pool_state"
899
+ },
900
+ {
901
+ kind: "account",
902
+ path: "seller"
903
+ }
904
+ ]
905
+ }
906
+ },
907
+ {
908
+ name: "token_vault",
909
+ writable: true
910
+ },
911
+ {
912
+ name: "vault_authority",
913
+ pda: {
914
+ seeds: [
915
+ {
916
+ kind: "const",
917
+ value: [
918
+ 118,
919
+ 97,
920
+ 117,
921
+ 108,
922
+ 116,
923
+ 95,
924
+ 97,
925
+ 117,
926
+ 116,
927
+ 104,
928
+ 111,
929
+ 114,
930
+ 105,
931
+ 116,
932
+ 121
933
+ ]
934
+ },
935
+ {
936
+ kind: "account",
937
+ path: "pool_state"
938
+ }
939
+ ]
940
+ }
941
+ },
942
+ {
943
+ name: "seller_token_account",
944
+ writable: true
945
+ },
946
+ {
947
+ name: "pool_sol_account",
948
+ writable: true,
949
+ pda: {
950
+ seeds: [
951
+ {
952
+ kind: "const",
953
+ value: [
954
+ 115,
955
+ 111,
956
+ 108,
957
+ 95,
958
+ 118,
959
+ 97,
960
+ 117,
961
+ 108,
962
+ 116
963
+ ]
964
+ },
965
+ {
966
+ kind: "account",
967
+ path: "pool_state"
968
+ }
969
+ ]
970
+ }
971
+ },
972
+ {
973
+ name: "mint"
974
+ },
975
+ {
976
+ name: "token_program",
977
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
978
+ },
979
+ {
980
+ name: "system_program",
981
+ address: "11111111111111111111111111111111"
982
+ },
983
+ {
984
+ name: "event_authority",
985
+ pda: {
986
+ seeds: [
987
+ {
988
+ kind: "const",
989
+ value: [
990
+ 95,
991
+ 95,
992
+ 101,
993
+ 118,
994
+ 101,
995
+ 110,
996
+ 116,
997
+ 95,
998
+ 97,
999
+ 117,
1000
+ 116,
1001
+ 104,
1002
+ 111,
1003
+ 114,
1004
+ 105,
1005
+ 116,
1006
+ 121
1007
+ ]
1008
+ }
1009
+ ]
1010
+ }
1011
+ },
1012
+ {
1013
+ name: "program"
1014
+ }
1015
+ ],
1016
+ args: [
1017
+ {
1018
+ name: "token_amount",
1019
+ type: "u64"
1020
+ },
1021
+ {
1022
+ name: "min_sol_out",
1023
+ type: "u64"
1024
+ },
1025
+ {
1026
+ name: "sell_percentage",
1027
+ type: {
1028
+ option: "u8"
1029
+ }
1030
+ }
1031
+ ]
1032
+ },
1033
+ {
1034
+ name: "withdraw_protocol_fees",
1035
+ docs: [
1036
+ "Withdraw accumulated protocol fees"
1037
+ ],
1038
+ discriminator: [
1039
+ 11,
1040
+ 68,
1041
+ 165,
1042
+ 98,
1043
+ 18,
1044
+ 208,
1045
+ 134,
1046
+ 73
1047
+ ],
1048
+ accounts: [
1049
+ {
1050
+ name: "authority",
1051
+ writable: true,
1052
+ signer: true
1053
+ },
1054
+ {
1055
+ name: "protocol_fee_wallet",
1056
+ writable: true,
1057
+ pda: {
1058
+ seeds: [
1059
+ {
1060
+ kind: "const",
1061
+ value: [
1062
+ 112,
1063
+ 114,
1064
+ 111,
1065
+ 116,
1066
+ 111,
1067
+ 99,
1068
+ 111,
1069
+ 108,
1070
+ 95,
1071
+ 102,
1072
+ 101,
1073
+ 101,
1074
+ 115
1075
+ ]
1076
+ }
1077
+ ]
1078
+ }
1079
+ },
1080
+ {
1081
+ name: "system_program",
1082
+ address: "11111111111111111111111111111111"
1083
+ }
1084
+ ],
1085
+ args: [
1086
+ {
1087
+ name: "amount",
1088
+ type: "u64"
1089
+ }
1090
+ ]
1091
+ }
1092
+ ],
1093
+ accounts: [
1094
+ {
1095
+ name: "PoolState",
1096
+ discriminator: [
1097
+ 247,
1098
+ 237,
1099
+ 227,
1100
+ 245,
1101
+ 215,
1102
+ 195,
1103
+ 222,
1104
+ 70
1105
+ ]
1106
+ },
1107
+ {
1108
+ name: "Position",
1109
+ discriminator: [
1110
+ 170,
1111
+ 188,
1112
+ 143,
1113
+ 228,
1114
+ 122,
1115
+ 64,
1116
+ 247,
1117
+ 208
1118
+ ]
1119
+ }
1120
+ ],
1121
+ events: [
1122
+ {
1123
+ name: "AccrualClaimed",
1124
+ discriminator: [
1125
+ 86,
1126
+ 99,
1127
+ 51,
1128
+ 211,
1129
+ 226,
1130
+ 48,
1131
+ 235,
1132
+ 238
1133
+ ]
1134
+ },
1135
+ {
1136
+ name: "PositionClosed",
1137
+ discriminator: [
1138
+ 157,
1139
+ 163,
1140
+ 227,
1141
+ 228,
1142
+ 13,
1143
+ 97,
1144
+ 138,
1145
+ 121
1146
+ ]
1147
+ },
1148
+ {
1149
+ name: "TokenCreated",
1150
+ discriminator: [
1151
+ 236,
1152
+ 19,
1153
+ 41,
1154
+ 255,
1155
+ 130,
1156
+ 78,
1157
+ 147,
1158
+ 172
1159
+ ]
1160
+ },
1161
+ {
1162
+ name: "TokenPurchased",
1163
+ discriminator: [
1164
+ 3,
1165
+ 73,
1166
+ 186,
1167
+ 50,
1168
+ 15,
1169
+ 181,
1170
+ 213,
1171
+ 37
1172
+ ]
1173
+ },
1174
+ {
1175
+ name: "TokenSold",
1176
+ discriminator: [
1177
+ 88,
1178
+ 61,
1179
+ 1,
1180
+ 247,
1181
+ 185,
1182
+ 6,
1183
+ 252,
1184
+ 86
1185
+ ]
1186
+ }
1187
+ ],
1188
+ errors: [
1189
+ {
1190
+ code: 7005,
1191
+ name: "InsufficientTokens",
1192
+ msg: "Insufficient token reserves in vault"
1193
+ },
1194
+ {
1195
+ code: 7100,
1196
+ name: "ArithmeticOverflow",
1197
+ msg: "Arithmetic overflow"
1198
+ },
1199
+ {
1200
+ code: 7102,
1201
+ name: "DivisionError",
1202
+ msg: "Division by zero or invalid division"
1203
+ },
1204
+ {
1205
+ code: 7104,
1206
+ name: "TokenOverflow",
1207
+ msg: "Token calculation overflow"
1208
+ },
1209
+ {
1210
+ code: 7105,
1211
+ name: "TokenUnderflow",
1212
+ msg: "Token calculation underflow"
1213
+ },
1214
+ {
1215
+ code: 7200,
1216
+ name: "SlippageExceeded",
1217
+ msg: "Slippage exceeded: output below minimum threshold"
1218
+ },
1219
+ {
1220
+ code: 7312,
1221
+ name: "AccrualCalculationOverflow",
1222
+ msg: "Accrual calculation overflow"
1223
+ },
1224
+ {
1225
+ code: 7315,
1226
+ name: "PositionNotEmpty",
1227
+ msg: "Position is not empty, must sell all tokens first"
1228
+ },
1229
+ {
1230
+ code: 7319,
1231
+ name: "InvalidProtocolAuthority",
1232
+ msg: "Invalid protocol authority - must match PROTOCOL_AUTHORITY constant"
1233
+ },
1234
+ {
1235
+ code: 7321,
1236
+ name: "MustHaveUnlockedPortion",
1237
+ msg: "Position must have tokens to perform this operation"
1238
+ },
1239
+ {
1240
+ code: 7500,
1241
+ name: "PositionNotOwnedBySigner",
1242
+ msg: "Position not owned by signer"
1243
+ },
1244
+ {
1245
+ code: 7505,
1246
+ name: "InvalidSolVaultPDA",
1247
+ msg: "SOL vault PDA derivation mismatch"
1248
+ },
1249
+ {
1250
+ code: 7601,
1251
+ name: "InvalidVestingType",
1252
+ msg: "Invalid vesting type"
1253
+ },
1254
+ {
1255
+ code: 7604,
1256
+ name: "InvalidPercentage",
1257
+ msg: "Invalid percentage value (must be 0-100)"
1258
+ },
1259
+ {
1260
+ code: 7901,
1261
+ name: "NotAuthorized",
1262
+ msg: "Not authorized"
1263
+ },
1264
+ {
1265
+ code: 8014,
1266
+ name: "InsufficientLiquidity",
1267
+ msg: "Insufficient liquidity"
1268
+ },
1269
+ {
1270
+ code: 8018,
1271
+ name: "VammNotActive",
1272
+ msg: "vAMM is not active"
1273
+ },
1274
+ {
1275
+ code: 8020,
1276
+ name: "InvalidAmount",
1277
+ msg: "Invalid amount"
1278
+ }
1279
+ ],
1280
+ types: [
1281
+ {
1282
+ name: "AccrualClaimed",
1283
+ docs: [
1284
+ "Event emitted when accrued tokens are claimed"
1285
+ ],
1286
+ type: {
1287
+ kind: "struct",
1288
+ fields: [
1289
+ {
1290
+ name: "owner",
1291
+ type: "pubkey"
1292
+ },
1293
+ {
1294
+ name: "pool",
1295
+ type: "pubkey"
1296
+ },
1297
+ {
1298
+ name: "position",
1299
+ type: "pubkey"
1300
+ },
1301
+ {
1302
+ name: "tokens_claimed",
1303
+ type: "u64"
1304
+ },
1305
+ {
1306
+ name: "new_tradable_tokens",
1307
+ type: "u64"
1308
+ },
1309
+ {
1310
+ name: "remaining_vaulted_tokens",
1311
+ type: "u64"
1312
+ },
1313
+ {
1314
+ name: "tokens_transferred",
1315
+ type: "u64"
1316
+ },
1317
+ {
1318
+ name: "initial_vaulted",
1319
+ type: "u64"
1320
+ },
1321
+ {
1322
+ name: "timestamp",
1323
+ type: "i64"
1324
+ }
1325
+ ]
1326
+ }
1327
+ },
1328
+ {
1329
+ name: "PoolMetadata",
1330
+ type: {
1331
+ kind: "struct",
1332
+ fields: [
1333
+ {
1334
+ name: "name",
1335
+ docs: [
1336
+ "Optional pool name"
1337
+ ],
1338
+ type: "string"
1339
+ },
1340
+ {
1341
+ name: "description",
1342
+ docs: [
1343
+ "Optional pool description"
1344
+ ],
1345
+ type: "string"
1346
+ },
1347
+ {
1348
+ name: "version",
1349
+ docs: [
1350
+ "Pool version"
1351
+ ],
1352
+ type: "u8"
1353
+ }
1354
+ ]
1355
+ }
1356
+ },
1357
+ {
1358
+ name: "PoolState",
1359
+ docs: [
1360
+ "Pool state account - main state for a vAMM pool"
1361
+ ],
1362
+ type: {
1363
+ kind: "struct",
1364
+ fields: [
1365
+ {
1366
+ name: "authority",
1367
+ docs: [
1368
+ "Pool authority (creator)"
1369
+ ],
1370
+ type: "pubkey"
1371
+ },
1372
+ {
1373
+ name: "mint",
1374
+ docs: [
1375
+ "Token mint for this pool"
1376
+ ],
1377
+ type: "pubkey"
1378
+ },
1379
+ {
1380
+ name: "token_vault",
1381
+ docs: [
1382
+ "Token vault (holds unsold tokens)"
1383
+ ],
1384
+ type: "pubkey"
1385
+ },
1386
+ {
1387
+ name: "vault_authority",
1388
+ docs: [
1389
+ "Vault authority (PDA)"
1390
+ ],
1391
+ type: "pubkey"
1392
+ },
1393
+ {
1394
+ name: "sol_vault",
1395
+ docs: [
1396
+ "Pool SOL vault (holds raised SOL)"
1397
+ ],
1398
+ type: "pubkey"
1399
+ },
1400
+ {
1401
+ name: "total_positions",
1402
+ docs: [
1403
+ "Total number of positions in this pool"
1404
+ ],
1405
+ type: "u64"
1406
+ },
1407
+ {
1408
+ name: "creation_timestamp",
1409
+ docs: [
1410
+ "Pool creation timestamp (Unix timestamp)"
1411
+ ],
1412
+ type: "i64"
1413
+ },
1414
+ {
1415
+ name: "last_update_timestamp",
1416
+ docs: [
1417
+ "Last update timestamp (Unix timestamp)"
1418
+ ],
1419
+ type: "i64"
1420
+ },
1421
+ {
1422
+ name: "metadata",
1423
+ docs: [
1424
+ "Pool metadata"
1425
+ ],
1426
+ type: {
1427
+ defined: {
1428
+ name: "PoolMetadata"
1429
+ }
1430
+ }
1431
+ },
1432
+ {
1433
+ name: "vest_duration",
1434
+ docs: [
1435
+ "=== ACCRUAL SYSTEM FIELDS ===",
1436
+ "Dev-set unlock duration in seconds (applies to all traders)"
1437
+ ],
1438
+ type: "i64"
1439
+ },
1440
+ {
1441
+ name: "next_position_number",
1442
+ docs: [
1443
+ "Next position number to assign (sequential counter for display/identity)"
1444
+ ],
1445
+ type: "u64"
1446
+ },
1447
+ {
1448
+ name: "vamm_active",
1449
+ docs: [
1450
+ "=== VAMM STATE ===",
1451
+ "vAMM is active for trading"
1452
+ ],
1453
+ type: "bool"
1454
+ },
1455
+ {
1456
+ name: "vamm_real_sol",
1457
+ docs: [
1458
+ "Real SOL in the vAMM"
1459
+ ],
1460
+ type: "u64"
1461
+ },
1462
+ {
1463
+ name: "vamm_tokens",
1464
+ docs: [
1465
+ "Real tokens in the vAMM"
1466
+ ],
1467
+ type: "u64"
1468
+ },
1469
+ {
1470
+ name: "vamm_k",
1471
+ docs: [
1472
+ "The invariant k (set at creation, never changes)",
1473
+ "k = (vamm_real_sol + VIRTUAL_SOL) * vamm_tokens"
1474
+ ],
1475
+ type: "u128"
1476
+ },
1477
+ {
1478
+ name: "tokens_sold",
1479
+ docs: [
1480
+ "Cumulative tokens bought from vAMM (increases on buy, decreases on sell)"
1481
+ ],
1482
+ type: "u64"
1483
+ },
1484
+ {
1485
+ name: "tokens_reserved_for_claims",
1486
+ docs: [
1487
+ "Vault tokens reserved for position claims (not available for vAMM liquidity)",
1488
+ "Incremented on buy (vaulted portion), decremented on claim_accrued"
1489
+ ],
1490
+ type: "u64"
1491
+ },
1492
+ {
1493
+ name: "bump_vault_auth",
1494
+ docs: [
1495
+ "Bump seeds for PDAs"
1496
+ ],
1497
+ type: "u8"
1498
+ },
1499
+ {
1500
+ name: "bump_pool",
1501
+ type: "u8"
1502
+ }
1503
+ ]
1504
+ }
1505
+ },
1506
+ {
1507
+ name: "Position",
1508
+ docs: [
1509
+ "Position in a vAMM pool",
1510
+ "Tokens split into tradable (immediate) and vaulted (accrue linearly over vest_duration)"
1511
+ ],
1512
+ type: {
1513
+ kind: "struct",
1514
+ fields: [
1515
+ {
1516
+ name: "owner",
1517
+ docs: [
1518
+ "Owner's public key"
1519
+ ],
1520
+ type: {
1521
+ array: [
1522
+ "u8",
1523
+ 32
1524
+ ]
1525
+ }
1526
+ },
1527
+ {
1528
+ name: "pool",
1529
+ docs: [
1530
+ "Pool this position belongs to"
1531
+ ],
1532
+ type: {
1533
+ array: [
1534
+ "u8",
1535
+ 32
1536
+ ]
1537
+ }
1538
+ },
1539
+ {
1540
+ name: "tradable_tokens",
1541
+ docs: [
1542
+ "Tradable tokens (can be sold immediately)"
1543
+ ],
1544
+ type: "u64"
1545
+ },
1546
+ {
1547
+ name: "vaulted_tokens",
1548
+ docs: [
1549
+ "Vaulted tokens (accruing linearly to tradable)"
1550
+ ],
1551
+ type: "u64"
1552
+ },
1553
+ {
1554
+ name: "sol_spent",
1555
+ docs: [
1556
+ "SOL spent on this position"
1557
+ ],
1558
+ type: "u64"
1559
+ },
1560
+ {
1561
+ name: "tokens_transferred",
1562
+ docs: [
1563
+ "Cumulative tokens transferred to wallet (for claim_accrued tracking)"
1564
+ ],
1565
+ type: "u64"
1566
+ },
1567
+ {
1568
+ name: "entry_timestamp",
1569
+ docs: [
1570
+ "Entry timestamp (for accrual calculation)"
1571
+ ],
1572
+ type: "i64"
1573
+ },
1574
+ {
1575
+ name: "initial_vaulted",
1576
+ docs: [
1577
+ "Cumulative initial vaulted tokens from all buys (for accrual calculation)",
1578
+ "This tracks the total vaulted amount at buy time, used to calculate accrual progress"
1579
+ ],
1580
+ type: "u64"
1581
+ },
1582
+ {
1583
+ name: "position_number",
1584
+ docs: [
1585
+ "Position number in the pool (sequential counter for display/identity)"
1586
+ ],
1587
+ type: "u64"
1588
+ },
1589
+ {
1590
+ name: "last_update_timestamp",
1591
+ docs: [
1592
+ "Last update timestamp"
1593
+ ],
1594
+ type: "i64"
1595
+ }
1596
+ ]
1597
+ }
1598
+ },
1599
+ {
1600
+ name: "PositionClosed",
1601
+ docs: [
1602
+ "Event emitted when a position account is closed"
1603
+ ],
1604
+ type: {
1605
+ kind: "struct",
1606
+ fields: [
1607
+ {
1608
+ name: "owner",
1609
+ type: "pubkey"
1610
+ },
1611
+ {
1612
+ name: "pool",
1613
+ type: "pubkey"
1614
+ },
1615
+ {
1616
+ name: "position",
1617
+ type: "pubkey"
1618
+ },
1619
+ {
1620
+ name: "rent_reclaimed",
1621
+ type: "u64"
1622
+ },
1623
+ {
1624
+ name: "timestamp",
1625
+ type: "i64"
1626
+ }
1627
+ ]
1628
+ }
1629
+ },
1630
+ {
1631
+ name: "TokenCreated",
1632
+ docs: [
1633
+ "Event emitted when a new token and vAMM pool is created"
1634
+ ],
1635
+ type: {
1636
+ kind: "struct",
1637
+ fields: [
1638
+ {
1639
+ name: "mint",
1640
+ type: "pubkey"
1641
+ },
1642
+ {
1643
+ name: "pool",
1644
+ type: "pubkey"
1645
+ },
1646
+ {
1647
+ name: "creator",
1648
+ type: "pubkey"
1649
+ },
1650
+ {
1651
+ name: "name",
1652
+ type: "string"
1653
+ },
1654
+ {
1655
+ name: "symbol",
1656
+ type: "string"
1657
+ },
1658
+ {
1659
+ name: "total_supply",
1660
+ type: "u64"
1661
+ },
1662
+ {
1663
+ name: "initial_k",
1664
+ type: "u128"
1665
+ },
1666
+ {
1667
+ name: "vamm_tokens",
1668
+ type: "u64"
1669
+ },
1670
+ {
1671
+ name: "vest_duration",
1672
+ type: "i64"
1673
+ },
1674
+ {
1675
+ name: "creation_timestamp",
1676
+ type: "i64"
1677
+ }
1678
+ ]
1679
+ }
1680
+ },
1681
+ {
1682
+ name: "TokenPurchased",
1683
+ docs: [
1684
+ "Event emitted when tokens are bought"
1685
+ ],
1686
+ type: {
1687
+ kind: "struct",
1688
+ fields: [
1689
+ {
1690
+ name: "buyer",
1691
+ type: "pubkey"
1692
+ },
1693
+ {
1694
+ name: "pool",
1695
+ type: "pubkey"
1696
+ },
1697
+ {
1698
+ name: "mint",
1699
+ type: "pubkey"
1700
+ },
1701
+ {
1702
+ name: "sol_amount",
1703
+ type: "u64"
1704
+ },
1705
+ {
1706
+ name: "tokens_received",
1707
+ type: "u64"
1708
+ },
1709
+ {
1710
+ name: "vamm_real_sol",
1711
+ type: "u64"
1712
+ },
1713
+ {
1714
+ name: "vamm_tokens",
1715
+ type: "u64"
1716
+ },
1717
+ {
1718
+ name: "tokens_sold",
1719
+ type: "u64"
1720
+ },
1721
+ {
1722
+ name: "position",
1723
+ type: "pubkey"
1724
+ },
1725
+ {
1726
+ name: "position_number",
1727
+ type: "u64"
1728
+ },
1729
+ {
1730
+ name: "vest_duration",
1731
+ type: "i64"
1732
+ },
1733
+ {
1734
+ name: "unlock_time_seconds",
1735
+ type: "i64"
1736
+ },
1737
+ {
1738
+ name: "tradable_tokens",
1739
+ docs: [
1740
+ "Position state after buy"
1741
+ ],
1742
+ type: "u64"
1743
+ },
1744
+ {
1745
+ name: "vaulted_tokens",
1746
+ type: "u64"
1747
+ },
1748
+ {
1749
+ name: "sol_spent",
1750
+ type: "u64"
1751
+ },
1752
+ {
1753
+ name: "tokens_transferred",
1754
+ type: "u64"
1755
+ },
1756
+ {
1757
+ name: "initial_vaulted",
1758
+ type: "u64"
1759
+ },
1760
+ {
1761
+ name: "timestamp",
1762
+ type: "i64"
1763
+ }
1764
+ ]
1765
+ }
1766
+ },
1767
+ {
1768
+ name: "TokenSold",
1769
+ docs: [
1770
+ "Event emitted when tokens are sold"
1771
+ ],
1772
+ type: {
1773
+ kind: "struct",
1774
+ fields: [
1775
+ {
1776
+ name: "seller",
1777
+ type: "pubkey"
1778
+ },
1779
+ {
1780
+ name: "pool",
1781
+ type: "pubkey"
1782
+ },
1783
+ {
1784
+ name: "mint",
1785
+ type: "pubkey"
1786
+ },
1787
+ {
1788
+ name: "token_amount",
1789
+ type: "u64"
1790
+ },
1791
+ {
1792
+ name: "sol_received",
1793
+ type: "u64"
1794
+ },
1795
+ {
1796
+ name: "vamm_real_sol",
1797
+ type: "u64"
1798
+ },
1799
+ {
1800
+ name: "vamm_tokens",
1801
+ type: "u64"
1802
+ },
1803
+ {
1804
+ name: "tokens_sold",
1805
+ type: "u64"
1806
+ },
1807
+ {
1808
+ name: "position",
1809
+ type: "pubkey"
1810
+ },
1811
+ {
1812
+ name: "position_number",
1813
+ type: "u64"
1814
+ },
1815
+ {
1816
+ name: "vest_duration",
1817
+ type: "i64"
1818
+ },
1819
+ {
1820
+ name: "unlock_time_seconds",
1821
+ type: "i64"
1822
+ },
1823
+ {
1824
+ name: "tradable_tokens",
1825
+ docs: [
1826
+ "Position state after sell"
1827
+ ],
1828
+ type: "u64"
1829
+ },
1830
+ {
1831
+ name: "vaulted_tokens",
1832
+ type: "u64"
1833
+ },
1834
+ {
1835
+ name: "sol_spent",
1836
+ type: "u64"
1837
+ },
1838
+ {
1839
+ name: "tokens_transferred",
1840
+ type: "u64"
1841
+ },
1842
+ {
1843
+ name: "initial_vaulted",
1844
+ type: "u64"
1845
+ },
1846
+ {
1847
+ name: "timestamp",
1848
+ type: "i64"
1849
+ }
1850
+ ]
1851
+ }
1852
+ }
1853
+ ]
1854
+ };
1855
+
1856
+ // src/program.ts
1857
+ var DUMMY_WALLET = {
1858
+ publicKey: PublicKey.default,
1859
+ signTransaction: async (tx) => tx,
1860
+ signAllTransactions: async (txs) => txs
1861
+ };
1862
+ function getProgram(connection) {
1863
+ const provider = new AnchorProvider(connection, DUMMY_WALLET, { commitment: "confirmed" });
1864
+ return new Program(hodl_default, provider);
1865
+ }
1866
+
1867
+ // src/accounts.ts
1868
+ async function fetchPoolState(connection, mint, config) {
1869
+ const program = getProgram(connection);
1870
+ const [poolStatePDA] = getPoolStatePDA(mint, config.programId);
1871
+ return program.account.poolState.fetch(poolStatePDA);
1872
+ }
1873
+ async function fetchPosition(connection, poolState, owner, config) {
1874
+ const program = getProgram(connection);
1875
+ const [positionPDA] = getPositionPDA(poolState, owner, config.programId);
1876
+ return program.account.position.fetch(positionPDA);
1877
+ }
1878
+ async function fetchPoolStateByAddress(connection, poolStatePDA) {
1879
+ const program = getProgram(connection);
1880
+ return program.account.poolState.fetch(poolStatePDA);
1881
+ }
1882
+
1883
+ export { fetchPoolState, fetchPoolStateByAddress, fetchPosition };
1884
+ //# sourceMappingURL=accounts.js.map
1885
+ //# sourceMappingURL=accounts.js.map